Wednesday, January 25, 2017

Re: How to make the curly brace on the same line when press enter between them ?

On 2017-01-25, Zhe Lee wrote:
> On Thursday, January 26, 2017 at 4:23:09 AM UTC+8, Tony Mechelynck wrote:
> > On Wed, Jan 25, 2017 at 7:11 PM, Zhe Lee wrote:
> > > here is the thing:
> > > {|}, | is my curve when I press enter now the curly braces will not on the same line.
> > > How to fix it?
> > >
> >
> > If you mean they are not in the same (vertical) _column_ then I'm not
> > sure; it may or may not be possible, check in particular the options
> > containing "indent" (:help '*indent*' but hit Ctrl-D instead of Enter,
> > then hit Tab until you come to an entry that looks promising).
> >
> > OTOH, if what worries you is really that they aren't on the same
> > (horizontal) _line_ then the answer is simple: Dont hit Enter between
> > them, but possibly the space bar, the Tab key, or even nothing. Or
> > type them both one after the other, then hit Left-Arrow to bring the
> > cursor back between them.
> >
> > Best regards,
> > Tony.
>
> I mean that when the cursor is between a pair of curly braces(the
> curly braces just at the beginning of the line), press enter now
> the right brace should be at the start of a newline, but it seems
> add a `tab` first and then insert the } at the new line.

That behavior is controlled by the indent settings made in your
~/.vimrc or in the indent plugin for the file type you are editing.
What do you see when you execute this?

:verbose ft? cindent? cinoptions? indentexpr?

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

---
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: