1
0
mirror of https://github.com/amix/vimrc synced 2025-06-16 01:25:00 +08:00

Updated vim plugins. Nerd tree is on the right by default

This commit is contained in:
amix
2015-02-13 00:19:27 +00:00
parent a4b4587019
commit 00f043f0de
25 changed files with 386 additions and 109 deletions

View File

@ -37,20 +37,21 @@ function! GoIndent(lnum)
let previ = indent(prevlnum)
let ind = previ
let s:shiftwidth = shiftwidth()
if prevl =~ '[({]\s*$'
" previous line opened a block
let ind += &sw
let ind += s:shiftwidth
endif
if prevl =~# '^\s*\(case .*\|default\):$'
" previous line is part of a switch statement
let ind += &sw
let ind += s:shiftwidth
endif
" TODO: handle if the previous line is a label.
if thisl =~ '^\s*[)}]'
" this line closed a block
let ind -= &sw
let ind -= s:shiftwidth
endif
" Colons are tricky.
@ -58,7 +59,7 @@ function! GoIndent(lnum)
" We ignore trying to deal with jump labels because (a) they're rare, and
" (b) they're hard to disambiguate from a composite literal key.
if thisl =~# '^\s*\(case .*\|default\):$'
let ind -= &sw
let ind -= s:shiftwidth
endif
return ind