You are not logged in.
Pages: 1
I know this isn't strictly a programming problem, but bear with me...
To make a long story short, I have a Perl file in which some comment lines start with the hash(#) as the first character of the line, i.e. before the # there's nothing, not even spaces. The problem is that trying to indent this line with == does not work. Now, with my current vim setup, when *insert* a new line that starts with an #, indentation is done properly. Also, if there is space before the #, but the indentation is wrong, == correctly indents it. The problem is when the # is the very first character of the line, and (it goes without saying) the indentation is wrong, == does nothing.
I've googled and read all about disabling smartindent, cindent, and whatnot, and nothing seems to work. I'm really grasping at the straws with this one, so all ideas are welcome...
Last edited by gauthma (2010-10-26 16:22:11)
Offline
For future reference of whomever might encouter this problem... the file /usr/share/vim/vim73/indent/perl.vim has, in line 55 and following, the, erm, following:
" Don't reindent coments on first column
if cline =~ '^#.'
return 0
endif
Commenting those out solved the problem. Of course I now wonder why would those lines be there in the first place, but I digress...
Offline
Pages: 1