diff --git a/.config/nvim/maps.vim b/.config/nvim/maps.vim index cea5be0..e93308a 100644 --- a/.config/nvim/maps.vim +++ b/.config/nvim/maps.vim @@ -82,18 +82,15 @@ nnoremap / :noh " tmux setup) nnoremap - :sp nnoremap \ :vsp - -" Spell check set to O, 'o' for 'orthography': -" Move to the prev/next spelling error with [S ]S -" Move to the prev/next spelling error or suggestion with [s ]s -noremap O :setlocal spell! spelllang=en_us -noremap OE :setlocal spell! spelllang=en_us -noremap OG :setlocal spell! spelllang=de_de -noremap o z= +" 'open new buffer' with leader-t (opens new buffer containing current dir and switches to it) +nnoremap t :vsp . +" open actual new tab with leader-T +nnoremap T :tabedit . " select the whole buffer with -a nnoremap a ggVG +" CONFIG EDITING " quickly edit vimrc with leader+V nnoremap V :vsp $MYVIMRC " automatically source the vimrc file whenever it is saved (causes slowdown @@ -102,17 +99,16 @@ nnoremap V :vsp $MYVIMRC " source vimrc with keystroke combination nnoremap VV :source $MYVIMRC -" remove all trailing whitespaces -" on pressing space+W -nnoremap W :%s/\s\+$//:let @/='' -" automatically on saving -" autocmd BufWritePre * :%s/\s\+$//e - -" 'open new buffer' with leader-t (opens new buffer and switches to it) -" open actual new tab with leader-T -nnoremap t :vsp . -nnoremap T :tabedit . +" SPELL CHECKING +" Spell check set to O, 'o' for 'orthography': +" Move to the prev/next spelling error with [S ]S +" Move to the prev/next spelling error or suggestion with [s ]s +noremap O :setlocal spell! spelllang=en_us +noremap OE :setlocal spell! spelllang=en_us +noremap OG :setlocal spell! spelllang=de_de +noremap o z= +" NERDTree " open/close NERDtree with leader-e " whatever method tree has been opened by, leader-e closes it again nnoremap e :NERDTreeToggle @@ -121,6 +117,43 @@ nnoremap :NERDTreeVCS " open current nerdtree with current file highlighted nnoremap E :NERDTreeFind +" GLOBAL FUZZY FINDING +" FZF buffers and files in current workdir +noremap s :FzfBuffers +" FZF most recently used / MRU, bound to S since it is essentially a larger +" go-back intention than just buffers +noremap S :FzfHistory +" fuzzy find files in cwd +noremap f :FzfFiles + +" FZF general full-text search in cwd with rg +noremap F :FzfRg +" FZF git diff +noremap gd :FzfGFiles? + +" FZF colorschemes +nnoremap :FzfColors +" Toggle background light/dark +call togglebg#map("") + +" Note Searching +" Notational-FZF +" set notational-fzf-vim keys for the NV window itself +let g:nv_fzf_binds = [ + \ 'alt-a:select-all', + \ 'alt-q:deselect-all', + \ 'alt-p:toggle-preview', + \ 'alt-u:page-up', + \ 'alt-d:page-down', + \ 'ctrl-w:backward-kill-word', + \ ] +" FZF note full-text search with notational-velocity like functions (in wiki +" directory) +noremap n :NV +noremap N :NV! +" (non-fuzzy) search in wiki with ctrlsf, in fullscreen window +nnoremap wf :execute(":call SearchWiki()") + " vim-go mappings - will only activate in go files " most of this credit to https://hackernoon.com/my-neovim-setup-for-go-7f7b6e805876 " switch between test file and function @@ -138,51 +171,10 @@ au FileType go nnoremap :GoCoverageToggle -short " go to the definition of whatever you hover over au FileType go nnoremap (go-def) -" Configure notational-fzf-vim -let g:nv_search_paths = [ g:wiki_root ] -let g:nv_wrap_preview_text=1 -" Dictionary with string keys and values. Must be in the form 'ctrl-KEY': -" 'command' or 'alt-KEY' : 'command'. See examples below. -let g:nv_fzf_binds = [ - \ 'alt-a:select-all', - \ 'alt-q:deselect-all', - \ 'alt-p:toggle-preview', - \ 'alt-u:page-up', - \ 'alt-d:page-down', - \ 'ctrl-w:backward-kill-word', - \ ] - - -" search in wiki with ctrlsf, in fullscreen window -nnoremap wf :execute(":call SearchWiki()") - -" FUZZY FINDING -" FZF buffers and files in current workdir -noremap s :FzfBuffers -" FZF most recently used / MRU, bound to S since it is essentially a larger -" go-back intention than just buffers -noremap S :FzfHistory -noremap f :FzfFiles - " use wiki.vim to look through document outlines in fzf (only for note " directory atm) nnoremap l :WikiFzfToc -" FZF general full-text search in cwd with rg -noremap F :FzfRg -" FZF note full-text search with notational-velocity like functions (in wiki -" directory) -noremap n :NV -noremap N :NV! - -" FZF git diff -noremap gd :FzfGFiles? - -" FZF colorschemes -nnoremap :FzfColors -" Toggle background light/dark -call togglebg#map("") - " Mostly dealing with Prose writing from here on out " Format current Paragraph (esp useful in prose writing) nnoremap q gqap