I just created this for my: Man. It tracks the current item in the locationlist window when navigating:
function! s:visibleLoc() return len(filter(getwininfo(), {i,v -> v.loclist})) endfunc function! s:followLine() let curLine = line(".") if (exists("b:lastLine") && b:lastLine == curLine) || 0 == s:visibleLoc() return endif let b:lastLine = line(".") let ent = len(filter(getloclist("."), {i,v -> v.lnum <= curLine})) if ent < 1 || (exists("b:lastEntry") && b:lastEntry == ent) return endif let b:lastEntry = ent let pos = [ 0, curLine, col("."), 0 ] exe "ll ".ent call setpos(".", pos) endfunc au CursorMoved <buffer> call <SID>followLine()
source share