Changing AWK indent behavior in VIM 7.
- From: gazelle@xxxxxxxxxxxxxxxxxxxxx (Kenny McCormack)
- Date: Sun, 15 Apr 2007 18:29:26 +0000 (UTC)
I recently upgraded to VIM 7. It was a "voluntary" upgrade and there
are some nice features that attracted me. However, one thing that is
annoying is the way it handles autoindent when writing AWK code.
Previously, it "just worked". What I think happened is that TPTB
decided to take the cindent conventions and extend them to other non-C,
but C-like languages (e.g., AWK). Now, in one sense, this could be a
good thing, but my conventions for writing code are different that what
TPTB think is standard. I've never liked the way VIM does C indenting,
but since I rarely write C, it hasn't been a problem. But now, they've
gone and screwed up the way it does AWK. Obviously, I'm looking for a
way to turn off the behavior/get things back to normal.
The problem is that it doesn't indent correctly. Or, to put it another
way, it is *too* familiar with the syntax of the language. Sometimes it
gets it right, but mostly, it gets it wrong. For example, if my cursor
is on:
if (...)
and hit o, I want the cursor to go to beneath the "i" in if. Now, it
moves me in a tab stop. This is relatively innocuous, but the next one
is a real PIA: Suppose I have:
BEGIN {
line1ThatStartsWithaTab
line2ThatStartsWithaTab
with my cursor on "line 1". I hit O to open a line above it and it puts
the cursor below the N in BEGIN. Clearly, hosed. Clearly, simple rules
of autoindent say that it should fill the line with a tab and leave the
cursor just above line1.
Now, I know that some of this is a function of my vimrc settings,
specifically, sw and ts. And I know my settings will not meet with
universal appeal, but that's not the point. The point is, it used to
work fine, and I'm pretty sure there is some setting I can tweak to make
it work normally again. Can anyone tell me what that setting is?
.
- Follow-Ups:
- Re: Changing AWK indent behavior in VIM 7.
- From: Jean-Rene David
- Re: Changing AWK indent behavior in VIM 7.
- Prev by Date: Anybody tried AnsiEsc.vba on GVim 7.0.182?
- Next by Date: Re: search multiple lines
- Previous by thread: Anybody tried AnsiEsc.vba on GVim 7.0.182?
- Next by thread: Re: Changing AWK indent behavior in VIM 7.
- Index(es):
Relevant Pages
|