Created
April 29, 2022 15:31
-
-
Save trapd00r/d2399ae49059a8da138b2c3ef203192f to your computer and use it in GitHub Desktop.
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
" display a visual aid when lining long things up | |
" disable colorcolumn entirely if | |
" - cursor is in the first column | |
" - cursor is in the same column that &colorcolumn is set to | |
function! ColorColumnAtCursorPositionToggle() | |
let column = col('.') | |
if exists(&colorcolumn) || column == 1 || column == &colorcolumn | |
set colorcolumn& | |
else | |
let &colorcolumn = column | |
echohl ModeMsg | |
echo 'Colorcolumn set at column ' . column | |
echohl None | |
endif | |
endfunction |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment