make 'q' trigger either :bd or :quit

This commit is contained in:
Marco Hinz 2013-04-27 14:58:23 +02:00
parent aab37d4ccd
commit 1639fe5f8a

View file

@ -88,10 +88,15 @@ function! s:insane_in_the_membrane() abort
setlocal nomodifiable nomodified
nnoremap <buffer> q :quit<cr>
nnoremap <buffer><silent> e :enew<cr>
nnoremap <buffer><silent> <cr> :normal <c-r><c-w><cr>
nnoremap <buffer><silent> <2-LeftMouse> :execute 'normal '. matchstr(getline('.'), '\w\+')<cr>
nnoremap <buffer> q
\ :if len(filter(range(0, bufnr('$')), 'buflisted(v:val)')) > 1 <bar>
\ bd <bar>
\ else <bar>
\ quit <bar>
\ endif<cr>
if exists('g:startify_empty_buffer_key')
execute 'nnoremap <buffer><silent> '. g:startify_empty_buffer_key .' :enew<cr>'