Search code examples
visual-studiovimcoding-stylehighlighting

Structural Highlighting in Vim


I have seem some cool Structural Highlighting in Visual Studio (might be using CodeKana). Can I achieve same type of Structural Highlighting in vim ? For any language. I am a python developer I would love to have it for Python. alt text


Solution

  • You can almost emulate this via listchars by using hard tabstops instead of spaces for indentation.

    Something like this should suffice:

    set noexpandtab
    set list
    set listchars=tab:\| 
    

    Note that there is a space after the | character.

    You can pick a better character to get a connected line, but this is just an example. Also note that this will not continue the lines with no indentation, so you may end up with something like:

    if foo:
    |   bar
    
    |   baz
    

    ...unless you add a tab on the blank line.