junegunn / limelight.vim

:flashlight: All the world's indeed a stage and we are merely players

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support for cursorbind

isovector opened this issue · comments

Is it possible for a cursorbound window to work in limelight mode? I'm making transformations in one file given an example of a transformation in another. Currently limelight only updates when I switch to the reference window.

function! s:sync_limelight(bang)
  execute 'Limelight'.a:bang
  augroup sync_limelight
    autocmd!
    if empty(a:bang)
      autocmd CursorMoved * wincmd p | doautocmd limelight CursorMoved | wincmd p
    endif
  augroup END
endfunction

command! -bang SyncLimelight call s:sync_limelight('<bang>')

This is hacky, but it seems to work.

Fantastic! Works like a charm. Thanks!