Skip to content

Instantly share code, notes, and snippets.

@benwtks
Created February 20, 2020 19:03
Show Gist options
  • Save benwtks/885f5d137230e363e3e9b30a03f450a7 to your computer and use it in GitHub Desktop.
Save benwtks/885f5d137230e363e3e9b30a03f450a7 to your computer and use it in GitHub Desktop.
which-key
" My which-key mappings
" Define prefix dictionary
let g:which_key_map = {
\ 'h': [':History', 'History'],
\ 'n': [':NERDTreeToggle', 'NERDTree toggle'],
\ 'u': [':MundoToggle', 'Undo tree'],
\ }
let g:which_key_map.b = {
\ 'name': '+buffer',
\ 'p': ['<C-o>', 'Previous buffer'],
\ 'b': [':Buffers', 'Buffers list'],
\ 'q': [':BufferQuit', 'Quit buffer'],
\ 'e': ['<C-w>=', 'Equalise'],
\ 'h': [':vertical resize -5', 'Decrease width'],
\ 'k': [':resize +5', 'Increase height'],
\ 'j': [':resize -5', 'Decrease height'],
\ 'l': [':vertical resize +5', 'Increase width']
\ }
let g:which_key_map.w = {
\ 'name': '+wiki',
\ 'w': 'index',
\ 'd': 'delete current wiki file',
\ 'r': 'rename current wiki file',
\ 'n': [':RenumberSelection', 'Renumber selected list'],
\ 'c': [':ToggleCheckbox', 'Toggle checkbox'],
\ }
let g:which_key_map.t = {
\ 'name': '+table',
\ 'd': {
\ 'name': '+tableDelete'
\ },
\ 'f': {
\ 'name': '+tableFormula'
\ }
\ }
let g:which_key_map.o = {
\ 'name': '+open',
\ 'f': [':Files', 'File'],
\ 'p': [':ProjectFiles', 'Project file'],
\ 'd': [':Dot', 'Dotfiles'],
\ 'i': [':e $MYVIMRC', 'init.vim'],
\ }
let g:which_key_map.e = {
\ 'name': '+edit',
\ '=': ['O<esc>jO', 'Insert between lines'],
\ 'w': [':%s/\s\+$//e<return>;;', 'Remove trailing whitespace'],
\ }
let g:which_key_map.g = {
\ 'name': '+git',
\ 's': [':G', 'Status'],
\ 'c': [':Gcommit', 'Commit'],
\ 'l': [':GV', 'Log'],
\ 'f': [':Gdiff', 'File diff'],
\ 'd': [':G d', 'Diff'],
\ 'D': [':G ds', 'Staged diff'],
\ 'b': [':Gblame', 'Blame'],
\ 'r': [':G remote', 'Remote'],
\ 'p': [':Gpush', 'Push'],
\ 'u': [':Gpull', 'Pull']
\ }
let g:which_key_map.c = {
\ 'name': '+compile',
\ 'm': [':make', 'make']
\ }
let g:which_key_map.a = {
\ 'name': '+apps',
\ 't': [':terminal htop', 'Tasks']
\ }
let g:which_key_map.s = {
\ 'name': '+search',
\ 'c': [':let @/ = ""', 'Clear']
\ }
let g:which_key_map.p = {
\ 'name': '+plug',
\ 'i': [':PlugInstall', 'Install'],
\ 'u': [':PlugUpdate', 'Update'],
\ 'c': [':PlugClean', 'Clean'],
\ 's': [':PlugStatus', 'Status'],
\ }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment