14

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

Notepad++ indentation guide example

Does Vim support something similar?

ib.
  • 27,830
  • 11
  • 80
  • 100
Apotheosis
  • 151
  • 3

4 Answers4

24

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

grimgav
  • 1,421
  • 11
  • 5
1

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.

ib.
  • 27,830
  • 11
  • 80
  • 100
Benoit
  • 76,634
  • 23
  • 210
  • 236
  • You may also want to do ":nnoremap %" in order to use the more accessible Tab key. –  Jan 14 '11 at 14:24
0

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.

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

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.

cmaster - reinstate monica
  • 38,891
  • 9
  • 62
  • 106