Always create new buffer

Nowadays :enew won't create a new buffer if the current buffer is empty. So this
won't create an unused, empty, unnamed buffer.
This commit is contained in:
Marco Hinz 2018-04-09 14:31:53 +02:00
parent 113655717e
commit 0a81f95abf
No known key found for this signature in database
GPG key ID: 1C980A1B657B4A4F
2 changed files with 5 additions and 6 deletions

View file

@ -43,11 +43,8 @@ endfunction
" Function: #insane_in_the_membrane {{{1 " Function: #insane_in_the_membrane {{{1
function! startify#insane_in_the_membrane() abort function! startify#insane_in_the_membrane() abort
if &insertmode " Handle vim -y, vim -M.
return if &insertmode || !&modifiable
endif
if &modified
return return
endif endif
@ -59,6 +56,8 @@ function! startify#insane_in_the_membrane() abort
endfor endfor
endif endif
noautocmd enew
silent! setlocal silent! setlocal
\ bufhidden=wipe \ bufhidden=wipe
\ colorcolumn= \ colorcolumn=

View file

@ -60,7 +60,7 @@ command! -nargs=? -bar -complete=customlist,startify#session_list SLoad
command! -nargs=? -bar -bang -complete=customlist,startify#session_list SSave call startify#session_save(<bang>0, <f-args>) command! -nargs=? -bar -bang -complete=customlist,startify#session_list SSave call startify#session_save(<bang>0, <f-args>)
command! -nargs=? -bar -bang -complete=customlist,startify#session_list SDelete call startify#session_delete(<bang>0, <f-args>) command! -nargs=? -bar -bang -complete=customlist,startify#session_list SDelete call startify#session_delete(<bang>0, <f-args>)
command! -nargs=0 -bar SClose call startify#session_close() command! -nargs=0 -bar SClose call startify#session_close()
command! -nargs=0 -bar Startify noautocmd enew | call startify#insane_in_the_membrane() command! -nargs=0 -bar Startify call startify#insane_in_the_membrane()
command! -nargs=0 -bar StartifyDebug call startify#debug() command! -nargs=0 -bar StartifyDebug call startify#debug()
nnoremap <silent><plug>(startify-open-buffers) :<c-u>call startify#open_buffers()<cr> nnoremap <silent><plug>(startify-open-buffers) :<c-u>call startify#open_buffers()<cr>