diff options
-rw-r--r-- | README.md | 1 | ||||
-rw-r--r-- | general/functions.vim | 10 | ||||
-rw-r--r-- | init.vim | 9 | ||||
-rw-r--r-- | keys/which-key.vim | 57 | ||||
-rw-r--r-- | plug-config/coc.vim | 1 | ||||
-rw-r--r-- | plug-config/gitgutter.vim | 0 | ||||
-rw-r--r-- | plug-config/ranger.vim | 1 | ||||
-rw-r--r-- | plug-config/signify.vim | 27 | ||||
-rw-r--r-- | vim-plug/plugins.vim | 9 |
9 files changed, 42 insertions, 73 deletions
@@ -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 - - @@ -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> <leader> :silent WhichKey '<Space>'<CR> +vnoremap <silent> <leader> :silent <c-u> :silent WhichKeyVisual '<Space>'<CR> + " 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'] = [ '<C-W>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'] = [ '<C-W>v' , 'split right'] let g:which_key_map['z'] = [ 'Goyo' , 'zen' ] -" nmap <leader>r :RnvimrToggle<CR> -" let g:which_key_map['"'] = ['viw<esc>a"<esc>bi"<esc>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' : ['<Plug>(GitGutterPreviewHunk)' , 'preview hunk'], + \ 'j' : ['<Plug>(GitGutterNextHunk)' , 'next hunk'], + \ 'k' : ['<Plug>(GitGutterPrevHunk)' , 'prev hunk'], + \ 'l' : [':Git log' , 'log'], + \ 'p' : [':Git push' , 'push'], + \ 'P' : [':Git pull' , 'pull'], + \ 'r' : [':GRemove' , 'remove'], + \ 's' : ['<Plug>(GitGutterStageHunk)' , 'stage hunk'], + \ 't' : [':GitGutterSignsToggle' , 'toggle signs'], + \ 'u' : ['<Plug>(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('<Space>', "g:which_key_map") -nnoremap <silent> <leader> :silent <c-u>WhichKey '<Space>'<CR> -vnoremap <silent> <leader> :silent <c-u>WhichKeyVisual '<Space>'<CR> 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 --- /dev/null +++ b/plug-config/gitgutter.vim 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 <leader>r :Ranger<CR> 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 <leader>j <plug>(signify-next-hunk) -" nmap <leader>k <plug>(signify-prev-hunk) -" nmap <leader>gJ 9999<leader>gj -" nmap <leader>gK 9999<leader>gk - - -" 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' |