On Thu, Sep 15, 2011 at 3:51 PM, Donald Allen <donaldcal...@gmail.com> wrote:
> If you have following in a vim buffer, file named, say, foo.awk
>
> /some test/ {
> if (foo != "bar") {
> if (baz != ""){
> array1[xyz] = N
> if (N > max_N) max_N = N
> }
> xyz = temp[1]
> # Create
> print "," > "something.sql"
> split(description,temp,parse_descriptions[file])
> print "\t-- "temp[1] > "something.sql"
> printf "\t%s %s", xyz, pg_type > "something.sql"
> # Load
> insert = insert",\n\t"xyz
> fields[M]=xyz
> M++
> N = 1
> }
> field_to_XX_field[xyz,N] = field
> N++
> }
>
> position the cursor on the '{' that ends the first line. Then do =%. You get

[...]

I guess that the R indent script may work better for awk code. The awk
script was my starting point to develop the R one. Could you please
set the file type as "r" before indenting the code and tell us whether
the indentation becomes correct? As you certainly know, to set the
file type you should do:

:set ft=r

Note: Bram added the indent/r.vim to Vim's runtime recently (today, I think).

Best regards,

Jakson Aquino

-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Raspunde prin e-mail lui