I came across this question:
https://softwareengineering.stackexchange.com/questions/87077/how-can-a-code-editor-effectively-hint-at-code-nesting-level-without-using-inde
and thought that Vim might be able to do something similar as well with a plugin.
I believe the indentation level could be indicated with the a sign (icon in GUI, text with highlighting in term). The piece I’m not sure about is displaying the lines without indentation. Does anyone know, is it possible and/or how you would do it?
This question is not whether or not displaying indentation levels in this manner is desirable; but how to accomplish it in Vim.
You could use the
concealfeature that is new in 7.3.Here is a function that does roughly what the article is describing (for spaces; accounting for tabs instead would be a fairly trivial addition):
A solution closer to what you are requesting might use
concealto hide all leading whitespace withsyntax match NonText "^\s\+" conceal
and then use
signsto provide the indicators based on custom calculations.Note:
NonTextin these syntax commands is an arbitrary highlight group.