2021-04-02 17:54:14 +00:00
|
|
|
"nnoremap <silent> <leader> :<c-u>WhichKey '<Space>'<CR>
|
|
|
|
"vnoremap <silent> <leader> :<c-u>'WhichKeyVisual '<Space>'<CR>
|
|
|
|
"let g:which_key_map = {}
|
|
|
|
"call which_key#register('<Space>', "g:which_key_map")
|
2020-08-06 19:20:51 +00:00
|
|
|
|
2020-11-07 13:06:08 +00:00
|
|
|
|
2020-11-20 17:17:11 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2021-02-16 18:00:01 +00:00
|
|
|
"\ 'h' : 'which_key_ignore', 'l' : 'which_key_ignore' ,
|
|
|
|
"\ 'h' : ':bprevious', 'l' : ':bnext' ,
|
2021-03-28 13:27:18 +00:00
|
|
|
"\ 'h' : [':BufferPrevious', 'prev buffer'], 'l' : [':BufferNext', 'next buffer'] ,
|
2021-04-02 17:54:14 +00:00
|
|
|
"let g:which_key_map = {
|
|
|
|
"\ 'h' : [':bprevious', 'prev buffer'], 'l' : [':bnext', 'next buffer'],
|
|
|
|
"\ 'f' : 'which_key_ignore', 's': 'which_key_ignore' ,
|
|
|
|
"\ 'c' : { 'name': '+comment_out' },
|
|
|
|
"\ 'e' : { 'name': '+emmet' },
|
|
|
|
"\ '[' : ['<Plug>(YoinkPostPasteSwapBack)', 'Swap last paste backwards' ],
|
|
|
|
"\ ']' : ['<Plug>(YoinkPostPasteSwapForward)', 'Swap last paste backwards' ],
|
|
|
|
"\ ':' : [':Commands' , 'Search command with fzf' ],
|
|
|
|
"\ 'z' : { 'name': '+folds', 'c': ['foldclose', 'close fold'],
|
|
|
|
"\ 'o': ['foldopen', 'open fold'] ,
|
|
|
|
"\ }
|
|
|
|
"\ }
|
2020-08-06 19:20:51 +00:00
|
|
|
|
2021-04-02 15:43:24 +00:00
|
|
|
"\ 's' : [ ':CocFzfList symbols' , 'list symbols' ] ,
|
2020-08-06 19:20:51 +00:00
|
|
|
|
|
|
|
" Maps for code actions
|
2021-04-02 15:43:24 +00:00
|
|
|
"let g:which_key_map['m'] = {
|
|
|
|
"\ 'name' : '+Code-actions' ,
|
|
|
|
"\ 'd' : [ ':call luaeval("vim.lsp.buf.hover()")' , 'show documentation' ] ,
|
|
|
|
"\ 'b' : [ ':Lspsaga lsp_finder' , 'find stuff' ] ,
|
|
|
|
"\ 'x' : [ ':Lspsaga preview_definition' , 'Preview definition' ] ,
|
|
|
|
"\ 'o' : [ ':Telescope lsp_document_symbols' , 'symbols in document' ] ,
|
|
|
|
"\ 's' : [ ':Telescope lsp_workspace_symbols' , 'symbols in workspace' ] ,
|
|
|
|
"\ 'g' : [ ':call luaeval("vim.lsp.buf.definition()")' , 'go to definition' ] ,
|
|
|
|
"\ 't' : [ ':call luaeval("vim.lsp.buf.signature_help()")' , 'Show signature help' ] ,
|
|
|
|
"\ 'i' : [ ':call luaeval("vim.lsp.buf.implementation()")' , 'show implementation' ] ,
|
|
|
|
"\ 'r' : [ ':call luaeval("vim.lsp.buf.references()")' , 'show references' ] ,
|
|
|
|
"\ 'n' : [ ':call luaeval("vim.lsp.buf.rename()")' , 'rename' ] ,
|
|
|
|
"\ 'f' : [ ':call luaeval("vim.lsp.buf.formatting()")' , 'format file' ] ,
|
|
|
|
"\ 'v' : [ ':call luaeval("vim.lsp.buf.code_action()")' , 'apply codeaction' ] ,
|
|
|
|
"\ 'e' : [ ':call luaeval("vim.lsp.diagnostic.goto_next()")' , 'Jump to next error' ] ,
|
|
|
|
"\ 'E' : [ ':call luaeval("vim.lsp.diagnostic.goto_prev()")' , 'Jump to previous error' ] ,
|
|
|
|
"\ 'a' : [ ':call luaeval("vim.lsp.diagnostic.show_line_diagnostics()")' , 'diagnostics info' ] ,
|
|
|
|
"\ }
|
|
|
|
|
2021-04-02 17:54:14 +00:00
|
|
|
" this is the one!
|
|
|
|
"let g:which_key_map['m'] = {
|
|
|
|
"\ 'name' : '+Code-actions' ,
|
|
|
|
"\ 'd' : [ ':Lspsaga hover_doc' , 'show documentation' ] ,
|
|
|
|
"\ 'b' : [ ':Lspsaga lsp_finder' , 'find stuff' ] ,
|
|
|
|
"\ 'x' : [ ':Lspsaga preview_definition' , 'Preview definition' ] ,
|
|
|
|
"\ 'o' : [ ':Telescope lsp_document_symbols' , 'symbols in document' ] ,
|
|
|
|
"\ 's' : [ ':Telescope lsp_workspace_symbols' , 'symbols in workspace' ] ,
|
|
|
|
"\ 'g' : [ ':call luaeval("vim.lsp.buf.definition()")' , 'go to definition' ] ,
|
|
|
|
"\ 't' : [ ':Lspsaga signature_help' , 'Show signature help' ] ,
|
|
|
|
"\ 'i' : [ ':call luaeval("vim.lsp.buf.implementation()")' , 'show implementation' ] ,
|
|
|
|
"\ 'r' : [ ':call luaeval("vim.lsp.buf.references()")' , 'show references' ] ,
|
|
|
|
"\ 'n' : [ ':Lspsaga rename' , 'rename' ] ,
|
|
|
|
"\ 'f' : [ ':call luaeval("vim.lsp.buf.formatting()")' , 'format file' ] ,
|
|
|
|
"\ 'v' : [ ':Lspsaga code_action' , 'apply codeaction' ] ,
|
|
|
|
"\ 'e' : [ ':call luaeval("vim.lsp.diagnostic.goto_next()")' , 'Jump to the next error' ] ,
|
|
|
|
"\ 'E' : [ ':Telescope lsp_workspace_diagnostics' , 'List diagnostics' ] ,
|
|
|
|
"\ 'a' : [ ':Lspsaga show_cursor_diagnostics' , 'Cursor diagnostics' ] ,
|
|
|
|
"\ 'A' : [ ':Lspsaga show_line_diagnostics' , 'Line diagnostics' ] ,
|
|
|
|
"\ }
|
2021-04-02 15:43:24 +00:00
|
|
|
|
|
|
|
"let g:which_key_map['m'] = {
|
|
|
|
"\ 'name' : '+Code-actions' ,
|
|
|
|
"\ 'd' : [ ':call Show_documentation()' , 'show documentation' ] ,
|
|
|
|
"\ 's' : [ ':CocFzfList symbols' , 'list symbols' ] ,
|
|
|
|
"\ 'o' : [ ':CocFzfList outline' , 'show outline' ] ,
|
|
|
|
"\ 'c' : [ ':CocFzfList commands' , 'show all coc-commands' ] ,
|
|
|
|
"\ 'g' : [ '<Plug>(coc-definition)' , 'go to definition' ] ,
|
|
|
|
"\ 't' : [ '<Plug>(coc-type-definition)' , 'show type definition' ] ,
|
|
|
|
"\ 'i' : [ '<Plug>(coc-implementation)' , 'show implementation' ] ,
|
|
|
|
"\ 'r' : [ '<Plug>(coc-references-used)' , 'show references' ] ,
|
|
|
|
"\ 'b' : [ '<Plug>(coc-refactor)' , 'refactor' ] ,
|
|
|
|
"\ 'n' : [ '<Plug>(coc-rename)' , 'rename' ] ,
|
|
|
|
"\ 'F' : [ '<Plug>(coc-format-selected)' , 'format selection' ] ,
|
|
|
|
"\ 'f' : [ '<Plug>(coc-format)' , 'format file' ] ,
|
|
|
|
""\ 'v' : [ ':CocCommand actions.open' , 'apply codeaction' ] ,
|
|
|
|
"\ 'v' : [ '<Plug>(coc-codeaction-cursor)', 'apply codeaction' ] ,
|
|
|
|
"\ 'V' : [ '<Plug>(coc-codeaction-line)' , 'codeaction current line'] ,
|
|
|
|
"\ 'e' : [ ':CocList diagnostics' , 'list all errors' ] ,
|
|
|
|
"\ 'L' : [ '<Plug>(coc-diagnostic-next)' , 'go to next error' ] ,
|
|
|
|
"\ 'H' : [ '<Plug>(coc-diagnostic-prev)' , 'go to prev error' ] ,
|
|
|
|
"\ 'a' : [ '<Plug>(coc-diagnostic-info)' , 'diagnostics info' ] ,
|
|
|
|
"\ 'O' : [ '<Plug>(coc-openlink)' , 'open link under cursor' ] ,
|
|
|
|
"\}
|
2020-11-07 13:06:08 +00:00
|
|
|
|
2021-04-02 17:54:14 +00:00
|
|
|
"let g:which_key_map['f'] = {
|
|
|
|
"\ 'name': '+folds',
|
|
|
|
"\ 'o': [ ':foldopen' , 'open fold' ] ,
|
|
|
|
"\ 'n': [ ':foldclose' , 'close fold' ] ,
|
|
|
|
"\ 'j': [ 'zj' , 'jump to next fold' ] ,
|
|
|
|
"\ 'k': [ 'zk' , 'jump to previous fold' ] ,
|
|
|
|
"\ }
|
|
|
|
|
|
|
|
|
|
|
|
"" mappings for view and layout
|
|
|
|
"let g:which_key_map['v'] = {
|
|
|
|
"\ 'name' : '+view-and-layout',
|
|
|
|
"\ 'n' : [':set relativenumber!' , 'toggle relative numbers' ] ,
|
|
|
|
"\ 'm' : [':set nonumber! norelativenumber' , 'toggle numbers'] ,
|
|
|
|
"\ 'g' : [':Goyo | set linebreak' , 'toggle focus mode' ] ,
|
|
|
|
"\ 'i' : [':IndentGuidesToggle' , 'toggle indent guides' ] ,
|
|
|
|
"\ }
|
|
|
|
|
|
|
|
"" :bwipeout! bdelete!
|
|
|
|
""\ 'b' : ['BufferPick' , 'select open buffer' ] ,
|
|
|
|
""\ 'c' : ['BufferClose', 'close open buffer' ] ,
|
|
|
|
""\ 'w' : ['BufferWipeout', 'wipeout open buffer' ] ,
|
|
|
|
"let g:which_key_map['b'] = {
|
|
|
|
"\ 'name': '+buffers',
|
|
|
|
"\ 'b' : [':Buffers' , 'select open buffer' ] ,
|
|
|
|
"\ 'c' : [':bdelete!', 'close open buffer' ] ,
|
|
|
|
"\ 'w' : [':bwipeout!', 'wipeout open buffer' ] ,
|
|
|
|
"\ }
|
|
|
|
|
|
|
|
"let g:which_key_map['x'] = {
|
|
|
|
"\ 'name' : '+other',
|
|
|
|
"\ 'f' : ['NERDTreeToggle' , '<Ctrl+F> show file tree'],
|
|
|
|
"\ 'p' : ['FZF' , '<Ctrl+p> search file (c-v/c-x to open in split)' ] ,
|
|
|
|
"\ 'h' : [':History:' , 'search command history'],
|
|
|
|
"\ 'c' : [':Commands' , 'search through commands'],
|
|
|
|
"\ 's' : ['OverCommandLine', 'Substitute with preview'],
|
|
|
|
"\ 'y' : [':CocFzfList yank', 'Show yank history']
|
|
|
|
"\ }
|
2020-08-06 19:20:51 +00:00
|
|
|
|
|
|
|
" CocList -A --normal yank needs :CocInstall coc-yank
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"nnoremap <silent> m :<c-u>WhichKey 'm'<CR>
|
|
|
|
autocmd! VimEnter * :unmap <space>ig
|
|
|
|
autocmd! FileType which_key
|
2020-11-21 15:04:14 +00:00
|
|
|
"autocmd! FileType which_key set laststatus=2 noshowmode noruler
|
|
|
|
"\| autocmd! BufLeave <buffer> set laststatus=2 showmode ruler
|
2020-08-25 17:45:43 +00:00
|
|
|
|
2021-04-02 17:54:14 +00:00
|
|
|
"set timeoutlen=200
|
2020-08-06 19:20:51 +00:00
|
|
|
|