| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392 | " Leader Key Mapslet @s = 'veS"'" Timeoutlet g:which_key_timeout = 100let g:which_key_display_names = {'<CR>': '↵', '<TAB>': '⇆'}" Map leader to which_keynnoremap <silent> <leader> :silent <c-u> :silent WhichKey '<Space>'<CR>vnoremap <silent> <leader> :silent <c-u> :silent WhichKeyVisual '<Space>'<CR>" Create map to add keys tolet g:which_key_map =  {}" Define a separatorlet g:which_key_sep = '→'" set timeoutlen=100" Coc Search & refactornnoremap <leader>? :CocSearch <C-R>=expand("<cword>")<CR><CR>let g:which_key_map['?'] = 'search word'" Not a fan of floating windows for thislet g:which_key_use_floating_win = 0let g:which_key_max_size = 0" let g:which_key_position = 'botright'" let g:which_key_position = 'topleft'" let g:which_key_vertical = 1" Change the colors if you want" Hide status lineautocmd! FileType which_keyautocmd  FileType which_key set laststatus=0 noshowmode noruler  \| autocmd BufLeave <buffer> set laststatus=2 noshowmode ruler" Single mappingslet g:which_key_map['/'] = [ ':call Comment()'                                 , 'comment' ]let g:which_key_map['.'] = [ ':e $MYVIMRC'                                     , 'open init' ]let g:which_key_map[';'] = [ ':Commands'                                       , 'commands' ]let g:which_key_map['='] = [ '<C-W>='                                          , 'balance windows' ]let g:which_key_map['e'] = [ ':CocCommand explorer --toggle --sources=file+'   , 'explorer' ]let g:which_key_map['h'] = [ '<C-W>s'                                          , 'split below']let g:which_key_map['n'] = [ ':let @/ = ""'                                    , 'no highlight' ]let g:which_key_map['o'] = [ ':RnvimrToggle'                                   , 'open' ]let g:which_key_map['p'] = [ ':Files'                                          , 'search files' ]let g:which_key_map['q'] = [ '<Plug>(coc-fix-current)'                         , 'quickfix' ]let g:which_key_map['T'] = [ ':TSHighlightCapturesUnderCursor'                 , 'treesitter highlight' ]let g:which_key_map['u'] = [ ':UndotreeToggle'                                 , 'undo tree']let g:which_key_map['v'] = [ '<C-W>v'                                          , 'split right']let g:which_key_map['W'] = [ ':call WindowSwap#EasyWindowSwap()'               , 'move window' ]let g:which_key_map['z'] = [ 'Goyo'                                            , 'zen' ]" Group mappings" a is for actionslet g:which_key_map.a = {      \ 'name' : '+actions' ,      \ 'c' : [':ColorizerToggle'        , 'colorizer'],      \ 'e' : [':CocCommand explorer'    , 'explorer'],      \ 'h' : [':let @/ = ""'            , 'remove search highlight'],      \ 'l' : [':Bracey'                 , 'start live server'],      \ 'L' : [':BraceyStop'             , 'stop live server'],      \ 'm' : [':MarkdownPreview'        , 'markdown preview'],      \ 'M' : [':MarkdownPreviewStop'    , 'markdown preview stop'],      \ 'n' : [':set nonumber!'          , 'line-numbers'],      \ 's' : [':s/\%V\(.*\)\%V/"\1"/'   , 'surround'],      \ 'r' : [':set norelativenumber!'  , 'relative line nums'],      \ 't' : [':FloatermToggle'         , 'terminal'],      \ 'v' : [':Codi'                   , 'virtual repl on'],      \ 'V' : [':Codi!'                  , 'virtual repl off'],      \ 'w' : [':StripWhitespace'        , 'strip whitespace'],      \ }" b is for bufferlet g:which_key_map.b = {      \ 'name' : '+buffer' ,      \ '>' : [':BufferMoveNext'        , 'move next'],      \ '<' : [':BufferMovePrevious'    , 'move prev'],      \ '1' : [':BufferGoto 1'          , 'buffer 1'],      \ '2' : [':BufferGoto 2'          , 'buffer 2'],      \ '3' : [':BufferGoto 3'          , 'buffer 3'],      \ '4' : [':BufferGoto 4'          , 'buffer 4'],      \ '5' : [':BufferGoto 5'          , 'buffer 5'],      \ '6' : [':BufferGoto 6'          , 'buffer 6'],      \ '7' : [':BufferGoto 7'          , 'buffer 7'],      \ '8' : [':BufferGoto 8'          , 'buffer 8'],      \ '9' : [':BufferGoto 9'          , 'buffer 9'],      \ '0' : [':BufferGoto 0'          , 'buffer 0'],      \ 'b' : [':BufferPick'            , 'pick buffer'],      \ 'd' : [':Bdelete'               , 'delete-buffer'],      \ 'D' : [':BufferOrderByDirectory', 'order by directory'],      \ 'f' : ['bfirst'                 , 'first-buffer'],      \ 'l' : ['blast'                  , 'last buffer'],      \ 'L' : [':BufferOrderByLanguage' , 'order by language'],      \ 'n' : ['bnext'                  , 'next-buffer'],      \ 'p' : ['bprevious'              , 'previous-buffer'],      \ '?' : ['Buffers'                , 'fzf-buffer'],      \ }" d is for debuglet g:which_key_map.d = {      \ 'name' : '+debug' ,      \ 'b' : ['<Plug>VimspectorToggleBreakpoint'              , 'breakpoint'],      \ 'B' : ['<Plug>VimspectorToggleConditionalBreakpoint'   , 'conditional breakpoint'],      \ 'c' : ['<Plug>VimspectorRunToCursor'                   , 'run to cursor'],      \ 'd' : ['<Plug>VimspectorContinue'                      , 'continue'],      \ 'f' : ['<Plug>VimspectorAddFunctionBreakpoint'         , 'function breakpoint'],      \ 'm' : [':MaximizerToggle'                              , 'maximize window'],      \ 'o' : ['<Plug>VimspectorStepOver'                      , 'step over'],      \ 'O' : ['<Plug>VimspectorStepOut'                       , 'step out'],      \ 'i' : ['<Plug>VimspectorStepInto'                      , 'step into'],      \ 'p' : ['<Plug>VimspectorPause'                         , 'pause'],      \ 'r' : ['<Plug>VimspectorRestart'                       , 'restart'],      \ 's' : ['<Plug>VimspectorStop'                          , 'stop'],      \ }" f is for find and replacelet g:which_key_map.f = {      \ 'name' : '+find & replace' ,      \ 'f' : [':Farr --source=vimgrep'    , 'file'],      \ 'p' : [':Farr --source=rgnvim'     , 'project'],      \ }" k is for tasklet g:which_key_map.k = {      \ 'name' : '+task' ,      \ 'c' : [':AsyncTask file-compile'      , 'compile file'],      \ 'b' : [':AsyncTask project-build'     , 'build project'],      \ 'e' : [':AsyncTaskEdit'               , 'edit local tasks'],      \ 'f' : [':AsyncTaskFzf'                , 'find task'],      \ 'g' : [':AsyncTaskEdit!'              , 'edit global tasks'],      \ 'h' : [':AsyncTaskList!'              , 'list hidden tasks'],      \ 'l' : [':CocList tasks'               , 'list tasks'],      \ 'm' : [':AsyncTaskMacro'              , 'macro help'],      \ 'o' : [':copen'                       , 'open task view'],      \ 'r' : [':AsyncTask file-run'          , 'run file'],      \ 'p' : [':AsyncTask project-run'       , 'run project'],      \ 'x' : [':cclose'                      , 'close task view'],      \ }      " \ 'l' : [':AsyncTaskList'               , 'list tasks']," m is for marklet g:which_key_map.m = {      \ 'name' : '+mark' ,      \ 'c' : [':CocCommand bookmark.clearForCurrentFile', 'clear file'],      \ 'C' : [':CocCommand bookmark.clearForAllFiles', 'clear project'],      \ 'j' : [':CocCommand bookmark.next', 'next bookmark'],      \ 'k' : [':CocCommand bookmark.prev', 'prev bookmark'],      \ 't' : [':CocCommand bookmark.toggle', 'toggle bookmark'],      \ }      " CoC throws an error      " \ 'a' : [':CocCommand bookmark.annotate', 'annotate bookmark']," " s is for search" let g:which_key_map.s = {"       \ 'name' : '+search' ,"       \ '/' : [':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'] ,"       \ 'P' : [':Tags'                  , 'project tags'],"       \ 's' : [':CocList snippets'      , 'snippets'],"       \ 'S' : [':Colors'                , 'color schemes'],"       \ 't' : [':Rg'                    , 'text Rg'],"       \ 'T' : [':BTags'                 , 'buffer tags'],"       \ 'w' : [':Windows'               , 'search windows'],"       \ 'y' : [':Filetypes'             , 'file types'],"       \ 'z' : [':FZF'                   , 'FZF'],"       \ }      " \ 's' : [':Snippets'     , 'snippets']," TODO fix FZF preview or just move to Telescope" s is for searchlet g:which_key_map.s = {      \ 'name' : '+search' ,      \ '/' : [':History/'              , 'history'],      \ ';' : [':FzfPreviewCommandPalette'              , 'commands'],      \ 'a' : [':Ag'                    , 'text Ag'],      \ 'b' : [':CocCommand fzf-preview.BufferLines'                , 'current buffer'],      \ 'B' : [':CocCommand fzf-preview.Buffers'               , 'open buffers'],      \ 'c' : [':Commits'               , 'commits'],      \ 'C' : [':BCommits'              , 'buffer commits'],      \ 'd' : [':CocCommand fzf-preview.DirectoryFiles'              , 'directories'],      \ 'f' : [':CocCommand fzf-preview.ProjectFiles'                 , 'files'],      \ 'g' : [':CocCommand fzf-preview.GitFiles'                , 'git files'],      \ 'G' : [':GFiles?'               , 'modified git files'],      \ 'h' : [':History'               , 'file history'],      \ 'H' : [':History:'              , 'command history'],      \ 'l' : [':Lines'                 , 'lines'] ,      \ 'm' : [':CocCommand fzf-preview.Marks', 'list marks'],      \ 'M' : [':Maps'                  , 'normal maps'] ,      \ 'p' : [':Helptags'              , 'help tags'] ,      \ 'P' : [':Tags'                  , 'project tags'],      \ 'q' : [':CocCommand fzf-preview.QuickFix'                  , 'quickfix list'],      \ 's' : [':CocList snippets'      , 'snippets'],      \ 'S' : [':Colors'                , 'color schemes'],      \ 't' : [':Rg'                    , 'text Rg'],      \ 'T' : [':BTags'                 , 'buffer tags'],      \ 'w' : [':Windows'               , 'search windows'],      \ 'y' : [':Filetypes'             , 'file types'],      \ 'z' : [':FZF'                   , 'FZF'],      \ }" " :CocCommand fzf-preview.AllBuffers" :CocCommand fzf-preview.Changes" :CocCommand fzf-preview.Yankround" :CocCommand fzf-preview.CocReferences" :CocCommand fzf-preview.CocDiagnostics" :CocCommand fzf-preview.CocCurrentDiagnostics" :CocCommand fzf-preview.CocTypeDefinitions" \ 'l' : [':CocCommand fzf-preview.Bookmarks', 'list bookmarks']," $FZF_PREVIEW_PREVIEW_BAT_THEME = 'ansi-dark'" let g:which_key_map.S = {      \ 'name' : '+Session' ,      \ 'c' : [':SClose'          , 'Close Session']  ,      \ 'd' : [':SDelete'         , 'Delete Session'] ,      \ 'l' : [':SLoad'           , 'Load Session']     ,      \ 's' : [':Startify'        , 'Start Page']     ,      \ 'S' : [':SSave'           , 'Save Session']   ,      \ }" g is for gitlet g:which_key_map.g = {      \ 'name' : '+git' ,      \ 'a' : [':Git add .'                        , 'add all'],      \ 'A' : [':CocCommand fzf-preview.GitStatus' , 'actions'],      \ 'b' : [':Git blame'                        , 'blame'],      \ 'B' : [':GBrowse'                          , 'browse'],      \ 'c' : [':Git commit'                       , 'commit'],      \ 'd' : [':Git diff'                         , 'diff'],      \ 'D' : [':Gdiffsplit'                       , 'diff split'],      \ 'g' : [':GGrep'                            , 'git grep'],      \ 'G' : [':Gstatus'                          , 'status'],      \ 'h' : [':GitGutterLineHighlightsToggle'    , 'highlight hunks'],      \ 'H' : ['<Plug>(GitGutterPreviewHunk)'      , 'preview hunk'],      \ 'i' : [':Gist -b'                          , 'post gist'],      \ 'j' : ['<Plug>(GitGutterNextHunk)'         , 'next hunk'],      \ 'k' : ['<Plug>(GitGutterPrevHunk)'         , 'prev hunk'],      \ 'l' : [':Git log'                          , 'log'],      \ 'm' : ['<Plug>(git-messenger)'             , 'message'],      \ 'p' : [':Git push'                         , 'push'],      \ 'P' : [':Git pull'                         , 'pull'],      \ 'r' : [':GRemove'                          , 'remove'],      \ 's' : ['<Plug>(GitGutterStageHunk)'        , 'stage hunk'],      \ 'S' : [':CocCommand fzf-preview.GitStatus' , 'status'],      \ 't' : [':GitGutterSignsToggle'             , 'toggle signs'],      \ 'u' : ['<Plug>(GitGutterUndoHunk)'         , 'undo hunk'],      \ 'v' : [':GV'                               , 'view commits'],      \ 'V' : [':GV!'                              , 'view buffer commits'],      \ }      " \ 'A' : [':Git add %'                        , 'add current'],      " \ 'S' : [':!git status'                      , 'status']," " " let g:which_key_map.G = {      \ 'name' : '+gist' ,      \ 'a' : [':Gist -a'                          , 'post gist anon'],      \ 'b' : [':Gist -b'                          , 'post gist browser'],      \ 'd' : [':Gist -d'                          , 'delete gist'],      \ 'e' : [':Gist -e'                          , 'edit gist'],      \ 'l' : [':Gist -l'                          , 'list public gists'],      \ 's' : [':Gist -ls'                         , 'list starred gists'],      \ 'm' : [':Gist -m'                          , 'post gist all buffers'],      \ 'p' : [':Gist -P'                          , 'post public gist '],      \ 'P' : [':Gist -p'                          , 'post private gist '],      \ }" l is for language server protocollet g:which_key_map.l = {      \ 'name' : '+lsp' ,      \ '.' : [':CocConfig'                          , 'config'],      \ ';' : ['<Plug>(coc-refactor)'                , 'refactor'],      \ 'a' : ['<Plug>(coc-codeaction)'              , 'code action'],      \ 'A' : ['<Plug>(coc-codeaction-selected)'     , 'selected action'],      \ 'b' : [':CocNext'                            , 'next action'],      \ 'B' : [':CocPrev'                            , 'prev action'],      \ 'c' : [':CocList commands'                   , 'commands'],      \ 'd' : ['<Plug>(coc-definition)'              , 'definition'],      \ 'D' : ['<Plug>(coc-declaration)'             , 'declaration'],      \ 'e' : [':CocList extensions'                 , 'extensions'],      \ 'f' : ['<Plug>(coc-format-selected)'         , 'format selected'],      \ 'F' : ['<Plug>(coc-format)'                  , 'format'],      \ 'h' : ['<Plug>(coc-float-hide)'              , 'hide'],      \ 'i' : ['<Plug>(coc-implementation)'          , 'implementation'],      \ 'I' : [':CocList diagnostics'                , 'diagnostics'],      \ 'j' : ['<Plug>(coc-float-jump)'              , 'float jump'],      \ 'l' : ['<Plug>(coc-codelens-action)'         , 'code lens'],      \ 'n' : ['<Plug>(coc-diagnostic-next)'         , 'next diagnostic'],      \ 'N' : ['<Plug>(coc-diagnostic-next-error)'   , 'next error'],      \ 'o' : [':Vista!!'                            , 'outline'],      \ 'O' : [':CocList outline'                    , 'search outline'],      \ 'p' : ['<Plug>(coc-diagnostic-prev)'         , 'prev diagnostic'],      \ 'P' : ['<Plug>(coc-diagnostic-prev-error)'   , 'prev error'],      \ 'q' : ['<Plug>(coc-fix-current)'             , 'quickfix'],      \ 'r' : ['<Plug>(coc-references)'              , 'references'],      \ 'R' : ['<Plug>(coc-rename)'                  , 'rename'],      \ 's' : [':CocList -I symbols'                 , 'references'],      \ 'S' : [':CocList snippets'                   , 'snippets'],      \ 't' : ['<Plug>(coc-type-definition)'         , 'type definition'],      \ 'u' : [':CocListResume'                      , 'resume list'],      \ 'U' : [':CocUpdate'                          , 'update CoC'],      \ 'z' : [':CocDisable'                         , 'disable CoC'],      \ 'Z' : [':CocEnable'                          , 'enable CoC'],      \ }      " \ 'o' : ['<Plug>(coc-openlink)'                , 'open link']," t is for terminallet g:which_key_map.t = {      \ 'name' : '+terminal' ,      \ ';' : [':FloatermNew --wintype=normal --height=6'        , 'terminal'],      \ 'f' : [':FloatermNew fzf'                               , 'fzf'],      \ 'g' : [':FloatermNew lazygit'                           , 'git'],      \ 'd' : [':FloatermNew lazydocker'                        , 'docker'],      \ 'n' : [':FloatermNew node'                              , 'node'],      \ 'N' : [':FloatermNew nnn'                               , 'nnn'],      \ 'p' : [':FloatermNew python'                            , 'python'],      \ 'm' : [':FloatermNew lazynpm'                           , 'npm'],      \ 'r' : [':FloatermNew ranger'                            , 'ranger'],      \ 't' : [':FloatermToggle'                                , 'toggle'],      \ 'y' : [':FloatermNew ytop'                              , 'ytop'],      \ 's' : [':FloatermNew ncdu'                              , 'ncdu'],      \ }" w is for wiki" let g:which_key_map.w = {"       \ 'name' : '+wiki' ,"       \ 'w' : ['<Plug>VimwikiIndex'                              , 'ncdu'],"       \ 'n' : ['<plug>(wiki-open)'                              , 'ncdu'],"       \ 'j' : ['<plug>(wiki-journal)'                              , 'ncdu'],"       \ 'R' : ['<plug>(wiki-reload)'                              , 'ncdu'],"       \ 'c' : ['<plug>(wiki-code-run)'                              , 'ncdu'],"       \ 'b' : ['<plug>(wiki-graph-find-backlinks)'                              , 'ncdu'],"       \ 'g' : ['<plug>(wiki-graph-in)'                              , 'ncdu'],"       \ 'G' : ['<plug>(wiki-graph-out)'                              , 'ncdu'],"       \ 'l' : ['<plug>(wiki-link-toggle)'                              , 'ncdu'],"       \ 'd' : ['<plug>(wiki-page-delete)'                              , 'ncdu'],"       \ 'r' : ['<plug>(wiki-page-rename)'                              , 'ncdu'],"       \ 't' : ['<plug>(wiki-page-toc)'                              , 'ncdu'],"       \ 'T' : ['<plug>(wiki-page-toc-local)'                              , 'ncdu'],"       \ 'e' : ['<plug>(wiki-export)'                              , 'ncdu'],"       \ 'u' : ['<plug>(wiki-list-uniq)'                              , 'ncdu'],"       \ 'U' : ['<plug>(wiki-list-uniq-local)'                              , 'ncdu'],"       \ }" Global" <Plug>VimwikiIndex" <Plug>VimwikiTabIndex" <Plug>VimwikiUISelect" <Plug>VimwikiDiaryIndex" <Plug>VimwikiMakeDiaryNote" <Plug>VimwikiTabMakeDiaryNote" <Plug>VimwikiMakeYesterdayDiaryNote" <Plug>VimwikiMakeTomorrowDiaryNote"" " Local" <Plug>Vimwiki2HTML" <Plug>Vimwiki2HTMLBrowse" <Plug>VimwikiDiaryGenerateLinks" <Plug>VimwikiFollowLink" <Plug>VimwikiSplitLink" <Plug>VimwikiVSplitLink" <Plug>VimwikiTabnewLink" <Plug>VimwikiGoBackLink" <Plug>VimwikiNextLink" <Plug>VimwikiPrevLink" <Plug>VimwikiGoto" <Plug>VimwikiDeleteLink" <Plug>VimwikiRenameLink" <Plug>VimwikiAddHeaderLevel" Register which key mapcall which_key#register('<Space>', "g:which_key_map")
 |