I have a lengthy scriptin that I'm using to help me convert JavaScript files to Typescript. There are about 30 commands defined in it so far:

:%s/^\(\s*\)params\.\(\S\+\) = \(.*\);/\1  \2: \3,/
:g/function/s/\<e\>,/_event: Event | null/
:g/function/s/\<e\>/_event?: Event | null/

It's getting to the point where it's difficult, particularly for other team members who aren't familiar with regex, to know what any of it does. I'd like to be able to document it for their and my sanity.

Is that possible?

Is it possible to make a comment in a scriptin? I.e., is there a command that when entered will allow any number of keys to be pressed until Enter (or some other comment terminator) is pressed?


Yes it is, use double-quotes

:h :comment

  • 1
    Brilliant! Thank you! – snazzybouche Nov 27 '20 at 11:49

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.