make 'q' trigger either :bd or :quit
This commit is contained in:
parent
aab37d4ccd
commit
1639fe5f8a
|
@ -88,10 +88,15 @@ function! s:insane_in_the_membrane() abort
|
||||||
|
|
||||||
setlocal nomodifiable nomodified
|
setlocal nomodifiable nomodified
|
||||||
|
|
||||||
nnoremap <buffer> q :quit<cr>
|
|
||||||
nnoremap <buffer><silent> e :enew<cr>
|
nnoremap <buffer><silent> e :enew<cr>
|
||||||
nnoremap <buffer><silent> <cr> :normal <c-r><c-w><cr>
|
nnoremap <buffer><silent> <cr> :normal <c-r><c-w><cr>
|
||||||
nnoremap <buffer><silent> <2-LeftMouse> :execute 'normal '. matchstr(getline('.'), '\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')
|
if exists('g:startify_empty_buffer_key')
|
||||||
execute 'nnoremap <buffer><silent> '. g:startify_empty_buffer_key .' :enew<cr>'
|
execute 'nnoremap <buffer><silent> '. g:startify_empty_buffer_key .' :enew<cr>'
|
||||||
|
|
Loading…
Reference in a new issue