forked from posquit0/vimrc
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathplugins.vcs.vim
59 lines (55 loc) · 1.94 KB
/
plugins.vcs.vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
" plugins.vcs.vim
"" Plugin: Vim Git {{{
" For syntax highlighting and other Git niceties
Plug 'tpope/vim-git'
"" }}}
"" Plugin: Vim Fugitive {{{
" The best Git wrapper
Plug 'tpope/vim-fugitive'
" Always open splits Gdiff splits vertically
set diffopt+=vertical
" Key mappings for convenience
nnoremap <Leader>gd :Gvdiff<CR>
nnoremap <Leader>gD :Gvdiff HEAD<CR>
nnoremap <Leader>gs :Git<CR>:20wincmd +<CR>
nnoremap <Leader>gw :Gwrite<CR>
nnoremap <Leader>gb :Git blame -w<CR>:vertical resize 10<CR>
nnoremap <Leader>gci :Git commit --verbose<CR>
"" }}}
"" Plugin: Vim Signify {{{
" Indicate added, modified and removed lines based on data of VCS
Plug 'mhinz/vim-signify'
" default updatetime 4000ms is not good for async update
set updatetime=100
" Key mappings for jumping between changed blocks
nmap <Leader>gj <plug>(signify-next-hunk)
nmap <Leader>gk <plug>(signify-prev-hunk)
nmap <Leader>gJ 9999<Leader>gj
nmap <Leader>gK 9999<leader>gk
" Key mappings to diff hunks
noremap <Leader>ghd :SignifyHunkDiff<CR>
noremap <Leader>ghu :SignifyHunkUndo<CR>
" Key mappings for git hunk text objects
omap ih <plug>(signify-motion-inner-pending)
xmap ih <plug>(signify-motion-inner-visual)
omap ah <plug>(signify-motion-outer-pending)
xmap ah <plug>(signify-motion-outer-visual)
"" }}}
"" Plugin: Gundo {{{
" Make browsing Vim's powerful undo tree less painful
Plug 'sjl/gundo.vim', { 'on': 'GundoToggle' }
" Map GundoToggle to <F12>
nnoremap <silent> <F12> :GundoToggle<CR>
" Set the horizontal width of Gundo graph
let g:gundo_width=40
" Force the preview window below current windows
let g:gundo_preview_bottom=1
" Set 1 to open the right side instead of the left
let g:gundo_right=0
" Disable Gundo entirely if machine not support python
if v:version < '703' || !has('python')
let g:gundo_disable=1
endif
" Rendering diff automatically with cursor move
let g:gundo_auto_preview=1
"" }}}