From 41bbfbffb954e7406420c946c10962c1705e9603 Mon Sep 17 00:00:00 2001 From: ItsDrike Date: Fri, 23 Jul 2021 18:33:12 +0200 Subject: [PATCH 1/2] Add more vim mappings --- home/.config/nvim/rc/mappings.vim | 55 ++++++++++++++++++++----------- 1 file changed, 35 insertions(+), 20 deletions(-) diff --git a/home/.config/nvim/rc/mappings.vim b/home/.config/nvim/rc/mappings.vim index 2d746c0..dfb3893 100644 --- a/home/.config/nvim/rc/mappings.vim +++ b/home/.config/nvim/rc/mappings.vim @@ -1,3 +1,38 @@ +" Unmap arrow keys in normal mode to remove bad habits +nnoremap +nnoremap +nnoremap +nnoremap + +" Stop search highlight on esc (until next search) +map :noh + +" System clipboard interactions +map "+y +vnoremap "+p + +" Spell-check set to o, 'o' for 'orthography' +map o :setlocal spell! spelllang=en_US + +" Use shift to move 10 lines up/down quickly +noremap K 10k +noremap J 10j + +" Tab navigation +nnoremap gt +nnoremap gT +nnoremap :tabnew +nnoremap :tabmove + +nnoremap :tabmove - +nnoremap :tabp +nnoremap :tabn + +" Alias replace all +nnoremap :%s//gI + +" Save file as sudo when no write permissions +cmap w!! w !sudo tee > /dev/null % + " Remap splits navigation to just CTRL + hjkl nnoremap h nnoremap j @@ -10,23 +45,3 @@ noremap :vertical resize -3 noremap :resize +3 noremap :resize -3 -" Spell-check set to o, 'o' for 'orthography' -map o :setlocal spell! spelllang=en_US - -" Stop search highlight (until next search) -map :noh - -" System clipboard interactions -map "+y -vnoremap "+p - -" Unmap arrow keys in normal mode to remove bad habits -nnoremap -nnoremap -nnoremap -nnoremap - -" Use shift to move 10 lines up/down quickly -noremap K 10k -noremap J 10j - From dd42a281e2ed44f32471417a31bf464efc257614 Mon Sep 17 00:00:00 2001 From: ItsDrike Date: Fri, 23 Jul 2021 18:33:57 +0200 Subject: [PATCH 2/2] Add abbreviations --- home/.config/nvim/init.vim | 1 + home/.config/nvim/rc/abbreviations.vim | 11 +++++++++++ 2 files changed, 12 insertions(+) create mode 100644 home/.config/nvim/rc/abbreviations.vim diff --git a/home/.config/nvim/init.vim b/home/.config/nvim/init.vim index 543c13d..a3eb04a 100644 --- a/home/.config/nvim/init.vim +++ b/home/.config/nvim/init.vim @@ -6,6 +6,7 @@ let config_dir = system('echo -n "${XDG_CONFIG_HOME:-$HOME/.config}/nvim"') let rc_dir = config_dir.'/rc' execute 'source '.rc_dir.'/base.vim' execute 'source '.rc_dir.'/mappings.vim' +execute 'source '.rc_dir.'/abbreviations.vim' execute 'source '.rc_dir.'/autocmd.vim' execute 'source '.rc_dir.'/plugins.vim' " Needs to be below plugins for colorscheme diff --git a/home/.config/nvim/rc/abbreviations.vim b/home/.config/nvim/rc/abbreviations.vim new file mode 100644 index 0000000..69019a6 --- /dev/null +++ b/home/.config/nvim/rc/abbreviations.vim @@ -0,0 +1,11 @@ +cnoreabbrev Wq wq +cnoreabbrev wQ wq +cnoreabbrev WQ wq +cnoreabbrev Wa wa +cnoreabbrev W w +cnoreabbrev Q q +cnoreabbrev Qall qall +cnoreabbrev W! w! +cnoreabbrev Q! q! +cnoreabbrev Qall! qall! +