einenlum,
@einenlum@fosstodon.org avatar

question: when I comment code through gc in visual mode, vim comments it using multiline comments for every line. I would like to have single line comments instead (//).

This causes trouble for my colleagues on PHPStorm. Any idea how I can change this behavior?

Thanks! <3

What I would expect: a portion of code with every line commented with leading double slashes
What I get instead: a portion of code where every line is commented with multi line comments

normalmode,
@normalmode@mastodon.social avatar

@einenlum gc is used by both commentary and tcomment. Which are you using?

If the former, try changing your commentstring option while in your PHP file:

:set commentstring=//\ %s

einenlum,
@einenlum@fosstodon.org avatar

@normalmode Oh it works indeed! Thank you!

normalmode,
@normalmode@mastodon.social avatar

@einenlum Did a bit more testing. Actually shouldn't include the space:

:set commentstring=//%s

arnandegans,

@einenlum if PHPstorm can’t deal with // comments they’re using the wrong app 🤣

einenlum,
@einenlum@fosstodon.org avatar

@arnandegans That's the other way around 😊 .
It can deal with //, but doesn't work when trying to uncomment several lines each commented in multiline mode.

arnandegans,

@einenlum hmm thats a bit basic hah 😉 isn't there a plugin or mod that detects when one or multi line comments are appropriate? Coda2 and Nova can do that.
Dunno about vim, but PHPstorm has a plugin system, right?

  • All
  • Subscribed
  • Moderated
  • Favorites
  • php
  • ngwrru68w68
  • rosin
  • GTA5RPClips
  • osvaldo12
  • love
  • Youngstown
  • slotface
  • khanakhh
  • everett
  • kavyap
  • mdbf
  • DreamBathrooms
  • thenastyranch
  • magazineikmin
  • megavids
  • InstantRegret
  • normalnudes
  • tacticalgear
  • cubers
  • ethstaker
  • modclub
  • cisconetworking
  • Durango
  • anitta
  • Leos
  • tester
  • provamag3
  • JUstTest
  • All magazines