From e36365b4e8af92a0d587d389d799b118891a3d47 Mon Sep 17 00:00:00 2001 From: tastytea Date: Sat, 13 Aug 2022 01:34:38 +0200 Subject: [PATCH] nvim: cleanup --- .config/nvim/lua/my/fileformats.lua | 5 ++--- .config/nvim/lua/my/keymaps.lua | 20 ++++++++++---------- .config/nvim/lua/my/settings.lua | 5 ++--- 3 files changed, 14 insertions(+), 16 deletions(-) diff --git a/.config/nvim/lua/my/fileformats.lua b/.config/nvim/lua/my/fileformats.lua index 0f0ca0c..0908dc5 100644 --- a/.config/nvim/lua/my/fileformats.lua +++ b/.config/nvim/lua/my/fileformats.lua @@ -9,14 +9,13 @@ packer.use { require'nvim-treesitter.configs'.setup { highlight = { enable = true, - additional_vim_regex_highlighting = {'org'} + additional_vim_regex_highlighting = { 'org' } }, - ensure_installed = {'org'}, + ensure_installed = { 'org' }, } end } --- org packer.use { 'https://github.com/nvim-orgmode/orgmode', requires = 'https://github.com/nvim-treesitter/nvim-treesitter', diff --git a/.config/nvim/lua/my/keymaps.lua b/.config/nvim/lua/my/keymaps.lua index f5275f2..888c987 100644 --- a/.config/nvim/lua/my/keymaps.lua +++ b/.config/nvim/lua/my/keymaps.lua @@ -8,26 +8,26 @@ vim.g.maplocalleader = ' ' -- (2 spaces) local format = string.format -- buffers -map('n', 'b', ':buffers:buffer') +map('n', 'b', ':buffers:buffer') for key, cmd in pairs({ Left = 'bprevious', Right = 'bnext' }) do map('n', format('', key), format(':%s', cmd)) map('i', format('', key), format(':%s', cmd)) end --- move buffer without moving cursor -map({ 'n', 'v' }, '', '') -map({ 'n', 'v' }, '', '') +---- move buffer without moving cursor +map({ 'n', 'v' }, '', '') +map({ 'n', 'v' }, '', '') ---windows +-- windows for key, letter in pairs({ Left = 'h', Down = 'j', Up = 'k', Right = 'l' }) do map('n', format('', key), format(':wincmd %s', letter)) map('i', format('', key), format(':wincmd %s', letter)) end -- remove word -map('n', '', 'db') +map('n', '', 'db') vim.cmd([[map! ]]) -- TODO: figure out how to do that with lua -map('n', '', 'dw') -map('i', '', 'dw') +map('n', '', 'dw') +map('i', '', 'dw') -- remove whitespace around cursor map({ 'n', 'i' }, '', @@ -75,8 +75,8 @@ map({ 'n', 'v' }, '', '==') -- re-indent line -- select text with shift + arrow for _, key in ipairs({ 'Left', 'Up', 'Down', 'Right' }) do - map({ 'n', 'i' }, format('', key), format('v<%s>', key)) - map({ 'v' }, format('', key), format('<%s>', key)) + map({ 'n', 'i' }, format('', key), format('v<%s>', key)) + map({ 'v' }, format('', key), format('<%s>', key)) end map('n', '', ':Lexplore 20') -- file explorer, 20% width diff --git a/.config/nvim/lua/my/settings.lua b/.config/nvim/lua/my/settings.lua index bc6f7f3..f806130 100644 --- a/.config/nvim/lua/my/settings.lua +++ b/.config/nvim/lua/my/settings.lua @@ -8,7 +8,7 @@ vim.o.linebreak = true -- break on word boundaries vim.o.cursorline = true -- highlight row with cursor vim.o.scrolloff = 5 -- show 5 lines below/above cursor -vim.o.sidescrolloff = 5 -- same fore left/right +vim.o.sidescrolloff = 5 -- same for left/right vim.o.expandtab = true -- indent using spaces vim.o.tabstop = 4 -- 1 tab = 4 spaces vim.o.shiftwidth = 4 -- 1 indentation = 4 spaces @@ -16,11 +16,10 @@ vim.o.completeopt = 'menu,menuone,noselect' -- completion popup vim.o.autochdir = true -- change workir to current file dir vim.o.updatetime = 500 -- fire CursorHold autocommand event vim.o.cmdheight = 2 -- message area size --- vim.o.mouse = 'nv' -- make use of mouse in these modes +vim.o.mouse = '' -- make use of mouse in these modes vim.o.pumheight = 10 -- maximum entries in popup menu vim.o.smartindent = true -- indent after { and so on - -- theme vim.o.termguicolors = true -- 24 bit colours packer.use {