Created
January 31, 2013 06:57
-
-
Save f0i/4680890 to your computer and use it in GitHub Desktop.
Highlight loops based on indention in vim
This file contains 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
highlight loop1 ctermbg=233 | |
highlight loop2 ctermbg=235 | |
highlight loop3 ctermbg=237 | |
let g:showtree=0 | |
function! TreeView() | |
if (g:showtree == 0) | |
let g:showtree=1 | |
match loop1 "^ .*$\|\(^ \)\@<= .*$" | |
2match loop2 "\(^ \)\@<= [^\ ].*$\|\(^ \)\@<= \|\(^ \)\@<= .*$" | |
3match loop3 "\(^ \)\@<= [^\ ].*$\|\(^ \)\@<= \|\(^ \)\@<= .*$" | |
else | |
let g:showtree=0 | |
match none | |
2match none | |
3match none | |
endif | |
endfunction | |
map <F5> :call TreeView()<CR> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Replaced with https://github.com/nathanaelkane/vim-indent-guides