mirror of
https://github.com/elkowar/dots-of-war.git
synced 2024-11-06 03:12:24 +00:00
143 lines
8.1 KiB
VimL
143 lines
8.1 KiB
VimL
"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")
|
|
|
|
|
|
|
|
|
|
|
|
"\ 'h' : 'which_key_ignore', 'l' : 'which_key_ignore' ,
|
|
"\ 'h' : ':bprevious', 'l' : ':bnext' ,
|
|
"\ 'h' : [':BufferPrevious', 'prev buffer'], 'l' : [':BufferNext', 'next buffer'] ,
|
|
"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'] ,
|
|
"\ }
|
|
"\ }
|
|
|
|
"\ 's' : [ ':CocFzfList symbols' , 'list symbols' ] ,
|
|
|
|
" Maps for code actions
|
|
"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' ] ,
|
|
"\ }
|
|
|
|
" 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' ] ,
|
|
"\ }
|
|
|
|
"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' ] ,
|
|
"\}
|
|
|
|
"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']
|
|
"\ }
|
|
|
|
" 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
|
|
"autocmd! FileType which_key set laststatus=2 noshowmode noruler
|
|
"\| autocmd! BufLeave <buffer> set laststatus=2 showmode ruler
|
|
|
|
"set timeoutlen=200
|
|
|