Unlike A
, @
or space, tabulations are not "real" characters with a defined glyph and defined metrics and whatnot. When you insert a "tab" you tell your text editor this:
I want the next character to be displayed at most n
spaces from here.
n
being the value of tabstop
or softtabstop
.
In the following example, [ ]
represent a 4 spaces wide tabulation:
[ ][ ][ ][ ][ ][ ][ ][ ]...
lorem ipsum dolor sit amet no tab
lorem ipsum dolor sit amet tab before lorem
lorem ipsum dolor sit amet tab before ipsum
lorem ipsum dolor sit amet tab before dolor
lorem ipsum dolor sit amet tab before sit
lorem ipsum dolor sit amet tab before amet
Note how each tab appears to have a different width; 4, 2, 4, 2 and 2. That's because tabulations are here to help you align your text: n. No matter the content, you can be certain that inserting a "tab" will push the rest of the line to the next tabstop, which will always be at most 8 (or whatever value you chose) characters to the right.
Now, the value you chose for listchars
:
tab:►-
tells vim to materialize tabulations with a ►
followed by zero or more -
, up to &tabstop - 1
. With your settings, tabulations can take any of the forms below:
►
►-
►--
►---
In the sample above...
[ ][ ][ ][ ][ ][ ][ ][ ]...
lorem ipsum dolor sit amet no tab
►---lorem ipsum dolor sit amet tab before lorem
lorem ►-ipsum dolor sit amet tab before ipsum
lorem ipsum ►---dolor sit amet tab before dolor
lorem ipsum dolor ►-sit amet tab before sit
lorem ipsum dolor sit ►-amet tab before amet
In short, everything is A-OK and the behavior you get is exactly the same you should get in any other text editor or word processor.