LisztLi
LisztLi

Reputation: 242

How to indent the function parameters after an open parenthesis in js file correctly using VIM?

When I'm writing a invoke with long parameters, e.g.

foo_bar(foo,
bar);

The web-indent plugin will format the js files to:

foo_bar(foo,
<tab>bar;

But what I want is:

foo_bar(foo,
        bar);

Already searched vim.org, seems no easy solutian.

Any idea?

Upvotes: 2

Views: 340

Answers (1)

Randy Morris
Randy Morris

Reputation: 40947

With a little bit of testing it looks like you probably want to set cinoptions+=(0. This seems to work for the simple case but there may be some edge cases that you'd have to handle with the other cinoptions.

See :help cinoptions and :help cinoptions-values for more info.

Upvotes: 3

Related Questions