gvim 配置
http://www.oschina.net/code/snippet_103341_8984
‘列高亮,与函数列表有冲突
set cursorcolumn
"启动后最大化
au GUIEnter * simalt ~x
"不自动换行
set nowra
"在输入括号时光标会短暂地跳到与之相匹配的括号处,不影响输入
set showmatch
"取得光标处的匹配
function! GetPatternAtCursor(pat)
let col = col('.') - 1
let line = getline('.')
let ebeg = -1
let cont = match(line, a:pat, 0)
while (ebeg >= 0 || (0 <= cont) && (cont <= col))
let contn = matchend(line, a:pat, cont)
if (cont <= col) && (col < contn)
let ebeg = match(line, a:pat, cont)
let elen = contn - ebeg
break
else
let cont = match(line, a:pat, contn)
endif
endwh
if ebeg >= 0
return strpart(line, ebeg, elen)
else
return ""
endif
endfunction
"在输入括号时光标会短暂地跳到与之相匹配的括号处,不影响输入
"正确地处理中文字符的折行和拼接
set formatoptions+=mM
"启动时不要自动折叠代码
set foldlevel=100
"依标记折叠
set foldmethod=marker