-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvimrc.local
More file actions
115 lines (104 loc) · 3.11 KB
/
vimrc.local
File metadata and controls
115 lines (104 loc) · 3.11 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
let &termencoding=&encoding
set nocompatible
" 设置编码
set fenc=gbk
set encoding=utf-8
set fileencodings=utf-8,gbk,cp936,latin-1
"set tags=~/.vim/systags
set tags+=/home/users/zhangfangjie/code/stl/tags
let OmniCpp_GlobalScopeSearch = 1
let OmniCpp_ShowAccess = 1
let OmniCpp_ShowPrototypeInAbbr = 1 " 显示函数参数列表
let OmniCpp_MayCompleteDot = 1 " 输入 . 后自动补全
let OmniCpp_MayCompleteArrow = 1 " 输入 -> 后自动补全
let OmniCpp_MayCompleteScope = 1 " 输入 :: 后自动补全
let OmniCpp_DefaultNamespaces = ["std", "_GLIBCXX_STD"]
" 自动关闭补全窗口
au CursorMovedI,InsertLeave * if pumvisible() == 0|silent! pclose|endif
set completeopt=menuone,menu,longest
"let OmniCpp_NamespaceSearch = 1
"let OmniCpp_GlobalScopeSearch = 1
"let OmniCpp_ShowAccess = 1
"let OmniCpp_ShowPrototypeInAbbr = 1
"let OmniCpp_MayCompleteDot = 1
"let OmniCpp_MayCompleteArrow = 1
"let OmniCpp_MayCompleteScope = 1
"let OmniCpp_DefaultNamespaces = ["std", "_GLIBCXX_STD"]
"au CursorMovedI,InsertLeave * if pumvisible() == 0|silent! pclose|endif
func SetShell ()
call setline(1,"#!/bin/bash")
call append(line("."), "")
endfunc
function ClosePair(char)
if getline('.')[col('.') - 1] == a:char
return "\<Right>"
else
return a:char
endif
endf
function CloseBracket()
if match(getline(line('.') + 1), '\s*}') < 0
return "\<CR>}"
else
return "\<Esc>j0f}a"
endif
endf
function QuoteDelim(char)
let line = getline('.')
let col = col('.')
if line[col - 2] == "\\"
return a:char
elseif line[col - 1] == a:char
return "\<Right>"
else
return a:char.a:char."\<Esc>i"
endif
endf
" " 在行和段开始处使用制表符
"set smarttab
nmap <C-c> :wq<cr>
nmap <silent> <F9> :call CompileRunGcc() <cr>
"nmap <silent> mm <esc>:WMToggle<cr>
"在进入vim时自动打开winmanager
"nmap <silent> mk :make <cr>
"nmap <silent> mc :make clean <cr>
"nmap <C-r> :!gcc % <cr>
"用四个空格代替tab
nmap ff :%s/\t/ /g <cr>
nmap <silent> ms :w <cr>
nmap ma :wqa <cr>
nmap mq :wq <cr>
nmap qq :q! <cr>
nmap qa :qa! <cr>
map <F10> :!./%<CR>
"map <F8> O/*<CR>*Copyright(c) 2005-2007 Shanghai LUCENT Telecommunication Corp.<CR>*<CR>*Authored by LUCENT ZJUJOE on:<Esc>:read !date <CR>kJ$a<CR>*<CR>*Funcion goal:<CR>*<CR>*Author:<CR>*<CR>*Input arguments:<CR>*<CR>*OutPut arguments:<CR>*/
map <F7> gg=G
"colorscheme molokai
syntax enable
"set background=dark
colorscheme solarized
func! CompileRunGcc()
exec "w"
if &filetype == 'c'
exec "!gcc % -o %<"
exec "!time ./%<"
elseif &filetype == 'cpp'
exec "!g++ % -o %<"
exec "!time ./%<"
elseif &filetype == 'java'
exec "!javac %"
exec "!time java %<"
elseif &filetype == 'sh'
exec "!bash %"
exec "!"
elseif &filetype == 'python'
exec "!python %"
exec "!"
elseif &filetype == 'html'
exec "!firefox % &"
endif
endfunc
"autocmd VimEnter * NERDTree
"wincmd w
"autocmd VimEnter * wincmd w
"inoremap <expr><space> pumvisible() ? neocomplcache#close_popup() : "\<SPACE>"