Reputation: 347
For .js files if I type
/**<Enter>
Vim creates
/**
*
This is annoying, I don't want the asterisk on the second line added (it's also added to the start of any additional lines). It's probably being generated by one of the plugins I have installed (this ended up being not the case, ignore what I have below this) (I installed all with Pathogen), so I followed this process:
I repeated that for all plugins (listed below) and couldn't make the behavior go away. Any ideas?
My plugins, they should all be fairly popular, uncontroversial choices:
Upvotes: 1
Views: 222
Reputation: 5122
This behavior is specified by the 'comments'
option. See where it was set with
:verbose set comments?
Probably it is set in the default ftplugin for javascript. Decide on a value you like, such as :set comments=
or :set comments=://
. Then you can set this for future javascript files using an :autocommand
as in @brettanomyces's answer or by using one of the methods described in :help ftplugin-overrule
. I recommend the third option described there.
Upvotes: 1
Reputation: 7688
Try
:set formatoptions-=r
or add the following to your .vimrc
autocmd FileType * setlocal formatoptions-=r
formatoption 'r' automatically inserts the current comment leader after hitting <enter>
in Insert mode.
See:
:h formatoptions
:h fo-table
Upvotes: 3