From ac3709eb2a3f096d01748fed8d6c75d34f10d7bb Mon Sep 17 00:00:00 2001 From: Anthony Perkins Date: Fri, 13 Jan 2023 10:50:22 +0000 Subject: [PATCH] Make Goyo enable/disable Limelight --- vimrc | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/vimrc b/vimrc index d87d2a0..3198a53 100644 --- a/vimrc +++ b/vimrc @@ -35,7 +35,7 @@ inoremap inoremap inoremap -nnoremap :Goyo:Limelight!! +nnoremap :Goyo nnoremap :w nnoremap :setlocal spell! spelllang=en_gb nnoremap @@ -143,6 +143,9 @@ if has('autocmd') autocmd BufRead,BufNewFile *.xml set et sw=2 autocmd BufRead,BufNewFile *.yaml set et sw=2 autocmd BufRead,BufNewFile *.yml set et sw=2 + + autocmd User GoyoEnter nested call goyo_enter() + autocmd User GoyoLeave nested call goyo_leave() endif if has('folding') @@ -207,6 +210,14 @@ if has('wildmenu') set wildmenu endif +function! s:goyo_enter() + Limelight +endfunction + +function! s:goyo_leave() + Limelight! +endfunction + " Customise colour schemes. Keep this near the end. if &background ==# 'light' highlight SpecialKey ctermfg=lightgray ctermbg=NONE