diff --git a/lua/custom/zwergius/remap.lua b/lua/custom/zwergius/remap.lua index e67bfa89..efc1f019 100644 --- a/lua/custom/zwergius/remap.lua +++ b/lua/custom/zwergius/remap.lua @@ -7,3 +7,14 @@ vim.keymap.set('n', '', 'h', { noremap = true, silent = true }) vim.keymap.set('n', '', 'j', { noremap = true, silent = true }) vim.keymap.set('n', '', 'k', { noremap = true, silent = true }) vim.keymap.set('n', '', 'l', { noremap = true, silent = true }) + +-- Jump and keep cursor in the middle +vim.keymap.set('n', '', 'zz') +vim.keymap.set('n', '', 'zz') + +-- Keep searchterms in the middle +vim.keymap.set('n', 'n', 'nzzzv') +vim.keymap.set('n', 'N', 'Nzzzv') + +-- Paste over visually selected maintaining clipboard +vim.keymap.set('x', 'p', [["_dP]]) diff --git a/lua/custom/zwergius/set.lua b/lua/custom/zwergius/set.lua index 7cbb091e..58ff14a4 100644 --- a/lua/custom/zwergius/set.lua +++ b/lua/custom/zwergius/set.lua @@ -2,6 +2,9 @@ vim.opt.number = true vim.opt.relativenumber = true +-- no line wrap +vim.opt.wrap = false + -- Indents vim.opt.tabstop = 2 vim.opt.softtabstop = 2 @@ -9,10 +12,20 @@ vim.opt.shiftwidth = 2 vim.opt.expandtab = true vim.opt.smartindent = true +-- Infinite undo +vim.opt.undodir = os.getenv 'HOME' .. '/.vim/undodir' +vim.opt.undofile = true + -- Set highlight on search -vim.o.hlsearch = false +vim.o.hlsearch = true vim.opt.incsearch = true +-- Scroll buffer +vim.opt.scrolloff = 8 + +-- not sure +vim.opt.colorcolumn = '80' + -- Filetype overrides vim.filetype.add { extension = {