Organize maps.vim

This commit is contained in:
Marty Oehme 2019-11-21 14:21:47 +01:00
parent c5337f5549
commit ecd23ebb59

View file

@ -82,18 +82,15 @@ nnoremap <leader>/ :noh<cr>
" tmux setup)
nnoremap <leader>- :sp<cr>
nnoremap <leader>\ :vsp<cr>
" Spell check set to <leader>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 <leader>O :setlocal spell! spelllang=en_us<CR>
noremap <leader>OE :setlocal spell! spelllang=en_us<CR>
noremap <leader>OG :setlocal spell! spelllang=de_de<CR>
noremap <leader>o z=
" 'open new buffer' with leader-t (opens new buffer containing current dir and switches to it)
nnoremap <leader>t :vsp .<cr>
" open actual new tab with leader-T
nnoremap <leader>T :tabedit .<cr>
" select the whole buffer with <leader>-a
nnoremap <leader>a ggVG
" CONFIG EDITING
" quickly edit vimrc with leader+V
nnoremap <leader>V :vsp $MYVIMRC<cr>
" automatically source the vimrc file whenever it is saved (causes slowdown
@ -102,17 +99,16 @@ nnoremap <leader>V :vsp $MYVIMRC<cr>
" source vimrc with keystroke combination
nnoremap <leader>VV :source $MYVIMRC<cr>
" remove all trailing whitespaces
" on pressing space+W
nnoremap <leader>W :%s/\s\+$//<cr>:let @/=''<CR>
" 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 <leader>t :vsp .<cr>
nnoremap <leader>T :tabedit .<cr>
" SPELL CHECKING
" Spell check set to <leader>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 <leader>O :setlocal spell! spelllang=en_us<CR>
noremap <leader>OE :setlocal spell! spelllang=en_us<CR>
noremap <leader>OG :setlocal spell! spelllang=de_de<CR>
noremap <leader>o z=
" NERDTree
" open/close NERDtree with leader-e
" whatever method tree has been opened by, leader-e closes it again
nnoremap <leader>e :NERDTreeToggle<CR>
@ -121,6 +117,43 @@ nnoremap <leader><C-e> :NERDTreeVCS<CR>
" open current nerdtree with current file highlighted
nnoremap <leader>E :NERDTreeFind<CR>
" GLOBAL FUZZY FINDING
" FZF buffers and files in current workdir
noremap <leader>s :FzfBuffers<cr>
" FZF most recently used / MRU, bound to S since it is essentially a larger
" go-back intention than just buffers
noremap <leader>S :FzfHistory<cr>
" fuzzy find files in cwd
noremap <leader>f :FzfFiles<cr>
" FZF general full-text search in cwd with rg
noremap <leader>F :FzfRg<cr>
" FZF git diff
noremap <leader>gd :FzfGFiles?<cr>
" FZF colorschemes
nnoremap <leader><F8> :FzfColors<cr>
" Toggle background light/dark
call togglebg#map("<F8>")
" 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 <leader>n :NV<cr>
noremap <leader>N :NV!<cr>
" (non-fuzzy) search in wiki with ctrlsf, in fullscreen window
nnoremap <leader>wf :execute(":call SearchWiki()")<cr>
" 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 <F9> :GoCoverageToggle -short<cr>
" go to the definition of whatever you hover over
au FileType go nnoremap <F12> <Plug>(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 <leader>wf :execute(":call SearchWiki()")<cr>
" FUZZY FINDING
" FZF buffers and files in current workdir
noremap <leader>s :FzfBuffers<cr>
" FZF most recently used / MRU, bound to S since it is essentially a larger
" go-back intention than just buffers
noremap <leader>S :FzfHistory<cr>
noremap <leader>f :FzfFiles<cr>
" use wiki.vim to look through document outlines in fzf (only for note
" directory atm)
nnoremap <leader>l :WikiFzfToc<cr>
" FZF general full-text search in cwd with rg
noremap <leader>F :FzfRg<cr>
" FZF note full-text search with notational-velocity like functions (in wiki
" directory)
noremap <leader>n :NV<cr>
noremap <leader>N :NV!<cr>
" FZF git diff
noremap <leader>gd :FzfGFiles?<cr>
" FZF colorschemes
nnoremap <leader><F8> :FzfColors<cr>
" Toggle background light/dark
call togglebg#map("<F8>")
" Mostly dealing with Prose writing from here on out
" Format current Paragraph (esp useful in prose writing)
nnoremap <silent> <leader>q gqap