2

How can I make continuation lines indent 1 tab instead of align with the some text? With the default cindent options, I get the following:

static int A = 0,
           B = 0,
           C = 0;

But, what I want is

static int A = 0,
    B = 0,
    C = 0;

I have gone through all the cino settings, and none of them seem to affect this. What am I missing?

  • Why not join first 2 lines. – dedowsdi Apr 12 at 2:22
  • Thank you for your response. I prefer to keep them on separate lines because I tend to put comments beside each of the variables. – Spiffidimus Apr 14 at 13:42
  • 1
    I was talking int and A = 0, you can still comment besides each variables. – dedowsdi Apr 14 at 14:09
  • I see. Thank you. Because of your comment, I have been able to clarify my question. – Spiffidimus Apr 14 at 23:37
  • 1
    C style indentation is really a drag in vim. There are a couple of ways to set up the indentation. But it's all a little too much work to justify the return. I would advise you to use :h copyindent and do manual indenting on some lines that can't be indented with copyindent. And here is another question similar to your problem. It might help you understand some basic things. – klaus Apr 15 at 3:09

Your Answer

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

Browse other questions tagged or ask your own question.