Skip to content

update autocmd.vim #23

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 21, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions config/autocmd.vim
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,24 @@ autocmd BufRead,BufNewFile .jshintrc setfiletype json
"autocmd CursorMovedI * if pumvisible() == 0|pclose|endif
autocmd InsertLeave * if pumvisible() == 0|pclose|endif

function! CheckLeftBuffers()
if tabpagenr('$') == 1
let i = 1
while i <= winnr('$')
if getbufvar(winbufnr(i), '&buftype') == 'help' ||
\ getbufvar(winbufnr(i), '&buftype') == 'quickfix' ||
\ exists('t:NERDTreeBufName') &&
\ bufname(winbufnr(i)) == t:NERDTreeBufName ||
\ bufname(winbufnr(i)) == '__Tag_List__'
let i += 1
else
break
endif
endwhile
if i == winnr('$') + 1
qall
endif
unlet i
endif
endfunction
autocmd BufEnter * call CheckLeftBuffers()