Skip to content

Instantly share code, notes, and snippets.

@phelipetls
Last active May 25, 2020 21:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phelipetls/17e03932bafc85f85b8840bf0f5861f7 to your computer and use it in GitHub Desktop.
Save phelipetls/17e03932bafc85f85b8840bf0f5861f7 to your computer and use it in GitHub Desktop.
Highlight a line with signs in Vim
hi cellDelimiterHi ctermbg=8 ctermfg=0
sign define cellLine linehl=cellDelimiterHi
function! HighlightCellDelimiter()
execute "sign unplace * group=cellsDelimiter file=".expand("%")
for l:lnum in range(line("w0"), line("w$"))
if getline(l:lnum) =~ "^#%%$"
execute "sign place ".l:lnum." line=".l:lnum." name=cellLine group=cellsDelimiter file=".expand("%")
endif
endfor
endfunction
" uncomment to call to update signs when cursor moves in python files
" autocmd! CursorMoved *.py call HighlightCellDelimiter()
" uncomment to remove sign column
" set signcolumn=no
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment