summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzachir <zachir@librem.one>2023-08-23 02:02:19 -0500
committerzachir <zachir@librem.one>2023-10-19 09:29:01 -0500
commitaf2d7cb449053c3869a952ac65e23ca5ce8a8ff0 (patch)
tree93a124b74fca8c10a9a007a47a4d8ce9bffb4e16
parent96b08242543d2585f7569b779b7d911298af8bb3 (diff)
Better nvim mapping formatting
-rw-r--r--nvim/init.vim65
1 files 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 <Down> <C-o>gj
inoremap <Up> <C-o>gk
inoremap <Home> <C-o>g<Home>
@@ -208,35 +210,38 @@ vnoremap <Down> <C-o>gj
vnoremap <Up> <C-o>gk
vnoremap <Home> <C-o>g<Home>
vnoremap <End> <C-o>g<End>
-noremap <Down> gj
-noremap <Up> gk
+nnoremap <Down> gj
+nnoremap <Up> gk
+
+" clear search highlights
+nnoremap <leader>/ :noh<CR>
" toggles
-noremap <leader>tn :set number!<CR>
-noremap <leader>tr :set relativenumber!<CR>
-noremap <leader>tt :NERDTreeToggle<CR>
+nnoremap <leader>tn :set number!<CR>
+nnoremap <leader>tr :set relativenumber!<CR>
+nnoremap <leader>tt :NERDTreeToggle<CR>
" tabs
-noremap <leader>th :tabprevious<CR>
-noremap <leader>tl :tabnext<CR>
-noremap <leader>tk :tabnew<CR>
-noremap <leader>tj :tabclose<CR>
+nnoremap <leader>th :tabprevious<CR>
+nnoremap <leader>tl :tabnext<CR>
+nnoremap <leader>tk :tabnew<CR>
+nnoremap <leader>tj :tabclose<CR>
" splits
-noremap <leader>wh :vertical resize -1<CR>
-noremap <leader>wj :resize -1<CR>
-noremap <leader>wk :resize +1<CR>
-noremap <leader>wl :vertical resize +1<CR>
+nnoremap <leader>wh :vertical resize -1<CR>
+nnoremap <leader>wj :resize -1<CR>
+nnoremap <leader>wk :resize +1<CR>
+nnoremap <leader>wl :vertical resize +1<CR>
" config
-noremap <leader>en :e ~/.config/nvim/init.vim<CR>
-noremap <leader>ec :source %<CR>
+nnoremap <leader>en :e ~/.config/nvim/init.vim<CR>
+nnoremap <leader>ec :source %<CR>
" write as root
-noremap ZW :w !pkexec tee % >/dev/null
+nnoremap ZW :w !pkexec tee % >/dev/null
" Goyo
-noremap <leader>G :Goyo<CR>
+nnoremap <leader>G :Goyo<CR>
" windows
nnoremap <C-h> <C-w>h
@@ -250,26 +255,26 @@ vnoremap <C-l> <C-w>l
" files
" these may go away soon
-noremap <leader>xx :q<CR>
-noremap <leader>x! :q!<CR>
+nnoremap <leader>xx :q<CR>
+nnoremap <leader>x! :q!<CR>
" these are the new standard
-noremap <leader>qq :q<CR>
-noremap <leader>q! :q!<CR>
-noremap <leader>wq :wq<CR>
-noremap <leader>ww :w<CR>
-noremap <leader>ee :e
+nnoremap <leader>qq :q<CR>
+nnoremap <leader>q! :q!<CR>
+nnoremap <leader>wq :wq<CR>
+nnoremap <leader>ww :w<CR>
+nnoremap <leader>ee :e
" escape for term windows
tnoremap <Esc> <C-\><C-n>
" vim-plug
-noremap <leader>pi :PlugInstall<CR>
-noremap <leader>pu :PlugUpdate<CR>
-noremap <leader>pU :PlugUpgrade<CR>
-noremap <leader>pc :PlugClean<CR>
+nnoremap <leader>pi :PlugInstall<CR>
+nnoremap <leader>pu :PlugUpdate<CR>
+nnoremap <leader>pU :PlugUpgrade<CR>
+nnoremap <leader>pc :PlugClean<CR>
" fugitive
-noremap <leader>gp :G pull<CR>
-noremap <leader>gd :G diff %<CR>
+nnoremap <leader>gp :G pull<CR>
+nnoremap <leader>gd :G diff %<CR>
" }}}