StarWing (2008-12-25 04:11 -0800) wrote:

> very simple, just set cindent in your c.vim in your ftplugin folder.
> autoindent is different from cindent.

Unfortunately it's not that simple. When writing the code it may produce
correct code:

    if { 0 } {
        set foo bar
        if {1} {
            puts "by"
            if {1} {
                puts "hi"
            }
        }
        set foo bar
    }

But after the first indent command (the = operator) the indentation
becomes:

    if { 0 } {
        set foo bar
        if {1} {
            puts "by"
            if {1} {
                puts "hi"
        }
    }
    set foo bar
    }

After the second = command it becomes:

    if { 0 } {
        set foo bar
        if {1} {
            puts "by"
            if {1} {
                puts "hi"
    }
    }
    set foo bar
    }

So the TCL indentation code shipped with Vim is not quite optimal.

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to