2

I'd like (g)Vim to draw a pipe symbol | on each 4th space of indentation to show something like vertical indentation 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

ib.
  • 27,830
  • 11
  • 80
  • 100
  • Does this answer your question? [Is it possible to display indentation guides in Vim?](https://stackoverflow.com/questions/2158305/is-it-possible-to-display-indentation-guides-in-vim) – Zoe Apr 05 '21 at 17:45

2 Answers2

2

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.

ib.
  • 27,830
  • 11
  • 80
  • 100
1

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.

ib.
  • 27,830
  • 11
  • 80
  • 100
Yggdroot
  • 499
  • 4
  • 6
  • 4
    Thanks for posting your answer! Please be sure to read the [FAQ on Self-Promotion](http://stackoverflow.com/faq#promotion) carefully. Also note that it is *required* that you post a disclaimer every time you link to your own site/product. – Andrew Barber Dec 06 '12 at 02:54