-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvimrc
More file actions
65 lines (60 loc) · 1.43 KB
/
vimrc
File metadata and controls
65 lines (60 loc) · 1.43 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
63
64
65
""""""""""""""""""""
"My Configuration
""""""""""""""""""""
ec "(>^.^<)"
set number
set tabstop=2
set softtabstop=2
set shiftwidth=2
set cindent
set autoindent
set expandtab
set hlsearch
set autoread
"""""""""""""""""""""
"pathogen
"""""""""""""""""""""
call pathogen#infect()
syntax on
filetype plugin indent on
"""""""""""""""""""""
"tagbar
"""""""""""""""""""""
nmap fg :TagbarToggle<CR>
let g:tagbar_width=30
autocmd BufReadPost *.c call tagbar#autoopen()
let g:tagbar_right=1
"""""""""""""""""""""
"Code Template
"""""""""""""""""""""
autocmd BufNewFile *.py 0r ~/.vim/template/python.tpl
autocmd BufNewFile ex.cc 0r ~/.vim/template/cpp.tpl
autocmd BufNewFile *.pl 0r ~/.vim/template/perl.tpl
autocmd BufNewFile *.php 0r ~/.vim/template/php.tpl
autocmd BufNewFile ex.c 0r ~/.vim/template/c.tpl
autocmd BufNewFile test.java 0r ~/.vim/template/java.tpl
autocmd BufNewFile *.rb 0r ~/.vim/template/ruby.tpl
""""""""""""""""""""""
"Quickly Run
""""""""""""""""""""""
map cc :call AutoCompileRun()<CR>
vmap ccc :call AutoCompileRun()<CR>
func! AutoCompileRun()
exec "w"
if &filetype == 'c'
exec "!gcc % -o %<"
exec "!time ./%<"
elseif &filetype == 'cpp'
exec "!g++ % -o %<"
exec "!time ./%<"
elseif &filetype == 'java'
exec "!javac %"
exec "!java %<"
elseif &filetype == 'python'
exec "!time python %"
elseif &filetype == 'sh'
:!time bash %
elseif &filetype == 'html'
exec "!firefox % &"
endif
endfunc