Skip to content

Instantly share code, notes, and snippets.

@dahu
Created July 6, 2015 05:21
Show Gist options
  • Save dahu/6ff4de11ca9c5bb25902 to your computer and use it in GitHub Desktop.
Save dahu/6ff4de11ca9c5bb25902 to your computer and use it in GitHub Desktop.
Use colorcolumn as a poor-man's indent indicator in vim
" toggle colorcolumn
" at cursor (mnemonic: indicate cursor)
nnoremap <leader>ic :exe 'set cc'.(&cc =~ virtcol('.')?'-=':'+=').virtcol('.')<cr>
" at start of line (mnemonic: indicate indent)
nnoremap <leader>ii :exe "normal m`^\<leader>ic``"<cr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment