-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvimrc.bkp
More file actions
36 lines (30 loc) · 704 Bytes
/
vimrc.bkp
File metadata and controls
36 lines (30 loc) · 704 Bytes
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
set tabstop=2 shiftwidth=2 expandtab
set number
set ruler
map <C-n> :NERDTreeToggle<CR>
autocmd BufWritePre * :%s/\s\+$//e
execute pathogen#infect()
syntax on
filetype plugin indent on
color slate
autocmd VimEnter * NERDTree
autocmd VimEnter * wincmd p
function! NERDTreeQuit()
redir => buffersoutput
silent buffers
redir END
let pattern = '^\s*\(\d\+\)\(.....\) "\(.*\)"\s\+line \(\d\+\)$'
let windowfound = 0
for bline in split(buffersoutput, "\n")
let m = matchlist(bline, pattern)
if (len(m) > 0)
if (m[2] =~ '..a..')
let windowfound = 1
endif
endif
endfor
if (!windowfound)
quitall
endif
endfunction
autocmd WinEnter * call NERDTreeQuit()