胡乱配了下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
syntax on
set cindent autoindent number sts=4 sw=4 ts=4 et
set backspace=indent,eol,start
autocmd FileType python setlocal makeprg=python %
autocmd FileType c setlocal makeprg=gcc -o %< %
autocmd FileType cpp setlocal makeprg=g++ -o %< %
autocmd FileType java setlocal makeprg=java %
colorscheme industry
map <F2> :call SetTitle()<CR>
map <F5> :call Run()<CR>
map <F7> :make<CR><CR><CR> :cw<CR><CR>
func! Run()
if &filetype == "java"
exec "!java %<"
endif
if &filetype == "python"
exec "!python %"
endif
exec "!./%<"
endfunc
func SetTitle()
let l = 0
let l = l + 1 | call setline(l,'/* **********************************************')
let l = l + 1 | call setline(l,'Auther: haibin')
let l = l + 1 | call setline(l,'Created Time: '.strftime('%c'))
let l = l + 1 | call setline(l,'File Name : '.expand('%'))
let l = l + 1 | call setline(l,'*********************************************** */')
if &filetype == "cpp"
let l = l + 1 | call setline(l, '#include <iostream>')
let l = l + 1 | call setline(l, '#include <cstring>')
let l = l + 1 | call setline(l, '#include <cstdio>')
let l = l + 1 | call setline(l, '#include <cstdlib>')
let l = l + 1 | call setline(l, 'using namespace std;')
endif
if &filetype == "c"
let l = l + 1 | call setline(l, '#include <stdio.h>')
let l = l + 1 | call setline(l, '#include <string.h>')
let l = l + 1 | call setline(l, '#include <stdlib.h>')
endif
endfunc
inoremap ( ()<Esc>i
inoremap { {}<Esc>i<CR><Esc>
inoremap [ []<Esc>i
inoremap " "