Hi Linus, Gary, and Brian,
Hi Folks,
When I comment out a line, vim left justifies the
line, but I want the
indentation to say exactly where it is! Does anybody now when vim setting is
responsible for either
1) Causing the shifty left justification of comments, so I can delete it
2) Suppresses this shifty left justification that is maybe part of some other
setting, which maybe does things I want.
Well, the mystery is partly solved. The VIM setting that I need to fix is apparently
"SmartIndent":
Do smart autoindenting when starting a new line. Works for C-like
programs, but can also be used for other languages. 'cindent' does
something like this, works better in most cases, but is more strict,
see |C-indenting|. When 'cindent' is on or 'indentexpr' is set,
setting 'si' has no effect. 'indentexpr' is a more advanced
alternative.
Normally 'autoindent' should also be on when using 'smartindent'.
An indent is automatically inserted:
- After a line ending in '{'.
- After a line starting with a keyword from 'cinwords'.
- Before a line starting with '}' (only with the "O" command).
When typing '}' as the first character in a new line, that line is
given the same indent as the matching '{'.
When typing '#' as the first character in a new line, the indent for
that line is removed, the '#' is put in the first column. The indent
is restored for the next line. If you don't want this, use this
mapping: ":inoremap # X^H#", where ^H is entered with CTRL-V CTRL-H.
When using the ">>" command, lines starting with '#' are not
shifted
right.
NOTE: This option is reset when 'compatible' is set.
This option is reset when 'paste' is set and restored when 'paste' is
reset.
And look at that! The solution is right there! Only I can't get it to work. I just
goes merrily along putting hashes in the first column! Maybe the easiest solution is to
map a key to "s/^#/^I#/"
Thanks for the help,
--
Chris.
V:916.799.9461
F:916.974.0428
A: Because we read from top to bottom, left to right.
Q: > Why should I start my reply below the quoted text?