开发者

How to draw a vertical bar on every 4th space in Vim?

I'd like (g)Vim to draw a pipe symbol | on each 4th space of indentation to show something like vertical indentati开发者_StackOverflowon line.

I found this plugin: http://vim.sourceforge.net/scripts/script.php?script_id=628, but it works only with tab characters, and I'm using spaces for indentation.

My .vimrc contains:

set ts=4
set sw=4
set expandtab 
set softtabstop=4 

Thanks for help


One could simply highlight every fourth space. Although it might look a bit hackish, is is simpler and quite effective. Please take a look at my answer to the question “Is it possible to display indentation guides in Vim?” where I lay out the technique in full detail.


You can try using my plugin: https://github.com/Yggdroot/indentLine.

It completely satisfies your requirements. It displays a thin vertical line, and not a fat vertical line like http://www.vim.org/scripts/script.php?script_id=3361.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜