10

I have tried this in a JavaScript file after disabling smartindent and autoindent options, with textwidth = 80, but it is still the same. It also happens automatically because of the textwidth option when inserting words which together have a length of over 80 characters.

What happens:

/**
 * - a b c d e f g h i j k l m n o p q r s t u v w x y z a b c d e f g h i j k l
 *   m n o p q r s t u v w x y z
 */

What I want:

/**
 * - a b c d e f g h i j k l m n o p q r s t u v w x y z a b c d e f g h i j k l
 * m n o p q r s t u v w x y z
 */

Thank you very much! :-)

  • As near as I can figure out, there is no way to disable the automatic list formatting, but the formatting code in the Vim source is somewhat confusing, so I may be wrong... – Martin Tournoij Nov 8 '15 at 13:09
3

Vim's default Javascript configuration contains a setting to format dashed lists in comments:

setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,://

To get the behaviour you want, simply override the setting (for javascript filetypes) to leave out the dashed list part:

setlocal comments=s1:/*,mb:*,ex:*/,://
| improve this answer | |

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.