Updated Customization (markdown)

Junegunn Choi
2014-04-08 18:15:31 -07:00
parent 86e790373e
commit 895e7a2e5b

@@ -75,15 +75,16 @@ let g:goyo_callbacks = [function('g:goyo_before'), function('g:goyo_after')]
Suggested by [mm2703](https://github.com/mm2703) and [axelGschaider](https://github.com/axelGschaider) in [#16](https://github.com/junegunn/goyo.vim/issues/16)
```vim
" Quitting whether Goyo is active or not
ca wq :w<cr>:call Quit()<cr>
ca q :call Quit()<cr>
function! Quit()
if exists('#goyo')
Goyo
endif
quit
function! g:goyo_before()
" ...
endfunction
```
Or you can use `:qa` or `:wqa` instead of `:q` and `:wq`.
function! g:goyo_after()
" Quit Vim if this is the only remaining buffer
if len(filter(range(1, bufnr('$')), 'buflisted(v:val)')) == 1
qa
endif
endfunction
let g:goyo_callbacks = [function('g:goyo_before'), function('g:goyo_after')]
```