Updated Customization (markdown)

Junegunn Choi
2014-06-02 18:15:58 -07:00
parent 51fb374af3
commit 82f4fdffae

@@ -1,7 +1,7 @@
## Callbacks for GVim ## Callbacks for GVim
```vim ```vim
function! g:goyo_before() function! Goyo_before()
if has('gui_running') if has('gui_running')
set fullscreen set fullscreen
set background=light set background=light
@@ -11,7 +11,7 @@ function! g:goyo_before()
endif endif
endfunction endfunction
function! g:goyo_after() function! Goyo_after()
if has('gui_running') if has('gui_running')
set nofullscreen set nofullscreen
set background=dark set background=dark
@@ -21,7 +21,7 @@ function! g:goyo_after()
endif endif
endfunction endfunction
let g:goyo_callbacks = [function('g:goyo_before'), function('g:goyo_after')] let g:goyo_callbacks = [function('Goyo_before'), function('Goyo_after')]
``` ```
## Disabling plugins ## Disabling plugins
@@ -42,17 +42,17 @@ let g:goyo_callbacks = [function('s:goyo_before')]
- by [EPNGH](https://github.com/EPNGH) - by [EPNGH](https://github.com/EPNGH)
```vim ```vim
function! g:goyo_before() function! Goyo_before()
delcommand ZoomWin delcommand ZoomWin
delcommand <Plug>ZoomWin delcommand <Plug>ZoomWin
endfunction endfunction
function! g:goyo_after() function! Goyo_after()
command! ZoomWin call ZoomWin() command! ZoomWin call ZoomWin()
command! <Plug>ZoomWin call ZoomWin() command! <Plug>ZoomWin call ZoomWin()
endfunction endfunction
let g:goyo_callbacks = [function('g:goyo_before'), function('g:goyo_after')] let g:goyo_callbacks = [function('Goyo_before'), function('Goyo_after')]
``` ```
## Ensure `:q` to quit even when Goyo is active ## Ensure `:q` to quit even when Goyo is active
@@ -60,14 +60,14 @@ 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) Suggested by [mm2703](https://github.com/mm2703) and [axelGschaider](https://github.com/axelGschaider) in [#16](https://github.com/junegunn/goyo.vim/issues/16)
```vim ```vim
function! g:goyo_before() function! Goyo_before()
let b:quitting = 0 let b:quitting = 0
let b:quitting_bang = 0 let b:quitting_bang = 0
autocmd QuitPre <buffer> let b:quitting = 1 autocmd QuitPre <buffer> let b:quitting = 1
cabbrev <buffer> q! let b:quitting_bang = 1 <bar> q! cabbrev <buffer> q! let b:quitting_bang = 1 <bar> q!
endfunction endfunction
function! g:goyo_after() function! Goyo_after()
" Quit Vim if this is the only remaining buffer " Quit Vim if this is the only remaining buffer
if b:quitting && len(filter(range(1, bufnr('$')), 'buflisted(v:val)')) == 1 if b:quitting && len(filter(range(1, bufnr('$')), 'buflisted(v:val)')) == 1
if b:quitting_bang if b:quitting_bang
@@ -78,5 +78,5 @@ function! g:goyo_after()
endif endif
endfunction endfunction
let g:goyo_callbacks = [function('g:goyo_before'), function('g:goyo_after')] let g:goyo_callbacks = [function('Goyo_before'), function('Goyo_after')]
``` ```