I sometimes need to do some remarks in parentheses in my commit message's detailed part. But when the parenthesized text comes to the rightmost column and is line-broken, the next line for some reason begins from the column after the opening parenthesis. See the screenshot below.


So, what's going on here? Why does it happen, and how can I make wrapping continue from the first column?

  • Can you check the output of set lisp? – D. Ben Knoble Sep 30 '19 at 17:10
  • @D.BenKnoble no output, the command simply remains there after I press Enter (as with other set XXX commands). – Ruslan Sep 30 '19 at 17:18
  • 1
    @Ruslan When you add a question mark to the end of a :set command it queries the current value of the option. – Rich Sep 30 '19 at 17:21
  • Yes, the question mark should have been part of the command – D. Ben Knoble Sep 30 '19 at 17:22
  • 1
    What is the output of set cindent? and set cinoptions? ? I could reproduce it with cindent set and cinoptions containing (N. – Ralf Sep 30 '19 at 19:35

As stated in your comment you have cindent and cinoptions set like:

set cindent
set cinoptions=N-s,g0,:0,(0

The options cindent should only be set for the file types you want to use it. It is set automatically for the C or CPP file types (assuming you have filetype indent on in your vimrc [or better: filetype plugin indent on]).

Remove the line set cindent from your vimrc.

BTW: If you want to change filetype specific settings I recommend to work with a file in ~/.vim/after/ftplugin (e.g. ~/.vim/after/ftplugin/c.vim to change settings for the C filetype). See :help ftplugin-overrule, especially point 3.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.