Why does vim move me to the begining of a line when I press # for a comment or remark say in a perl file?
Why would I not want my comment to be indented at the same level of the current code?
|
feedback
|
This question came from our site for professional and enthusiast programmers.
|
Ensure that the following are set in your .vimrc:
If you are using the "smartindent" indenting option, a fix for your problem is explained in the
| |||
|
feedback
|
|
I think it is confused and thinks you are editting a C file, where preprocessor directives must be against the left margin. | |||
|
feedback
|
did not work for me, here is what did:
The drawback to this solution is that if you are not on an indent column it will snap you to one. If your code is indented properly it should not be a problem. | ||||
|
feedback
|
#in insert mode, or are you using a mapping to comment the line? – Prince Goulash Jul 6 '11 at 12:43