Adds a couple of settings and remaps

This commit is contained in:
zwergius 2024-01-24 16:03:22 +01:00
parent 6a8f6a9bb8
commit 82a8ea9330
2 changed files with 25 additions and 1 deletions

View File

@ -7,3 +7,14 @@ vim.keymap.set('n', '<C-h>', '<C-w>h', { noremap = true, silent = true })
vim.keymap.set('n', '<C-j>', '<C-w>j', { noremap = true, silent = true })
vim.keymap.set('n', '<C-k>', '<C-w>k', { noremap = true, silent = true })
vim.keymap.set('n', '<C-l>', '<C-w>l', { noremap = true, silent = true })
-- Jump and keep cursor in the middle
vim.keymap.set('n', '<C-d>', '<C-d>zz')
vim.keymap.set('n', '<C-u>', '<C-u>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', '<leader>p', [["_dP]])

View File

@ -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 = {