开发者

Does Vim have indentation guides, Notepad++-style?

开发者 https://www.devze.com 2023-02-04 13:30 出处:网络
In Notepad+开发者_JAVA技巧+, there is a dotted line that runs down from the function keyword through the end of the method. It looks like this:

In Notepad+开发者_JAVA技巧+, there is a dotted line that runs down from the function keyword through the end of the method. It looks like this:

Does Vim have indentation guides, Notepad++-style?

Does Vim support something similar?


You can take a look at "Indent Guides : A plugin for visually displaying indent levels in gvim" here http://www.vim.org/scripts/script.php?script_id=3361

Screenshots: http://nathanaelkane.imgur.com/indent_guides


Not that I know, but you can :set cursorcolumn to highlight all characters on the same column as your cursor.

To go to the beginning of a function or a scoped block, you can hit [m or [{, respectively. Then % will jump to the other end of the block.


You can also just use tabs for indentation and display them visually with the line

"Attention:
"There is an invisible space at the end of the line.
"This space is required.
set list lcs=tab:\|\ 

The plus side of this method is, that you can easily tell tabs and spaces apart.

Personally, I prefer using the unicode center dot character (set list lcs=tab:\·\) instead of the pipe symbol, but the pipe symbol is closer to the Notepad++ optic.


It is possible to emulate something like that using match-highlighting. I have explained the technique in detail in my answer to another question regarding indentation guides.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号