-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.vim
70 lines (57 loc) · 1.91 KB
/
init.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
60
61
62
63
64
65
66
67
68
69
70
function! AutoCommit()
call system('git rev-parse --git-dir > /dev/null 2>&1')
if v:shell_error
return
endif
let message = 'Updated ' . expand('%:.')
call system('git add ' . expand('%:p'))
call system('git commit -m ' . shellescape(message, 1))
endfun
"autocmd BufWritePost */git/glsl/* call AutoCommit()
function! SaveActive(...)
write!
write! ~/git/glsl/current/active.frag
"call AutoCommit()
endfunction
command! -nargs=+ SaveActive :call SaveActive(<q-args>)
nmap <Leader>q `QzOgc}:SaveActive()<CR>
nmap <Leader>w `WzOgc}:SaveActive()<CR>
nmap <Leader>y `Y:SaveActive()<CR>
nmap <Leader>u `U:SaveActive()<CR>
nmap <Leader>i `I:SaveActive()<CR>
nmap <Leader>p `P:SaveActive()<CR>
nmap <Leader>b /\/\/ BEAT<CR>gc}:SaveActive()<CR>``
nmap <Leader>a /\/\/ AMP<CR>gc}:SaveActive()<CR>``
nmap <Leader>t /\/\/ TIME<CR>gc}:SaveActive()<CR>``
nmap <Leader>o /\/\/ OPTION<CR>gc}:SaveActive()<CR>``
nmap <Leader>x /\/\/ SYM X<CR>gc}:SaveActive()<CR>``
nmap <Leader>z /\/\/ SYM Y<CR>gc}:SaveActive()<CR>``
nmap <Leader>r /\/\/ ROTATE BEFORE<CR>gc}:SaveActive()<CR>``
nmap <Leader>e /\/\/ ROTATE AFTER<CR>gc}:SaveActive()<CR>``
nmap <Leader>j <C-x>:SaveActive()<CR>
nmap <Leader>k <C-a>:SaveActive()<CR>
nmap <Leader><CR> gc}:SaveActive()<CR>
nmap <Leader><Backspace> gcc:SaveActive()<CR>
vmap <Leader><CR> gc:SaveActive()<CR>
vmap <Leader><Backspace> gc:SaveActive()<CR>
nnoremap <Leader><Leader> :SaveActive()<CR>
nnoremap <Leader>[ u:SaveActive()<CR>
nnoremap <Leader>] <C-R>:SaveActive()<CR>
inoremap <Leader><Leader> <Esc>:SaveActive()<CR>i
let s:hidden_all = 0
function! ToggleHiddenAll()
if s:hidden_all == 0
let s:hidden_all = 1
set noshowmode
set noruler
set laststatus=0
set noshowcmd
else
let s:hidden_all = 0
set showmode
set ruler
set laststatus=2
set showcmd
endif
endfunction
nnoremap <S-h> :call ToggleHiddenAll()<CR>