Last active
May 25, 2020 21:32
-
-
Save phelipetls/17e03932bafc85f85b8840bf0f5861f7 to your computer and use it in GitHub Desktop.
Highlight a line with signs in Vim
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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