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.

Martin Tournoij
  • 62,054
  • 25
  • 192
  • 271
user101285
  • 11
  • 1
  • When default indentation is used ie without plugin, I get the comment formatting I'm looking for. – user101285 Aug 05 '16 at 08: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 05 '16 at 09:26
  • Not the answer but autoindent is not that good. – user101285 Aug 05 '16 at 09: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 05 '16 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. – Martin Tournoij Aug 08 '16 at 02:13
  • I tried loading the vim with vim -u NONE -U NONE -N. Problem still persist. I tried it on vim-7.4.2243. In this version they included the indent file of pangloss. – user101285 Aug 23 '16 at 15:43

0 Answers0