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