mirror of
https://github.com/ViViDboarder/vim-settings.git
synced 2024-12-22 08:27:36 +00:00
New version of zen command to enable or disable limelight
This commit is contained in:
parent
4e437e9f59
commit
33d10de22c
@ -1,13 +1,55 @@
|
||||
" Both these plugins work well together for distraction free editing
|
||||
command Zen :Goyo
|
||||
Plug 'junegunn/goyo.vim', { 'on': 'Goyo' }
|
||||
Plug 'junegunn/limelight.vim', { 'on': 'Limelight' }
|
||||
|
||||
let g:goyo_width = 120
|
||||
|
||||
" Enables Zen mode (Goyo + Limelight)
|
||||
command -bang Zen call <SID>zen_mode(<bang>0)
|
||||
let g:zen_mode = 0
|
||||
function s:zen_mode(bang)
|
||||
if !g:zen_mode
|
||||
Goyo
|
||||
if !a:bang
|
||||
Limelight
|
||||
endif
|
||||
let g:zen_mode = 1
|
||||
else
|
||||
Goyo!
|
||||
Limelight!
|
||||
let g:zen_mode = 0
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" Enables prose mode
|
||||
command -bang Prose call <SID>prose_mode(<bang>0)
|
||||
let g:prose_mode = 0
|
||||
function s:prose_mode(bang)
|
||||
if !g:prose_mode
|
||||
Goyo
|
||||
|
||||
setlocal formatoptions=ant
|
||||
setlocal textwidth=80
|
||||
setlocal wrapmargin=0
|
||||
|
||||
if !a:bang
|
||||
Limelight
|
||||
endif
|
||||
let g:prose_mode = 1
|
||||
else
|
||||
Goyo!
|
||||
Limelight!
|
||||
let g:prose_mode = 0
|
||||
endif
|
||||
endfunction
|
||||
|
||||
|
||||
function! s:goyo_enter()
|
||||
Limelight
|
||||
" Limelight
|
||||
endfunction
|
||||
function! s:goyo_leave()
|
||||
Limelight!
|
||||
" Limelight!
|
||||
endfunction
|
||||
|
||||
autocmd! User GoyoEnter nested call <SID>goyo_enter()
|
||||
autocmd! User GoyoLeave nested call <SID>goyo_leave()
|
||||
|
Loading…
Reference in New Issue
Block a user