" map leader to which_key " call which_key#register('', "g:which_key_map") nnoremap :silent WhichKey ' ' vnoremap :silent WhichKeyVisual ' ' let g:which_key_map = {} let g:which_key_sep = '→' " set timeoutlen=100 " Not a fan of floating windows for this let g:which_key_use_floating_win = 0 " Change the colors if you want highlight default link WhichKey Operator highlight default link WhichKeySeperator DiffAdded highlight default link WhichKeyGroup Identifier highlight default link WhichKeyDesc Function " Hide status line autocmd! FileType which_key autocmd FileType which_key set laststatus=0 noshowmode noruler \| autocmd BufLeave set laststatus=2 noshowmode ruler " f is for find let g:which_key_map.f = { \ 'name' : '+find' , \ '/' : [':History/' , 'history'], \ ';' : [':Commands' , 'commands'], \ 'a' : [':Ag' , 'text Ag'], \ 'b' : [':BLines' , 'current buffer'], \ 'B' : [':Buffers' , 'open buffers'], \ 'c' : [':Commits' , 'commits'], \ 'C' : [':BCommits' , 'buffer commits'], \ 'f' : [':Files' , 'files'], \ 'g' : [':GFiles' , 'git files'], \ 'G' : [':GFiles?' , 'modified git files'], \ 'h' : [':History' , 'file history'], \ 'H' : [':History:' , 'command history'], \ 'l' : [':Lines' , 'lines'] , \ 'm' : [':Marks' , 'marks'] , \ 'M' : [':Maps' , 'normal maps'] , \ 'p' : [':Helptags' , 'help tags'] , \ 'r' : [':Rg' , 'text Rg'], \ 's' : [':Snippets' , 'snippets'], \ 'S' : [':Colors' , 'color schemes'], \ 't' : [':Tags' , 'project tags'], \ 'T' : [':BTags' , 'buffer tags'], \ 'w' : [':Windows' , 'search windows'], \ 'y' : [':Filetypes' , 'file types'], \ 'z' : [':FZF' , 'FZF'], \ } let g:fzf_buffers_jump = 1 " l is for language server protocol let g:which_key_map.l = { \ 'name' : '+lsp' , \ '.' : [':CocConfig' , 'config'], \ ';' : ['(coc-refactor)' , 'refactor'], \ 'a' : ['(coc-codeaction)' , 'line action'], \ 'A' : ['(coc-codeaction-selected)' , 'selected action'], \ 'b' : [':CocNext' , 'next action'], \ 'B' : [':CocPrev' , 'prev action'], \ 'c' : [':CocList commands' , 'commands'], \ 'd' : ['(coc-definition)' , 'definition'], \ 'D' : ['(coc-declaration)' , 'declaration'], \ 'e' : [':CocList extensions' , 'extensions'], \ 'f' : ['(coc-format-selected)' , 'format selected'], \ 'F' : ['(coc-format)' , 'format'], \ 'h' : ['(coc-float-hide)' , 'hide'], \ 'i' : ['(coc-implementation)' , 'implementation'], \ 'I' : [':CocList diagnostics' , 'diagnostics'], \ 'j' : ['(coc-float-jump)' , 'float jump'], \ 'l' : ['(coc-codelens-action)' , 'code lens'], \ 'n' : ['(coc-diagnostic-next)' , 'next diagnostic'], \ 'N' : ['(coc-diagnostic-next-error)' , 'next error'], \ 'o' : ['(coc-openlink)' , 'open link'], \ 'O' : [':CocList outline' , 'outline'], \ 'p' : ['(coc-diagnostic-prev)' , 'prev diagnostic'], \ 'P' : ['(coc-diagnostic-prev-error)' , 'prev error'], \ 'q' : ['(coc-fix-current)' , 'quickfix'], \ 'r' : ['(coc-rename)' , 'rename'], \ 'R' : ['(coc-references)' , 'references'], \ 's' : [':CocList -I symbols' , 'references'], \ 't' : ['(coc-type-definition)' , 'type definition'], \ 'u' : [':CocListResume' , 'resume list'], \ 'U' : [':CocUpdate' , 'update CoC'], \ 'z' : [':CocDisable' , 'disable CoC'], \ 'Z' : [':CocEnable' , 'enable CoC'], \ } " t is for toggle let g:which_key_map.t = { \ 'name' : '+toggle' , \ 'e' : [':CocCommand explorer' , 'explorer'], \ 'n' : [':set nonumber!' , 'line-numbers'], \ 'r' : [':set norelativenumber!' , 'rel-line-numbers'], \ 's' : [':let @/ = ""' , 'remove-search-highlight'], \ 'c' : [':ColorizerToggle' , 'colorizer'], \ 't' : [':FloatermToggle' , 'terminal'], \ } call which_key#register('', "g:which_key_map")