diff --git a/.vimrc b/.vimrc index 75e0042..e346d60 100644 --- a/.vimrc +++ b/.vimrc @@ -17,7 +17,14 @@ Plugin 'airblade/vim-gitgutter' Plugin 'dpelle/vim-Grammalecte' Plugin 'loremipsum' Plugin 'mkitt/tabline.vim' +" File Switcher Plugin 'derekwyatt/vim-fswitch' +Plugin 'francoiscabrol/ranger.vim' +" fzf native plugin +Plugin 'junegunn/fzf' +" fzf.vim +Plugin 'junegunn/fzf.vim' +Plugin 'liuchengxu/vim-which-key' call vundle#end() filetype plugin indent on @@ -104,6 +111,7 @@ set ai "Auto indent set si "Smart indent set wrap "Wrap lines +let mapleader = " " set termwinsize=12x0 " Set terminal size set splitbelow " Always split below @@ -132,3 +140,76 @@ let g:grammalecte_cli_py='~/Grammalecte-fr/grammalecte-cli.py' "nmap :vsplit :wincmd l :FSHere nmap z :FSSplitLeft +"""""""""""""""""""""""""""""""""""""" +" Vim Which Key +"""""""""""""""""""""""""""""""""""""" + +nnoremap :silent WhichKey ',' +vnoremap :silent :silent WhichKeyVisual ',' +let g:which_key_map = {} +let g:which_key_sep = ': ' +" Set a shorter timeout, default is 1000 +set timeoutlen=100 + +let g:which_key_use_floating_win = 1 + +" Single mappings +"let g:which_key_map['/'] = [ 'NERDCommenterToggle' , 'comment' ] +let g:which_key_map['f'] = [ ':Files' , 'search files' ] +"let g:which_key_map['h'] = [ 's' , 'split below'] +"let g:which_key_map['S'] = [ ':Startify' , 'start screen' ] +"let g:which_key_map['T'] = [ ':Rg' , 'search text' ] +"let g:which_key_map['E'] = [ ':SSave' , 'save session'] +"let g:which_key_map['L'] = [ ':SLoad' , 'load session'] +"let g:which_key_map['l'] = [ ':Limelight!!' , 'limelight'] +"let g:which_key_map['z'] = [ ':Goyo' , 'zen mode'] +let g:which_key_map['r'] = [ ':Ranger' , 'ranger' ] +"let g:which_key_map['g'] = [ ':FloatermNew lazygit' , 'git'] +"let g:which_key_map['d'] = [ ':FloatermNew lazydocker' , 'docker'] +"let g:which_key_map['k'] = [ ':FloatermNew k9s' , 'k9s'] +"let g:which_key_map['t'] = [ ':FloatermNew' , 'terminal'] + +let g:which_key_map['t'] = [ ':TagbarToggle' , 'Tagbar'] +"let g:which_key_map['v'] = [ 'v' , 'split right'] +let g:which_key_map[' '] = [ ':Buffers' , 'open buffers'] +let g:which_key_map['/'] = [ ':BLines' , 'search current'] + + +" s is for search +let g:which_key_map.s = { + \ 'name' : '+search' , + \ '/' : [':History/' , 'history'], + \ ';' : [':Commands' , 'commands'], + \ 'a' : [':Ag' , 'text Ag'], + \ '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' : [':CocList snippets' , 'snippets'], + \ 'S' : [':Colors' , 'color schemes'], + \ 't' : [':Rg' , 'Rg text'], + \ 'T' : [':BTags' , 'buffer tags'], + \ 'w' : [':Windows' , 'search windows'], + \ 'y' : [':Filetypes' , 'file types'], + \ 'z' : [':FZF' , 'FZF'], + \ } + +" P is for vim-plug +let g:which_key_map.p = { + \ 'name' : '+plug' , + \ 'i' : [':PlugInstall' , 'install'], + \ 'u' : [':PlugUpdate' , 'update'], + \ 'c' : [':PlugClean' , 'clean'], + \ 's' : [':source ~/.config/nvim/init.vim', 'source vimrc'], + \ } + +" Register which key map +call which_key#register(',', "g:which_key_map")