From 3b0142cedcde39e4c2097ecd916a870a3ced5ec6 Mon Sep 17 00:00:00 2001 From: Vito Graffagnino Date: Tue, 8 Sep 2020 18:10:49 +0100 Subject: Added the relevent parts of the .config directory. Alss add ssh config --- .config/new_neovim/keys/which-key.vim | 170 ++++++++++++++++++++++++++++++++++ 1 file changed, 170 insertions(+) create mode 100644 .config/new_neovim/keys/which-key.vim (limited to '.config/new_neovim/keys/which-key.vim') diff --git a/.config/new_neovim/keys/which-key.vim b/.config/new_neovim/keys/which-key.vim new file mode 100644 index 0000000..87eda18 --- /dev/null +++ b/.config/new_neovim/keys/which-key.vim @@ -0,0 +1,170 @@ +" Map leader to which_key +nnoremap :silent WhichKey '' +vnoremap :silent :silent WhichKeyVisual '' + +" Create map to add keys to +let g:which_key_map = {} +" Define a separator +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 + +" Single mappings +let g:which_key_map['/'] = [ 'NERDCommenterToggle' , 'comment' ] +let g:which_key_map['.'] = [ ':e $MYVIMRC' , 'open init' ] +let g:which_key_map[';'] = [ ':Commands' , 'commands' ] +let g:which_key_map['='] = [ '=' , 'balance windows' ] +let g:which_key_map[','] = [ 'Startify' , 'start screen' ] +let g:which_key_map['d'] = [ ':bd' , 'delete buffer'] +let g:which_key_map['e'] = [ ':CocCommand explorer' , 'explorer' ] +let g:which_key_map['f'] = [ ':Files' , 'search files' ] +let g:which_key_map['h'] = [ 's' , 'split below'] +let g:which_key_map['q'] = [ 'q' , 'quit' ] +let g:which_key_map['r'] = [ ':RnvimrToggle' , 'ranger' ] +let g:which_key_map['S'] = [ ':SSave' , 'save session' ] +let g:which_key_map['T'] = [ ':Rg' , 'search text' ] +let g:which_key_map['v'] = [ 'v' , 'split right'] +let g:which_key_map['w'] = [ 'w' , 'write' ] +let g:which_key_map['z'] = [ 'Goyo' , 'zen' ] + +" Group mappings + +" b is for buffer +let g:which_key_map.b = { + \ 'name' : '+buffer' , + \ '1' : ['b1' , 'buffer 1'] , + \ '2' : ['b2' , 'buffer 2'] , + \ 'd' : ['bd' , 'delete-buffer'] , + \ 'f' : ['bfirst' , 'first-buffer'] , + \ 'h' : ['Startify' , 'home-buffer'] , + \ 'l' : ['blast' , 'last-buffer'] , + \ 'n' : ['bnext' , 'next-buffer'] , + \ 'p' : ['bprevious' , 'previous-buffer'] , + \ '?' : ['Buffers' , 'fzf-buffer'] , + \ } + +" 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' : [':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'], + \ } + +" g is for git +let g:which_key_map.g = { + \ 'name' : '+git' , + \ 'a' : [':Git add .' , 'add all'], + \ 'A' : [':Git add %' , 'add current'], + \ 'b' : [':Git blame' , 'blame'], + \ 'B' : [':GBrowse' , 'browse'], + \ 'c' : [':Git commit -m "autocommit"' , 'commit'], + \ 'd' : [':Git diff' , 'diff'], + \ 'D' : [':Gdiffsplit' , 'diff split'], + \ 'g' : [':GGrep' , 'git grep'], + \ 'G' : [':Gstatus' , 'status'], + \ 'h' : [':GitGutterLineHighlightsToggle' , 'highlight hunks'], + \ 'H' : ['(GitGutterPreviewHunk)' , 'preview hunk'], + \ 'j' : ['(GitGutterNextHunk)' , 'next hunk'], + \ 'k' : ['(GitGutterPrevHunk)' , 'prev hunk'], + \ 'l' : [':Git log' , 'log'], + \ 'p' : [':Git push' , 'push'], + \ 'P' : [':Git pull' , 'pull'], + \ 'r' : [':GRemove' , 'remove'], + \ 's' : ['(GitGutterStageHunk)' , 'stage hunk'], + \ 't' : [':GitGutterSignsToggle' , 'toggle signs'], + \ 'u' : ['(GitGutterUndoHunk)' , 'undo hunk'], + \ 'v' : [':GV' , 'view commits'], + \ 'V' : [':GV!' , 'view buffer commits'], + \ } + +" 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'], + \ 'v' : [':Vista!!' , 'tag viewer'], + \ 'z' : [':CocDisable' , 'disable CoC'], + \ 'Z' : [':CocEnable' , 'enable CoC'], + \ } + + +" t is for toggle +let g:which_key_map.t = { + \ 'name' : '+toggle' , + \ 'c' : [':ColorizerToggle' , 'colorizer'], + \ 'e' : [':CocCommand explorer' , 'explorer'], + \ 'n' : [':set nonumber!' , 'line-numbers'], + \ 'r' : [':set norelativenumber!' , 'relative line nums'], + \ 's' : [':let @/ = ""' , 'remove search highlight'], + \ 't' : [':FloatermToggle' , 'terminal'], + \ 'v' : [':Vista!!' , 'tag viewer'], + \ } + +" Register which key map +call which_key#register('', "g:which_key_map") + + -- cgit v1.2.3