Skip to content

Instantly share code, notes, and snippets.

@mattboehm
Last active January 6, 2024 07:25
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattboehm/7109927 to your computer and use it in GitHub Desktop.
Save mattboehm/7109927 to your computer and use it in GitHub Desktop.
Highlighting lines in vim
"with your cursor on a line or a block selected, type `:HL`
"to remove, on each line call :sign unplace
highlight HL ctermbg=darkgray
sign define hl linehl=HL
let s:highlightLineSignId = 74000
function! g:HighlightLine()
execute 'sign place' s:highlightLineSignId 'line='.line(".") 'name=hl' 'file='.expand("%")
let s:highlightLineSignId += 1
endfunction
command! HL call g:HighlightLine()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment