" No arrow keys noremap noremap noremap noremap inoremap inoremap inoremap inoremap " Quick window switching nmap h nmap j nmap k nmap l " ============================================================================ " " === KEY MAPPINGS === " " ============================================================================ " " === Denite shorcuts === " " ; - Browser currently open buffers " t - Browse list of files in current directory " g - Search current directory for occurences of given term and close window if no results " j - Search current directory for occurences of word under cursor nmap ; :Denite buffer nmap t :DeniteProjectDir file/rec nnoremap g :Denite grep:. -no-empty nnoremap j :DeniteCursorWord grep:. " Define mappings while in 'filter' mode " - Switch to normal mode inside of search results " - Exit denite window in any mode " - Open currently selected file in any mode " - Open currently selected file in a new tab " - Open currently selected file a vertical split " - Open currently selected file in a horizontal split autocmd FileType denite-filter call s:denite_filter_my_settings() function! s:denite_filter_my_settings() abort imap \ (denite_filter_quit) inoremap \ denite#do_map('quit') nnoremap \ denite#do_map('quit') inoremap \ denite#do_map('do_action') inoremap \ denite#do_map('do_action', 'tabopen') inoremap \ denite#do_map('do_action', 'vsplit') inoremap \ denite#do_map('do_action', 'split') endfunction " Define mappings while in denite window " - Opens currently selected file " q or - Quit Denite window " d - Delete currenly selected file " p - Preview currently selected file " or i - Switch to insert mode inside of filter prompt " - Open currently selected file in a new tab " - Open currently selected file a vertical split " - Open currently selected file in a horizontal split autocmd FileType denite call s:denite_my_settings() function! s:denite_my_settings() abort nnoremap \ denite#do_map('do_action') nnoremap q \ denite#do_map('quit') nnoremap \ denite#do_map('quit') nnoremap d \ denite#do_map('do_action', 'delete') nnoremap p \ denite#do_map('do_action', 'preview') nnoremap i \ denite#do_map('open_filter_buffer') nnoremap \ denite#do_map('open_filter_buffer') nnoremap \ denite#do_map('do_action', 'tabopen') nnoremap \ denite#do_map('do_action', 'vsplit') nnoremap \ denite#do_map('do_action', 'split') endfunction " === Nerdtree shorcuts === " " n - Toggle NERDTree on/off " f - Opens current file location in NERDTree nmap n :NERDTreeToggle nmap f :NERDTreeFind " === coc.nvim === " " dd - Jump to definition of current symbol " dr - Jump to references of current symbol " dj - Jump to implementation of current symbol " ds - Fuzzy search current project symbols " p - Run Prettier formatter on file nmap dd (coc-definition) nmap dr (coc-references) nmap dj (coc-implementation) nnoremap ds :CocList -I -N --top symbols nmap p :Prettier " === vim-better-whitespace === " " y - Automatically remove trailing whitespace nmap y :StripWhitespace " === Search shorcuts === " " h - Find and replace " / - Claer highlighted search terms while preserving history map h :%s/// nmap / :nohlsearch " === Easy-motion shortcuts ===" " w - Easy-motion highlights first word letters bi-directionally map w (easymotion-bd-w) " Allows you to save files you opened without write permissions via sudo cmap w!! w !sudo tee % " === vim-jsdoc shortcuts ===" " Generate jsdoc for function under cursor nmap z :JsDoc " Delete current visual selection and dump in black hole buffer before pasting " Used when you want to paste over something without it getting copied to " Vim's default buffer vnoremap p "_dP