" Leader Key Maps " Timeout let g:which_key_timeout = 100 let g:which_key_display_names = {'': '↵', '': '⇆', " ": 'SPC'} " Map leader to which_key nnoremap :silent :silent WhichKey '' vnoremap :silent :silent WhichKeyVisual '' let g:which_key_map = {} let g:which_key_sep = '→' " Not a fan of floating windows for this let g:which_key_use_floating_win = 0 let g:which_key_max_size = 0 " Hide status line autocmd! FileType which_key autocmd FileType which_key set laststatus=0 noshowmode noruler \| autocmd BufLeave set laststatus=2 noshowmode ruler " let g:which_key_map['/'] = 'comment toggle' let g:which_key_map[';'] = [ ':Dashboard' , 'home screen' ] let g:which_key_map['?'] = [ ':NvimTreeFindFile' , 'find current file' ] let g:which_key_map['e'] = [ ':NvimTreeToggle' , 'explorer' ] let g:which_key_map['f'] = [ ':Telescope find_files' , 'find files' ] let g:which_key_map['h'] = [ 's' , 'split below'] let g:which_key_map['H'] = [ ':let @/ = ""' , 'no highlight' ] let g:which_key_map['r'] = [ ':RnvimrToggle' , 'ranger' ] " TODO create entire treesitter section let g:which_key_map['v'] = [ 'v' , 'split right'] " TODO play nice with status line " Group mappings " b is for buffer let g:which_key_map.b = { \ 'name' : '+buffer' , \ '>' : [':BufferMoveNext' , 'move next'], \ '<' : [':BufferMovePrevious' , 'move prev'], \ 'b' : [':BufferPick' , 'pick buffer'], \ 'd' : [':BufferClose' , 'delete-buffer'], \ 'n' : ['bnext' , 'next-buffer'], \ 'p' : ['bprevious' , 'previous-buffer'], \ '?' : ['Buffers' , 'fzf-buffer'], \ } " d is for debug let g:which_key_map.d = { \ 'name' : '+debug' , \ 'b' : ['DebugToggleBreakpoint ' , 'toggle breakpoint'], \ 'c' : ['DebugContinue' , 'continue'], \ 'i' : ['DebugStepInto' , 'step into'], \ 'o' : ['DebugStepOver' , 'step over'], \ 'r' : ['DebugToggleRepl' , 'toggle repl'], \ 's' : ['DebugStart' , 'start'], \ } " F is for fold let g:which_key_map.F = { \ 'name': '+fold', \ 'O' : [':set foldlevel=20' , 'open all'], \ 'C' : [':set foldlevel=0' , 'close all'], \ 'c' : [':foldclose' , 'close'], \ 'o' : [':foldopen' , 'open'], \ '1' : [':set foldlevel=1' , 'level1'], \ '2' : [':set foldlevel=2' , 'level2'], \ '3' : [':set foldlevel=3' , 'level3'], \ '4' : [':set foldlevel=4' , 'level4'], \ '5' : [':set foldlevel=5' , 'level5'], \ '6' : [':set foldlevel=6' , 'level6'] \ } " s is for search powered by telescope let g:which_key_map.s = { \ 'name' : '+search' , \ '.' : [':Telescope filetypes' , 'filetypes'], \ 'B' : [':Telescope git_branches' , 'git branches'], \ 'd' : [':Telescope lsp_document_diagnostics' , 'document_diagnostics'], \ 'D' : [':Telescope lsp_workspace_diagnostics' , 'workspace_diagnostics'], \ 'f' : [':Telescope find_files' , 'files'], \ 'h' : [':Telescope command_history' , 'history'], \ 'i' : [':Telescope media_files' , 'media files'], \ 'm' : [':Telescope marks' , 'marks'], \ 'M' : [':Telescope man_pages' , 'man_pages'], \ 'o' : [':Telescope vim_options' , 'vim_options'], \ 't' : [':Telescope live_grep' , 'text'], \ 'r' : [':Telescope registers' , 'registers'], \ 'w' : [':Telescope file_browser' , 'buf_fuz_find'], \ 'u' : [':Telescope colorscheme' , 'colorschemes'], \ } " S is for Session let g:which_key_map.S = { \ 'name' : '+Session' , \ 's' : [':SessionSave' , 'save session'], \ 'l' : [':SessionLoad' , 'load Session'], \ } " g is for git let g:which_key_map.g = { \ 'name' : '+git' , \ 'b' : [':GitBlameToggle' , 'blame'], \ 'B' : [':GBrowse' , 'browse'], \ 'd' : [':Git diff' , 'diff'], \ 'j' : [':NextHunk' , 'next hunk'], \ 'k' : [':PrevHunk' , 'prev hunk'], \ 'l' : [':Git log' , 'log'], \ 'p' : [':PreviewHunk' , 'preview hunk'], \ 'r' : [':ResetHunk' , 'reset hunk'], \ 'R' : [':ResetBuffer' , 'reset buffer'], \ 's' : [':StageHunk' , 'stage hunk'], \ 'S' : [':Gstatus' , 'status'], \ 'u' : [':UndoStageHunk' , 'undo stage hunk'], \ } " l is for language server protocol let g:which_key_map.l = { \ 'name' : '+lsp' , \ 'a' : [':Lspsaga code_action' , 'code action'], \ 'A' : [':Lspsaga range_code_action' , 'selected action'], \ 'd' : [':Telescope lsp_document_diagnostics' , 'document diagnostics'], \ 'D' : [':Telescope lsp_workspace_diagnostics', 'workspace diagnostics'], \ 'f' : [':LspFormatting' , 'format'], \ 'I' : [':LspInfo' , 'lsp info'], \ 'v' : [':LspVirtualTextToggle' , 'lsp toggle virtual text'], \ 'l' : [':Lspsaga lsp_finder' , 'lsp finder'], \ 'L' : [':Lspsaga show_line_diagnostics' , 'line_diagnostics'], \ 'p' : [':Lspsaga preview_definition' , 'preview definition'], \ 'q' : [':Telescope quickfix' , 'quickfix'], \ 'r' : [':Lspsaga rename' , 'rename'], \ 'T' : [':LspTypeDefinition' , 'type defintion'], \ 'x' : [':cclose' , 'close quickfix'], \ 's' : [':Telescope lsp_document_symbols' , 'document symbols'], \ 'S' : [':Telescope lsp_workspace_symbols' , 'workspace symbols'], \ } call which_key#register('', "g:which_key_map")