mirror of
https://github.com/junegunn/goyo.vim.git
synced 2025-11-18 08:13:43 -05:00
Updated Customization (markdown)
@@ -1,7 +1,7 @@
|
||||
## Callbacks for GVim
|
||||
|
||||
```vim
|
||||
function! g:goyo_before()
|
||||
function! Goyo_before()
|
||||
if has('gui_running')
|
||||
set fullscreen
|
||||
set background=light
|
||||
@@ -11,7 +11,7 @@ function! g:goyo_before()
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! g:goyo_after()
|
||||
function! Goyo_after()
|
||||
if has('gui_running')
|
||||
set nofullscreen
|
||||
set background=dark
|
||||
@@ -21,7 +21,7 @@ function! g:goyo_after()
|
||||
endif
|
||||
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
|
||||
@@ -42,17 +42,17 @@ let g:goyo_callbacks = [function('s:goyo_before')]
|
||||
- by [EPNGH](https://github.com/EPNGH)
|
||||
|
||||
```vim
|
||||
function! g:goyo_before()
|
||||
function! Goyo_before()
|
||||
delcommand ZoomWin
|
||||
delcommand <Plug>ZoomWin
|
||||
endfunction
|
||||
|
||||
function! g:goyo_after()
|
||||
function! Goyo_after()
|
||||
command! ZoomWin call ZoomWin()
|
||||
command! <Plug>ZoomWin call ZoomWin()
|
||||
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
|
||||
@@ -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)
|
||||
|
||||
```vim
|
||||
function! g:goyo_before()
|
||||
function! 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()
|
||||
function! Goyo_after()
|
||||
" Quit Vim if this is the only remaining buffer
|
||||
if b:quitting && len(filter(range(1, bufnr('$')), 'buflisted(v:val)')) == 1
|
||||
if b:quitting_bang
|
||||
@@ -78,5 +78,5 @@ function! g:goyo_after()
|
||||
endif
|
||||
endfunction
|
||||
|
||||
let g:goyo_callbacks = [function('g:goyo_before'), function('g:goyo_after')]
|
||||
let g:goyo_callbacks = [function('Goyo_before'), function('Goyo_after')]
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user