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! + 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 -