Option to Quit Startify But Not Vim Even if there Are No Unlisted Buffers
- Dominant language
- Vim Script
- Stars
- 5.4k
- Forks
- 181
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
For my workflow I would like to toggle startify on/off on demand.
I can *sort* of get this with the following:
```
let g:startify_disable_at_vimenter = 1
augroup rcstartify
autocmd User Startified nmap q
augroup END
nnoremap Startify
```
It works as I would like it, *except* if I have a blank (No Name) buffer. In that case, by design Startify quits Vim.
Would it be possible to support a way to close/clean-up the Startify buffer but not quit Vim? Binding that to a key once I'm in a startify buffer will provide the workflow above.
If there is interest in supporting this option, but no time to implement this, I can submit a PR?
Basically, just one line needs to be changed in https://github.com/mhinz/vim-startify/blob/81e36c352a8deea54df5ec1e2f4348685569bed2/autoload/startify.vim#L1007-L1017. For e.g.:
```vimscript
function! s:close() abort
if len(filter(range(0, bufnr('$')), 'buflisted(v:val)')) - &buflisted
if bufloaded(bufnr('#')) && bufnr('#') != bufnr('%')
buffer #
else
bnext
endif
elseif get(g:, "startify_quit_on_no_listed_buffers", 1)
quit
endif
endfunction
```
Contributor guide
Research direction
Start in autoload/startify.vim around lines 1007-1017, especially s:close(), and review how the supplied configuration triggers Startify. Verify the behavior with a blank No Name buffer and no other listed buffers. Done means Startify can be closed without quitting Vim when the new option is enabled, while the existing quit behavior remains the default.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- vim
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100