-
Notifications
You must be signed in to change notification settings - Fork 0
/
file.vim
56 lines (39 loc) · 1.14 KB
/
file.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
filetype on
" au BufNewFile,BufRead *.markdown,*.mdown,*.mkd,*.mkdn,*.mdwn,*.md setf markdown
" au BufNewFile,BufRead *.python,*.py setf python
" autocmd! * <buffer>
" "\<bar>"
function! RunInBott(cmd)
exec "update!"
exec '!'.a:cmd
endfunction
function! RunInSyst(cmd)
exec "update!"
call system('start '.a:cmd)
endfunction
" function! RunInTerm(cmd)
" exec "update!"
" exec "sp"
" exec "term ".a:cmd
" endfunction
" " terminal
" augroup my_terminal
" autocmd! * <buffer>
" autocmd TermOpen * nnoremap <buffer> <F6> :bdelete!<cr>
" augroup END
" python
augroup my_python
au! * <buffer>
au FileType python setlocal expandtab
au FileType python noremap <buffer> <F5> :call RunInBott('python '.expand('%:p'))<cr>
au FileType python noremap <buffer> <F6> :call RunInSyst('python '.expand('%:p'))<cr>
augroup END
" markdown
augroup my_markdown
au! * <buffer>
" au FileType markdown call ToggleInteractive()
au FileType markdown noremap <buffer> <F5> :call RunInSyst('Typora.lnk '.expand('%:p'))<cr>
augroup END
" " 可以通过连续按下 ' C 或者 ' H 快速跳转回去
" autocmd BufLeave *.{c,cpp} mark C
" autocmd BufLeave *.h mark H