The solution is below:
function HighlightEvery(lineNumber, lineEnd) highlight myhighlightpattern ctermbg=darkred guibg=darkred let pattern="/" let i = 0 while i < a:lineEnd let i += a:lineNumber let pattern .= "\\%" . i . "l\\|" endwhile let pattern .= "\\%0l/" let commandToExecute = "match myhighlightpattern ".pattern execute commandToExecute endfunction command -nargs=* Highlightevery call HighlightEvery(<f-args>)
Add the code to your .vimrc,
and call
:Highlightevery 10 1000
selects every 10 lines in line 1000.
source share