mirror of
https://github.com/junegunn/goyo.vim.git
synced 2025-11-18 00:03:42 -05:00
Updated Customization (markdown)
@@ -77,13 +77,19 @@ Suggested by [mm2703](https://github.com/mm2703) and [axelGschaider](https://git
|
||||
```vim
|
||||
function! g:goyo_before()
|
||||
let b:quitting = 0
|
||||
let b:quitting_bang = 0
|
||||
autocmd QuitPre <buffer> let b:quitting = 1
|
||||
cabbrev <buffer> q! let b:quitting_bang = 1 <bar> q!
|
||||
endfunction
|
||||
|
||||
function! g:goyo_after()
|
||||
" Quit Vim if this is the only remaining buffer
|
||||
if b:quitting && len(filter(range(1, bufnr('$')), 'buflisted(v:val)')) == 1
|
||||
qa
|
||||
if b:quitting_bang
|
||||
qa!
|
||||
else
|
||||
qa
|
||||
endif
|
||||
endif
|
||||
endfunction
|
||||
|
||||
|
||||
Reference in New Issue
Block a user