[TriLUG] Vim '#' character issues

Owen Berry oberry at trilug.org
Thu Feb 2 12:34:18 EST 2006


I'm wondering if it's your settings for 'comments' or 'formatoptions'.
Here are mine when editing a Perl file:

comments=:#
formatoptions=tcrq

The options are fairly exhaustive, so I won't try to guess what you
could have, but if you can't figure out what's wrong with your settings,
maybe you can post the result of :set from within vim.

Owen

On Thu, Feb 02, 2006 at 10:26:04AM -0500, Brian Weaver wrote:
> I need some sage advice from any VIM experts out there. I *once* knew
> how to prevent vim from reindenting lines that started with the '#'
> character. I've lost that small bit of knowledge and now it's driving
> me nuts. Doesn't matter what I'm editing: perl, python, shell, etc. If
> I want to start and continue a comment at the current indentation
> level in a script, whenever I type the first '#' character vim
> magically resets the column to 1.
> 
> I cannot seem to find any key mapping that prevents this from
> happening. If when I start a new line I first type
> '<space>-<backspace>-#' then it stays in the correct column.
> 
> I've used vim for years and love it, but this particular annoyance is
> very remincent of something M$ would do..... "I don't care what you
> want, I know better than you! so I'm going to put the # character in
> the first column! PBBBbbbbt!"
> 
> Google has been very little help on the matter. Google does great when
> you want to search on whole words, but it falls flat on it's face when
> you need to search on a something with funny characters like #, @, $,
> &, etc...
> 
> -Brian



More information about the TriLUG mailing list