dotfiles

My personal shell configs and stuff
git clone git://git.alex.balgavy.eu/dotfiles.git
Log | Files | Refs | Submodules | README | LICENSE

goyo_custom.vim (1190B)


      1 " Unfortunately I had to do this in a super convoluted way, because of the way statusline is refreshed
      2 function! goyo_custom#set_wordcount()
      3   let g:goyo_wordcount = wordcount().words
      4 endfunction
      5 function! goyo_custom#update_ruler()
      6   call goyo_custom#set_wordcount()
      7   " Adding the call to wordcount() here didn't work, so had to use a helper variable
      8   setlocal rulerformat=%20(%{g:goyo_wordcount}\ words%=\ %{strftime(\"%H:%M\")}%)
      9 endfunction
     10 function! goyo_custom#modify_hlgroups()
     11   hi! spellbad gui=underline cterm=underline
     12   hi! spellcap gui=underline cterm=underline
     13 endfunction
     14 function! goyo_custom#goyo_enter()
     15   call goyo_custom#update_ruler()
     16   setlocal textwidth=0 wrapmargin=0 wrap linebreak spell scrolloff=0
     17   call goyo_custom#modify_hlgroups()
     18   setlocal ruler
     19   autocmd BufEnter,BufReadPost,BufWritePost,TextChanged,TextChangedI * call goyo_custom#update_ruler()
     20   Limelight
     21 endfunction
     22 function! goyo_custom#goyo_leave()
     23   setlocal textwidth< wrapmargin< linebreak< wrap< rulerformat< ruler< spell< scrolloff
     24   autocmd! BufEnter,BufReadPost,BufWritePost,TextChanged,TextChangedI
     25   execute "colorscheme ".g:colors_name
     26   unlet g:goyo_wordcount
     27   Limelight!
     28 endfunction