From 48e0bde090d18c797b2542fcc4a3b0cbdd524795 Mon Sep 17 00:00:00 2001 From: Chris Date: Sun, 10 May 2020 23:27:51 -0400 Subject: which key is stable --- README.md | 1 - general/functions.vim | 10 ++++----- init.vim | 9 ++++---- keys/which-key.vim | 57 ++++++++++++++++++++++------------------------- plug-config/coc.vim | 1 + plug-config/gitgutter.vim | 0 plug-config/ranger.vim | 1 - plug-config/signify.vim | 27 ---------------------- vim-plug/plugins.vim | 9 ++++---- 9 files changed, 42 insertions(+), 73 deletions(-) create mode 100644 plug-config/gitgutter.vim delete mode 100644 plug-config/signify.vim diff --git a/README.md b/README.md index 68894c90..ef823930 100644 --- a/README.md +++ b/README.md @@ -89,7 +89,6 @@ Explanations and installation instruction can be found on my blog - setup custom paths - install script envsubst is your friend - add better whitespace pluginand a toggle, video about clean code maybe -- pear tree (jsx autocomplete would be nice) - echodoc and buitin support with CoC - snippets (coc snippets) - git messenger diff --git a/general/functions.vim b/general/functions.vim index a708c61e..58db6b1f 100644 --- a/general/functions.vim +++ b/general/functions.vim @@ -1,11 +1,9 @@ " Turn spellcheck on for markdown files -" augroup auto_spellcheck - " autocmd BufNewFile,BufRead *.md setlocal spell -" augroup END +augroup auto_spellcheck + autocmd BufNewFile,BufRead *.md setlocal spell +augroup END " Remove trailing whitespaces automatically before save " augroup strip_ws - " autocmd BufWritePre * call utils#stripTrailingWhitespaces() +" autocmd BufWritePre * call utils#stripTrailingWhitespaces() " augroup END - - diff --git a/init.vim b/init.vim index 23a70d2f..f8c51dc5 100644 --- a/init.vim +++ b/init.vim @@ -8,6 +8,7 @@ " Always source these source $HOME/.config/nvim/vim-plug/plugins.vim source $HOME/.config/nvim/general/settings.vim +source $HOME/.config/nvim/general/functions.vim source $HOME/.config/nvim/keys/mappings.vim source $HOME/.config/nvim/keys/which-key.vim source $HOME/.config/nvim/general/paths.vim @@ -22,20 +23,20 @@ else source $HOME/.config/nvim/themes/syntax.vim source $HOME/.config/nvim/themes/onedark.vim source $HOME/.config/nvim/themes/airline.vim - source $HOME/.config/nvim/plug-config/rnvimr.vim + source $HOME/.config/nvim/plug-config/ranger.vim source $HOME/.config/nvim/plug-config/fzf.vim source $HOME/.config/nvim/plug-config/nerd-commenter.vim source $HOME/.config/nvim/plug-config/rainbow.vim - source $HOME/.config/nvim/plug-config/coc.vim source $HOME/.config/nvim/plug-config/quickscope.vim source $HOME/.config/nvim/plug-config/sneak.vim + source $HOME/.config/nvim/plug-config/coc.vim source $HOME/.config/nvim/plug-config/goyo.vim source $HOME/.config/nvim/plug-config/vim-rooter.vim source $HOME/.config/nvim/plug-config/start-screen.vim - source $HOME/.config/nvim/plug-config/signify.vim + source $HOME/.config/nvim/plug-config/gitgutter.vim source $HOME/.config/nvim/plug-config/closetags.vim source $HOME/.config/nvim/plug-config/floaterm.vim source $HOME/.config/nvim/plug-config/vista.vim luafile $HOME/.config/nvim/lua/plug-colorizer.lua - "source $HOME/.config/nvim/plug-config/easymotion.vim + " source $HOME/.config/nvim/plug-config/easymotion.vim endif diff --git a/keys/which-key.vim b/keys/which-key.vim index 4a2d47ef..0c84750f 100644 --- a/keys/which-key.vim +++ b/keys/which-key.vim @@ -2,6 +2,9 @@ let g:which_key_map = {} let g:which_key_sep = '→' " set timeoutlen=100 +nnoremap :silent WhichKey '' +vnoremap :silent :silent WhichKeyVisual '' + " Not a fan of floating windows for this let g:which_key_use_floating_win = 0 @@ -25,12 +28,10 @@ let g:which_key_map['e'] = [ ':CocCommand explorer' , 'explorer' ] let g:which_key_map['f'] = [ ':Files' , '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'] = [ ':Startify' , 'start screen' ] +let g:which_key_map['r'] = [ ':Ranger' , 'ranger' ] +let g:which_key_map['S'] = [ ':Startify' , 'start screen' ] let g:which_key_map['v'] = [ 'v' , 'split right'] let g:which_key_map['z'] = [ 'Goyo' , 'zen' ] -" nmap r :RnvimrToggle -" let g:which_key_map['"'] = ['viwa"bi"lel' , 'surround'] " f is for find let g:which_key_map.f = { @@ -64,30 +65,28 @@ let g:which_key_map.f = { " g is for git let g:which_key_map.g = { \ 'name' : '+git' , - \ '/' : [':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'] , - \ 'r' : [':Rg' , 'text Rg'], - \ 's' : [':Snippets' , 'snippets'], - \ 'S' : [':Colors' , 'color schemes'], - \ 't' : [':Tags' , 'project tags'], - \ 'T' : [':BTags' , 'buffer tags'], - \ 'w' : [':Windows' , 'search windows'], - \ 'y' : [':Filetypes' , 'file types'], - \ 'z' : [':FZF' , 'FZF'], + \ '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 @@ -142,7 +141,5 @@ let g:which_key_map.t = { \ } call which_key#register('', "g:which_key_map") -nnoremap :silent WhichKey '' -vnoremap :silent WhichKeyVisual '' diff --git a/plug-config/coc.vim b/plug-config/coc.vim index 8173ae08..7ed888ce 100644 --- a/plug-config/coc.vim +++ b/plug-config/coc.vim @@ -14,6 +14,7 @@ " \ 'coc-svg', " \ 'coc-prettier', " \ 'coc-vimlsp', + " \ 'coc-flutter', " \ 'coc-xml', " \ 'coc-yank', " \ 'coc-json', diff --git a/plug-config/gitgutter.vim b/plug-config/gitgutter.vim new file mode 100644 index 00000000..e69de29b diff --git a/plug-config/ranger.vim b/plug-config/ranger.vim index dc953ae8..9e1ba2d7 100644 --- a/plug-config/ranger.vim +++ b/plug-config/ranger.vim @@ -1,4 +1,3 @@ let g:ranger_replace_netrw = 1 "// open ranger when vim open a directory "let g:NERDTreeHijackNetrw = 0 // add this line if you use NERDTree let g:ranger_map_keys = 0 -map r :Ranger diff --git a/plug-config/signify.vim b/plug-config/signify.vim deleted file mode 100644 index 6e04012b..00000000 --- a/plug-config/signify.vim +++ /dev/null @@ -1,27 +0,0 @@ -" Change these if you want -let g:signify_sign_add = '+' -let g:signify_sign_delete = '_' -let g:signify_sign_delete_first_line = '‾' -let g:signify_sign_change = '~' - -" let g:signify_sign_add = '|' -" let g:signify_sign_delete = '|' -" let g:signify_sign_delete_first_line = '‾' -" let g:signify_sign_change = '|' - -" I find the numbers disctracting -let g:signify_sign_show_count = 0 -let g:signify_sign_show_text = 1 - - -" Jump though hunks -" nmap j (signify-next-hunk) -" nmap k (signify-prev-hunk) -" nmap gJ 9999gj -" nmap gK 9999gk - - -" If you like colors instead -" highlight SignifySignAdd ctermbg=green guibg=#00ff00 -" highlight SignifySignDelete ctermfg=black ctermbg=red guifg=#ffffff guibg=#ff0000 -" highlight SignifySignChange ctermfg=black ctermbg=yellow guifg=#000000 guibg=#ffff00 diff --git a/vim-plug/plugins.vim b/vim-plug/plugins.vim index 87ff77a7..4031da3d 100644 --- a/vim-plug/plugins.vim +++ b/vim-plug/plugins.vim @@ -55,14 +55,15 @@ call plug#begin('~/.config/nvim/autoload/plugged') Plug 'vim-airline/vim-airline' Plug 'vim-airline/vim-airline-themes' " Ranger - " Plug 'francoiscabrol/ranger.vim' - " Plug 'rbgrouleff/bclose.vim' - Plug 'kevinhwang91/rnvimr', {'do': 'make sync'} + Plug 'francoiscabrol/ranger.vim' + Plug 'rbgrouleff/bclose.vim' + " Plug 'kevinhwang91/rnvimr', {'do': 'make sync'} " FZF Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } Plug 'junegunn/fzf.vim' " Git - Plug 'mhinz/vim-signify' + " Plug 'mhinz/vim-signify' + Plug 'airblade/vim-gitgutter' Plug 'tpope/vim-fugitive' Plug 'tpope/vim-rhubarb' Plug 'junegunn/gv.vim' -- cgit v1.2.3