Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Vim Indentation Guides Emulation
nmap <silent> <leader><bar> :call ToggleIndentGuidesTabs()<cr>
nmap <silent> <leader><bslash> :call ToggleIndentGuidesSpaces()<cr>
function! ToggleIndentGuidesTabs()
if exists('b:iguides_tabs')
setlocal nolist
let &l:listchars = b:iguides_tabs
unlet b:iguides_tabs
else
let b:iguides_tabs = &l:listchars
setlocal listchars=tab:\ "protect the space
setlocal list
endif
endfunction
function! ToggleIndentGuidesSpaces()
if exists('b:iguides_spaces')
call matchdelete(b:iguides_spaces)
unlet b:iguides_spaces
else
let pos = range(1, &l:textwidth, &l:shiftwidth)
call map(pos, '"\\%" . v:val . "v"')
let pat = '\%(\_^\s*\)\@<=\%(' . join(pos, '\|') . '\)\s'
let b:iguides_spaces = matchadd('CursorLine', pat)
endif
endfunction
@zhouzhuojie

Could you show a screenshot about it?

@iburago
Owner
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.