summaryrefslogtreecommitdiff
path: root/.config/nvim/vim-script
diff options
context:
space:
mode:
authoraktersnurra <grydholm@kth.se>2021-04-19 21:43:23 +0200
committeraktersnurra <grydholm@kth.se>2021-04-19 21:43:23 +0200
commit23b895222a16925d39d04d45dedbedec9db0c752 (patch)
treeeb5759eed884c1ddcb32f1b702e55dc4521bf60e /.config/nvim/vim-script
parent174cd547dc32bb6d50ab5da329ad1bc4d516c20a (diff)
Updates to nvim
Diffstat (limited to '.config/nvim/vim-script')
-rw-r--r--.config/nvim/vim-script/_limelight/init.vim23
-rw-r--r--.config/nvim/vim-script/_nvimtree/init.vim19
-rw-r--r--.config/nvim/vim-script/_whichkey/init.vim212
3 files changed, 58 insertions, 196 deletions
diff --git a/.config/nvim/vim-script/_limelight/init.vim b/.config/nvim/vim-script/_limelight/init.vim
deleted file mode 100644
index 4e9bf10..0000000
--- a/.config/nvim/vim-script/_limelight/init.vim
+++ /dev/null
@@ -1,23 +0,0 @@
-" Color name (:help cterm-colors) or ANSI code
-let g:limelight_conceal_ctermfg = 'gray'
-let g:limelight_conceal_ctermfg = 240
-
-" Color name (:help gui-colors) or RGB color
-let g:limelight_conceal_guifg = 'DarkGray'
-let g:limelight_conceal_guifg = '#777777'
-
-" Default: 0.5
-let g:limelight_default_coefficient = 0.7
-
-" Number of preceding/following paragraphs to include (default: 0)
-let g:limelight_paragraph_span = 1
-
-" Beginning/end of paragraph
-" When there's no empty line between the paragraphs
-" and each paragraph starts with indentation
-let g:limelight_bop = '^\s'
-let g:limelight_eop = '\ze\n^\s'
-
-" Highlighting priority (default: 10)
-" Set it to -1 not to overrule hlsearch
-let g:limelight_priority = -1
diff --git a/.config/nvim/vim-script/_nvimtree/init.vim b/.config/nvim/vim-script/_nvimtree/init.vim
deleted file mode 100644
index de5634e..0000000
--- a/.config/nvim/vim-script/_nvimtree/init.vim
+++ /dev/null
@@ -1,19 +0,0 @@
-" TODO this really should be in the lua section
-let g:nvim_tree_icons = {
- \ 'default': '',
- \ 'symlink': '',
- \ 'git': {
- \ 'unstaged': "",
- \ 'staged': "✓",
- \ 'unmerged': "",
- \ 'renamed': "➜",
- \ 'untracked': "✗"
- \ },
- \ 'folder': {
- \ 'default': "",
- \ 'open': "",
- \ 'empty': "",
- \ 'empty_open': "",
- \ 'symlink': "",
- \ }
- \ }
diff --git a/.config/nvim/vim-script/_whichkey/init.vim b/.config/nvim/vim-script/_whichkey/init.vim
index c8fe9e4..2d2b444 100644
--- a/.config/nvim/vim-script/_whichkey/init.vim
+++ b/.config/nvim/vim-script/_whichkey/init.vim
@@ -3,7 +3,7 @@
" Timeout
let g:which_key_timeout = 100
-let g:which_key_display_names = {'<CR>': '↵', '<TAB>': '⇆'}
+let g:which_key_display_names = {'<CR>': '↵', '<TAB>': '⇆', " ": 'SPC'}
" Map leader to which_key
nnoremap <silent> <leader> :silent <c-u> :silent WhichKey '<Space>'<CR>
@@ -21,216 +21,120 @@ 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['/'] = { 'name' : 'comment' }
-let g:which_key_map['/'] = 'which_key_ignore'
+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'] = [ '<C-W>s' , 'split below']
-let g:which_key_map['n'] = [ ':let @/ = ""' , 'no highlight' ]
+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['T'] = [ ':TSHighlightCapturesUnderCursor' , 'treesitter highlight' ]
let g:which_key_map['v'] = [ '<C-W>v' , 'split right']
-" Add Zen mode, play nice with status line
-let g:which_key_map['z'] = [ 'Goyo' , 'zen' ]
+" TODO play nice with status line
" Group mappings
-" a is for actions
-let g:which_key_map.a = {
- \ 'name' : '+actions' ,
- \ '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'],
-" \ 'b' : [':BufferPick' , 'pick buffer'],
-" \ 'd' : [':Bdelete' , 'delete-buffer'],
-" \ 'n' : ['bnext' , 'next-buffer'],
-" \ 'p' : ['bprevious' , 'previous-buffer'],
-" \ '?' : ['Buffers' , 'fzf-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' : ['<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'],
-" \ }
+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']
+ \ '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'],
- \ ';' : [':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'],
\ }
+" S is for Session
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'] ,
+ \ 's' : [':SessionSave' , 'save session'],
+ \ 'l' : [':SessionLoad' , 'load 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 '],
-" \ }
+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' , 'quickfix'],
+ \ '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'],
- \ 'H' : [':Lspsaga signature_help' , 'signature_help'],
- \ 'I' : [':LspInfo' , 'lsp_info'],
- \ 'l' : [':Lspsaga lsp_finder' , 'lsp_finder'],
+ \ 'I' : [':LspInfo' , 'lsp info'],
+ \ 'v' : [':LspVirtualTextToggle' , 'lsp toggle virtual text'],
+ \ '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'],
+ \ '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'],
\ }
-" 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 btm' , 'btm'],
- \ 'u' : [':FloatermNew ncdu' , 'ncdu'],
- \ }
-
call which_key#register('<Space>', "g:which_key_map")