Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
0 additions
and
35 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,2 @@ | ||
" :help last-position-jump | ||
au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g`\"zz" | endif | ||
|
||
" https://github.com/junegunn/goyo.vim/wiki/Customization#ensure-q-to-quit-even-when-goyo-is-active | ||
function! s:goyo_enter() | ||
set background=light | ||
set spell | ||
colorscheme pencil | ||
|
||
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! s:goyo_leave() | ||
" 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 | ||
qa! | ||
else | ||
qa | ||
endif | ||
endif | ||
endfunction | ||
|
||
autocmd! User GoyoEnter nested call <SID>goyo_enter() | ||
autocmd! User GoyoLeave nested call <SID>goyo_leave() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters