From af2d7cb449053c3869a952ac65e23ca5ce8a8ff0 Mon Sep 17 00:00:00 2001 From: zachir Date: Wed, 23 Aug 2023 02:02:19 -0500 Subject: Better nvim mapping formatting --- nvim/init.vim | 65 ++++++++++++++++++++++++++++++++--------------------------- 1 file changed, 35 insertions(+), 30 deletions(-) diff --git a/nvim/init.vim b/nvim/init.vim index 6df2934..080625e 100644 --- a/nvim/init.vim +++ b/nvim/init.vim @@ -200,6 +200,8 @@ augroup end " }}} " keybindings {{{ +" direction keys + inoremap gj inoremap gk inoremap g @@ -208,35 +210,38 @@ vnoremap gj vnoremap gk vnoremap g vnoremap g -noremap gj -noremap gk +nnoremap gj +nnoremap gk + +" clear search highlights +nnoremap / :noh " toggles -noremap tn :set number! -noremap tr :set relativenumber! -noremap tt :NERDTreeToggle +nnoremap tn :set number! +nnoremap tr :set relativenumber! +nnoremap tt :NERDTreeToggle " tabs -noremap th :tabprevious -noremap tl :tabnext -noremap tk :tabnew -noremap tj :tabclose +nnoremap th :tabprevious +nnoremap tl :tabnext +nnoremap tk :tabnew +nnoremap tj :tabclose " splits -noremap wh :vertical resize -1 -noremap wj :resize -1 -noremap wk :resize +1 -noremap wl :vertical resize +1 +nnoremap wh :vertical resize -1 +nnoremap wj :resize -1 +nnoremap wk :resize +1 +nnoremap wl :vertical resize +1 " config -noremap en :e ~/.config/nvim/init.vim -noremap ec :source % +nnoremap en :e ~/.config/nvim/init.vim +nnoremap ec :source % " write as root -noremap ZW :w !pkexec tee % >/dev/null +nnoremap ZW :w !pkexec tee % >/dev/null " Goyo -noremap G :Goyo +nnoremap G :Goyo " windows nnoremap h @@ -250,26 +255,26 @@ vnoremap l " files " these may go away soon -noremap xx :q -noremap x! :q! +nnoremap xx :q +nnoremap x! :q! " these are the new standard -noremap qq :q -noremap q! :q! -noremap wq :wq -noremap ww :w -noremap ee :e +nnoremap qq :q +nnoremap q! :q! +nnoremap wq :wq +nnoremap ww :w +nnoremap ee :e " escape for term windows tnoremap " vim-plug -noremap pi :PlugInstall -noremap pu :PlugUpdate -noremap pU :PlugUpgrade -noremap pc :PlugClean +nnoremap pi :PlugInstall +nnoremap pu :PlugUpdate +nnoremap pU :PlugUpgrade +nnoremap pc :PlugClean " fugitive -noremap gp :G pull -noremap gd :G diff % +nnoremap gp :G pull +nnoremap gd :G diff % " }}} -- cgit v1.2.3