-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.vimrc
More file actions
62 lines (54 loc) · 1.69 KB
/
.vimrc
File metadata and controls
62 lines (54 loc) · 1.69 KB
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
set nocompatible " required
filetype off " required
filetype plugin indent on
set softtabstop=4
set tabstop=4
set shiftwidth=4
set expandtab
set number
set hlsearch
set encoding=utf-8
set mouse=a
set dictionary+=/usr/share/dict/words
filetype plugin on
ia xdate <c-r>=strftime("%Y/%m/%d %H:%M:%S")<cr>
ia uns using namespace std;
ia imn if __name__ == '__main__':
ia makec++ //<c-r>=expand("%")<cr><lf><c-r>=strftime("%Y-%m-%d %H:%M:%S")<cr><lf><c-r>=$USER<cr><lf><backspace><backspace><lf>#include <iostream><lf>using namespace std;<lf>int main(int argc, char** argv)<lf>{<lf><tab><lf>return 0;<lf><backspace>}<lf>
"autocmd BufNewFile *.cpp 0r ~/test.cpp
ia usaco /*<lf><backspace><backspace><backspace>ID: tuke1991<lf>PROG: <lf>LANG: C++<lf>*/<lf>#include <iostream><lf>#include <fstream><lf>using namespace std;<lf>int main(int argc, char** argv)<lf>{<lf><tab><lf>return 0;<lf><backspace>}<lf>
set ruler
set showcmd
set list lcs=tab:☞-,trail:♪
autocmd Filetype c set omnifunc=ccomplete
autocmd Filetype cpp set omnifunc=cppcomplete
set foldmethod=indent
set foldlevel=99
"Enable folding with the spacebar
nnoremap <space> za
""""""""""""""""""""""
"Quickly Run
""""""""""""""""""""""
map <F5> :call CompileRunGcc()<CR>
func! CompileRunGcc()
exec "w"
if &filetype == 'c'
exec "!g++ % -o %<"
exec "!time ./%<"
elseif &filetype == 'cpp'
exec "!g++ % -o %<"
exec "!time ./%<"
elseif &filetype == 'sh'
:!time bash %
elseif &filetype == 'python'
exec "!python3 %"
endif
endfunc
map <F6> :call AddPrint()<CR>
"add print() in current line for python
func! AddPrint()
exec "w"
"got bugs when there is a annotation in the end of line
:.s/\(\w.*\)$/print(\1)/
:nohl
endfunc