forked from rafi/vim-config
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gina.vim
55 lines (44 loc) · 2 KB
/
gina.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
" :h gina
" ---
" Problems? https://github.com/lambdalisue/gina.vim/issues
call gina#custom#command#alias('status', 'st')
call gina#custom#command#option('st', '-s')
call gina#custom#command#option('status', '-b')
" call gina#custom#command#option('/\v(status|branch|ls|grep|changes)', '--opener', 'botright 10split')
" call gina#custom#command#option('/\v(blame|diff|log)', '--opener', 'tabnew')
call gina#custom#command#option('commit', '--opener', 'below vnew')
call gina#custom#command#option('commit', '--verbose')
let s:width_quarter = string(winwidth(0) / 4)
let s:width_half = string(winwidth(0) / 2)
call gina#custom#command#option('blame', '--width', s:width_quarter)
let g:gina#command#blame#formatter#format = '%au: %su%= on %ti %ma%in'
" Open in vertical split
call gina#custom#command#option(
\ '/\%(branch\|changes\|grep\|log\|reflog\)',
\ '--opener', 'vsplit'
\)
" Fixed medium width types
call gina#custom#execute(
\ '/\%(changes\|ls\)',
\ 'vertical resize ' . s:width_half . ' | setlocal winfixwidth'
\)
" Fixed small width special types
call gina#custom#execute(
\ '/\%(branch\)',
\ 'vertical resize ' . s:width_quarter . ' | setlocal winfixwidth'
\)
" Alias 'p'/'dp' globally
call gina#custom#action#alias('/.*', 'dp', 'diff:preview')
call gina#custom#mapping#nmap('/.*', 'dp', ':<C-u>call gina#action#call(''dp'')<CR>', {'noremap': 1, 'silent': 1})
" call gina#custom#action#alias('/\%(blame\|log\)', 'preview', 'botright show:commit:preview')
call gina#custom#mapping#nmap('/.*', 'p',
\ ':<C-u>call gina#action#call(''preview'')<CR>',
\ {'noremap': 1, 'silent': 1, 'nowait': 1})
" Echo chunk info with K
call gina#custom#mapping#nmap('blame', 'K', '<Plug>(gina-blame-echo)')
" Blame mappings
let g:gina#command#blame#use_default_mappings = 0
call gina#custom#mapping#nmap('blame', '<Return>', '<Plug>(gina-blame-open)')
call gina#custom#mapping#nmap('blame', '<Backspace>', '<Plug>(gina-blame-back)')
call gina#custom#mapping#nmap('blame', '<C-r>', '<Plug>(gina-blame-C-L)')
" vim: set ts=2 sw=2 tw=80 noet :