diff options
Diffstat (limited to 'keys')
| -rw-r--r-- | keys/mappings.vim | 97 | ||||
| -rw-r--r-- | keys/which-key.vim | 335 | 
2 files changed, 0 insertions, 432 deletions
| diff --git a/keys/mappings.vim b/keys/mappings.vim deleted file mode 100644 index f5c471cd..00000000 --- a/keys/mappings.vim +++ /dev/null @@ -1,97 +0,0 @@ -" Basic Key Mappings - -imap <C-h> <C-w>h -imap <C-j> <C-w>j -imap <C-k> <C-w>k -imap <C-l> <C-w>l -" g Leader key -let mapleader=" " -" let localleader=" " -nnoremap <Space> <Nop> - -" Better indenting -vnoremap < <gv -vnoremap > >gv - -if exists('g:vscode') - -  " Simulate same TAB behavior in VSCode -  nmap <Tab> :Tabnext<CR> -  nmap <S-Tab> :Tabprev<CR> - -else - -  " Better nav for omnicomplete -  inoremap <expr> <c-j> ("\<C-n>") -  inoremap <expr> <c-k> ("\<C-p>") - -  " I hate escape more than anything else -  inoremap jk <Esc> -  inoremap kj <Esc> - -  " Easy CAPS -  " inoremap <c-u> <ESC>viwUi -  " nnoremap <c-u> viwU<Esc> - -  " TAB in general mode will move to text buffer -  nnoremap <silent> <TAB> :bnext<CR> -  " SHIFT-TAB will go back -  nnoremap <silent> <S-TAB> :bprevious<CR> - -  " Move selected line / block of text in visual mode -  " shift + k to move up -  " shift + j to move down -  xnoremap K :move '<-2<CR>gv-gv -  xnoremap J :move '>+1<CR>gv-gv - -  " Alternate way to save -  nnoremap <silent> <C-s> :w<CR> -  " Alternate way to quit -  nnoremap <silent> <C-Q> :wq!<CR> -  " Use control-c instead of escape -  nnoremap <silent> <C-c> <Esc> -  " <TAB>: completion. -  inoremap <silent> <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>" - -  " Better window navigation -  nnoremap <C-h> <C-w>h -  nnoremap <C-j> <C-w>j -  nnoremap <C-k> <C-w>k -  nnoremap <C-l> <C-w>l - -  " Terminal window navigation -  tnoremap <C-h> <C-\><C-N><C-w>h -  tnoremap <C-j> <C-\><C-N><C-w>j -  tnoremap <C-k> <C-\><C-N><C-w>k -  tnoremap <C-l> <C-\><C-N><C-w>l -  inoremap <C-h> <C-\><C-N><C-w>h -  inoremap <C-j> <C-\><C-N><C-w>j -  inoremap <C-k> <C-\><C-N><C-w>k -  inoremap <C-l> <C-\><C-N><C-w>l -  tnoremap <Esc> <C-\><C-n> - -  " Use alt + hjkl to resize windows -  " nnoremap <silent> <M-j>    :resize -2<CR> -  " nnoremap <silent> <M-k>    :resize +2<CR> -  " nnoremap <silent> <M-h>    :vertical resize -2<CR> -  " nnoremap <silent> <M-l>    :vertical resize +2<CR> - -  nnoremap <silent> <C-Up>    :resize -2<CR> -  nnoremap <silent> <C-Down>  :resize +2<CR> -  nnoremap <silent> <C-Left>  :vertical resize -2<CR> -  nnoremap <silent> <C-Right> :vertical resize +2<CR> - -  let g:elite_mode=0                      " Disable arrows" -  " Disable arrow movement, resize splits instead. -  if get(g:, 'elite_mode') -      nnoremap <C-Up>    :resize -2<CR> -      nnoremap <C-Down>  :resize +2<CR> -      nnoremap <C-Left>  :vertical resize -2<CR> -      nnoremap <C-Right> :vertical resize +2<CR> -  endif - -endif - -" Better nav for omnicomplete -inoremap <expr> <c-j> ("\<C-n>") -inoremap <expr> <c-k> ("\<C-p>") diff --git a/keys/which-key.vim b/keys/which-key.vim deleted file mode 100644 index 40f1b48e..00000000 --- a/keys/which-key.vim +++ /dev/null @@ -1,335 +0,0 @@ -" Leader Key Maps -let @s = 'veS"' - -" Timeout -let g:which_key_timeout = 100 - -let g:which_key_display_names = {'<CR>': '↵', '<TAB>': '⇆'} - -" Map leader to which_key -nnoremap <silent> <leader> :silent <c-u> :silent WhichKey '<Space>'<CR> -vnoremap <silent> <leader> :silent <c-u> :silent WhichKeyVisual '<Space>'<CR> - -" 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 -let 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 line -autocmd! FileType which_key -autocmd  FileType which_key set laststatus=0 noshowmode noruler -  \| autocmd BufLeave <buffer> set laststatus=2 noshowmode ruler - - -" Single mappings -let g:which_key_map['/'] = [ ':call Comment()'                                 , 'comment' ] -let g:which_key_map['?'] = [ ':NvimTreeFindFile'                               , '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'] = [ ':NvimTreeToggle'                                 , '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' ] -" TODO fix this -" let g:which_key_map['q'] = [ ':q'                                              , 'quit' ] -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 actions -let 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 buffer -let 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 debug -let 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 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'] -    \ } - -" f is for find and replace -      " \ 'f' : [':Farr'                     , 'file'], -let g:which_key_map.f = { -      \ 'name' : '+find & replace' , -      \ 'f' : [':Farr --source=vimgrep'    , 'file'], -      \ 'p' : [':Farr --source=rgnvim'     , 'project'], -      \ } - -" command! -buffer JdtCompile lua require('jdtls').compile() -" command! -buffer JdtUpdateConfig lua require('jdtls').update_project_config() -" command! -buffer JdtJol lua require('jdtls').jol() -" command! -buffer JdtBytecode lua require('jdtls').javap() -" command! -buffer JdtJshell lua require('jdtls').jshell() - -" j is for java -let g:which_key_map.j = { -      \ 'name' : '+java' , -      \ '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'], -      \ } - -" k is for task -let 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'], -      \ '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 mark -let 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 powered by telescope -let g:which_key_map.s = { -      \ 'name' : '+search' , -      \ '.' : [':Telescope filetypes'                   , 'filetypes'], -      \ ';' : [':Telescope commands'                    , 'commands'], -      \ 'a' : [':Telescope lsp_code_actions'            , 'code_actions'], -      \ 'A' : [':Telescope builtin'                     , 'all'], -      \ 'b' : [':Telescope buffers'                     , 'buffers'], -      \ 'B' : [':Telescope git_branches'                , 'git branches'], -      \ 'd' : [':Telescope lsp_document_diagnostics'    , 'document_diagnostics'], -      \ 'D' : [':Telescope lsp_workspace_diagnostics'   , 'workspace_diagnostics'], -      \ 'c' : [':Telescope git_commits'                 , 'git_commits'], -      \ 'C' : [':Telescope git_bcommits'                , 'git_bcommits'], -      \ 'f' : [':Telescope find_files'                  , 'files'], -      \ 'F' : [':Telescope git_files'                   , 'git_files'], -      \ 'g' : [':Telescope tags'                        , 'tags'], -      \ 'G' : [':Telescope current_buffer_tags'         , 'buffer_tags'], -      \ 'h' : [':Telescope command_history'             , 'history'], -      \ 'H' : [':Telescope help_tags'                   , 'help_tags'], -      \ 'i' : [':Telescope media_files'                 , 'media files'], -      \ 'k' : [':Telescope keymaps'                     , 'keymaps'], -      \ 'l' : [':Telescope loclist'                     , 'loclist'], -      \ 'm' : [':Telescope marks'                       , 'marks'], -      \ 'M' : [':Telescope man_pages'                   , 'man_pages'], -      \ 'o' : [':Telescope vim_options'                 , 'vim_options'], -      \ 'O' : [':Telescope oldfiles'                    , 'oldfiles'], -      \ 'p' : [':Telescope fd'                          , 'fd'], -      \ 'P' : [':Telescope spell_suggest'               , 'spell_suggest'], -      \ 's' : [':Telescope git_status'                  , 'git_status'], -      \ 'S' : [':Telescope grep_string'                 , 'grep_string'], -      \ 't' : [':Telescope live_grep'                   , 'text'], -      \ 'y' : [':Telescope symbols'                     , 'symbols'], -      \ 'Y' : [':Telescope lsp_workspace_symbols'       , 'lsp_workspace_symbols'], -      \ 'r' : [':Telescope registers'                   , 'registers'], -      \ 'R' : [':Telescope reloader'                    , 'reloader'], -      \ 'w' : [':Telescope file_browser'                , 'buf_fuz_find'], -      \ 'u' : [':Telescope colorscheme'                 , 'colorschemes'], -      \ 'z' : [':Telescope current_buffer_fuzzy_find'   , 'buf_fuz_find'], -      \ } - -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 git -let 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 protocol -let g:which_key_map.l = { -      \ 'name' : '+lsp' , -      \ 'a' : [':Lspsaga code_action'                , 'quickfix'], -      \ 'A' : [':Lspsaga range_code_action'          , 'selected action'], -      \ 'd' : [':Telescope lsp_document_diagnostics' , 'document diagnostics'], -      \ 'D' : [':Telescope lsp_workspace_diagnostics', 'workspace diagnostics'], -      \ 'f' : [':LspFormatting'                      , 'format'], -      \ 'H' : [':Lspsaga signature_help'             , 'signature_help'], -      \ 'I' : [':LspInfo'                            , 'lsp_info'], -      \ 'l' : [':Lspsaga lsp_finder'                 , 'lsp_finder'], -      \ 'L' : [':Lspsaga show_line_diagnostics'      , 'line_diagnostics'], -      \ 'o' : [':Vista!!'                            , 'outline'], -      \ 'p' : [':Lspsaga preview_definition'         , 'preview definition'], -      \ 'q' : [':Telescope quickfix'                 , 'quickfix'], -      \ 'r' : [':LspRename'                          , 'rename'], -      \ 'T' : [':LspTypeDefinition'                  , 'type defintion'], -      \ 'x' : [':cclose'                             , 'close quickfix'], -      \ 's' : [':Telescope lsp_document_symbols'     , 'document symbols'], -      \ 'S' : [':Telescope lsp_workspace_symbols'    , 'workspace symbols'], -      \ } -      " \ 'D' : [':LspDeclaration'                     , 'workspace_diagnostics'], -      " \ 'r' : [':Telescope lsp_references'           , 'references'], -      " \ 'p' : [':Lspsaga diagnostic_jump_prev'       , 'prev diagnostic'], -      " \ 'n' : [':Lspsaga diagnostic_jump_next'       , 'next_diagnostic'], -      " \ 'q' : [':Lspsaga code_action'                , 'quickfix'], -      " \ 'i' : [':LspImplementation'                  , 'lsp_info'], -      " \ 'h' : [':Lspsaga hover_doc'                  , 'hover_doc'], -      " \ 'K' : [':LspHover'                           , 'hover'], - -" t is for terminal -let 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'], -      \ 'u' : [':FloatermNew ncdu'                              , 'ncdu'], -      \ } - -call which_key#register('<Space>', "g:which_key_map") | 
