On 2012-01-30, AK wrote:
> Hi, when editing code, my vim setup indents next line to align with a
> brace from line above, e.g.:
>
> myvariable_name = (
> |)
>
> But if I manually backspace the line to be closer to start of line:
>
> myvariable_name = (
> x = "something",
> |)
>
> On carriage return the alignment is still at the brace level. So I need
> to fix it manually again. How can I avoid having to do that? I still
> would like to keep auto-alignment when I don't fix the line manually.
I took a _quick_ look at this but was unable to replicate the
problem. If I set 'cindent' and type your second example, I get
this:
myvariable_name = (
x = "something",
)
where Vim aligned that closing parenthesis as shown.
This behavior will depend on the various indent settings. What
language are you using? Are you using an indent plugin? What are
these values:
:verbose set cindent? cinoptions? indentexpr?
By the way, () are parentheses, not braces. Braces are {} and
brackets are [].
Regards,
Gary
--
You received this message from the "vim_use" 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