vim-indent-guides
vim-indent-guides copied to clipboard
Do not guide indentions below length x
Sometimes I have code that is just a few lines long so it would be nice to have the option to set a minimal indention-length.
E.g.:
class ClassExample
def example
return 0
end
def example2
puts ex
puts 0
puts test
end
end
example and example2 are extremely short an guided indentions don't look nice - also they're distracting.
This may looks similar to Issue #39, but it isn't - though that would be nice too.
You mean this isn't just using this setting?
let g:indent_guides_start_level = 3
No, that setting would define that guiding starts at the third tab (sticking to your example). I'll make my point clearer:
Think of the dashes as the highlighning:
class ClassExample
- def example
- - return 0
- end
- def example2
- - puts ex
- - puts 0
- - puts test
- end
- def example3
- - puts some more
- - puts 1+1
- - puts some
- - puts some
- - puts some
- - puts some
- end
end
This is how it looks like currently, but I suggested a setting, e.g.
g:indent_guides_start_minlines =
class ClassExample
- def example
- return 0
- end
- def example2
- puts ex
- puts 0
- puts test
- end
- def example3
- - puts some more
- - puts 1+1
- - puts some
- - puts some
- - puts some
- - puts some
- end
end
Since the number of lines to be highlighted have to more or equal to 5 - example and example2 don't meet this requirement, example3 (since it is six lines long) does and thus get's guided.
oh. That's more clear. and somewhat interesting.
My first thought is to be against it because it's inconsistent.
If you want to make the change, I cannot recommend much with my vimscript-fu at this time. The change you want (count lines, act after some init var number of lines) probably goes here
I'd love this feature, personally, but would have it set to a value of 2 for myself. more than 2 lines, I'd want hilighted.