1

I use Vim 7.4.2149 and the plugin pangloss/vim-javascript for js indentation. I need to get comments like:

/*
 *
 */

But instead I get:

/*
     *
     *
     */

I'm not really interested in syntax so I use:

syntax off

and I tried these settings:

formatoptions=croql
comments=s1:/*,mb:*,ex:*/

What should I do to get the comment formatting I'm looking for.

6
  • When default indentation is used ie without plugin, I get the comment formatting I'm looking for.
    – user101285
    Aug 5, 2016 at 8:35
  • You don't need a plugin to indent and fold JavaScript. :set autoindent, and ^T and ^D works well for most languages. Or :set softtabstop=4 backspace+=indent if you don't like ^T and ^D. :set foldmethod=marker foldmarker={,} works well enough for folding (template literals aren't really a big deal). If you don't want syntax, job done.
    – Antony
    Aug 5, 2016 at 9:26
  • Not the answer but autoindent is not that good.
    – user101285
    Aug 5, 2016 at 9:31
  • vim-javascript has so far had 149 issues relating to indentation. 150 if you count this one. I'll stick with 'autoindent'.
    – Antony
    Aug 5, 2016 at 10:39
  • It looks like there was a fix for this just a few days ago. At least, that's what I think from the commit message. Make sure you've got the latest version of vim-javascript. You can also make sure this problem isn't caused by something in your vimrc. If that doesn't fix the problem I suggest you open an issue on their bug tracker, as this is obviously a bug. Aug 8, 2016 at 2:13

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.