cinoptions

56 views
Skip to first unread message

Mark Volkmann

unread,
Nov 16, 2014, 5:13:47 PM11/16/14
to v...@vim.org, me at Gmail
I want to set cinoptions so the following JavaScript function gets the indentation shown.

function foo(a, b,
  c, d) {
  return (a + b) / (c + d);
}

Setting cinoptions to (1s gets me close, but the last two lines get indented by one extra shiftwidth. I want the indentation of lines 3 and 4 to be based on the beginning of the function on line 1, not the opening brace on line 2. Is this possible?

--
R. Mark Volkmann
Object Computing, Inc.

Gary Johnson

unread,
Nov 16, 2014, 10:38:18 PM11/16/14
to vim...@googlegroups.com
When I

:set cinoptions=(1s

I get your desired result. Do you have some other 'cinoptions'
value(s) set as well?

Regards,
Gary

Mark Volkmann

unread,
Nov 17, 2014, 12:22:09 PM11/17/14
to vim...@googlegroups.com, gary...@spocom.com
This is really weird! It is working the way I want on one Mac, but not on another. On both machines I can enter :set cinoptions in Vim and they both output this:
cinoptions=(1s,j1,J1

I don't know why I'm getting different results on the two machines.

I only set cinoptions to (1s in my .vimrc. I don't know where the j1,J1 part is coming from.

Christian Brabandt

unread,
Nov 17, 2014, 12:26:46 PM11/17/14
to vim...@googlegroups.com
Am 2014-11-17 18:22, schrieb Mark Volkmann:

> This is really weird! It is working the way I want on one Mac, but not
> on another. On both machines I can enter :set cinoptions in Vim and
> they both output this:
> cinoptions=(1s,j1,J1
>
> I don't know why I'm getting different results on the two machines.
>
> I only set cinoptions to (1s in my .vimrc. I don't know where the
> j1,J1 part is coming from.

Make sure to also check the patchlevel.

Best,
Christian

Ethan Hereth

unread,
Nov 17, 2014, 12:27:46 PM11/17/14
to vim...@googlegroups.com
run the command ':verbose set cinoptions' to see where it is last set. There is probably a plugin that is setting it after you do. 

--
--
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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mark Volkmann

unread,
Nov 17, 2014, 12:54:17 PM11/17/14
to vim...@googlegroups.com
Thanks Christian and Ethan! I was running a slightly different version of Vim on each machine. I updated the one that wasn't working the way I expected using homebrew and now it works!

You received this message because you are subscribed to a topic in the Google Groups "vim_use" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vim_use/GI-9SFISQIs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to vim_use+u...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages