[TriLUG] Vim '#' character issues
Brian Weaver
cmdrclueless at gmail.com
Thu Feb 2 11:12:39 EST 2006
After much more searching I found something that seems to work...
"Hack to prevent # character from moving to 1st column
" This mapping effectively causes 3 characters to be inserted whenever you
" type the '#' key. Space, Backspace, and finally '#'. This seems to foil the
" automatic reindent for the # character
"
inoremap # <Space><BS>#
-Brian
On 2/2/06, Brian Weaver <cmdrclueless at gmail.com> wrote:
> Actually, it's probably:
>
> http://www.vim.org/htmldoc/options.html#'cinkeys'
>
> The only thing that's bothering me is that 'cinkeys' is not set and
> it's not a c-program. Is the cinkeys or indentkeys always active?
>
>
>
> On 2/2/06, Shane O'Donnell <shaneodonnell at gmail.com> wrote:
> > You're likely running into "cindent" or "smartindent"...
> >
> > http://www.vim.org/htmldoc/indent.html
> >
> > Set in your .vimrc or at the ":" prompt per session.
> >
> > And then take a moment to enjoy the fact you aren't using emacs...
> >
> > Shane O.
> >
> > On 2/2/06, Brian Weaver <cmdrclueless at gmail.com> 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
> > > --
> > > TriLUG mailing list : http://www.trilug.org/mailman/listinfo/trilug
> > > TriLUG Organizational FAQ : http://trilug.org/faq/
> > > TriLUG Member Services FAQ : http://members.trilug.org/services_faq/
> > >
> >
> >
> > --
> > Shane O.
> > ========
> > Shane O'Donnell
> > shaneodonnell at gmail.com
> > ====================
> > --
> > TriLUG mailing list : http://www.trilug.org/mailman/listinfo/trilug
> > TriLUG Organizational FAQ : http://trilug.org/faq/
> > TriLUG Member Services FAQ : http://members.trilug.org/services_faq/
> >
>
More information about the TriLUG
mailing list