Automatically add OP's name in comments on StackExchange sites

Converts [user] in a comment to be posted to the OP's username. Originally created to allow comment snippets with [user] included to be copy-pasted.


Developed & tested with TamperMonkey on Chrome.


Should probably exclude chat so that it isn't running unnecessarily.


When pasting into an answer, it'll take the name of the OP on the question, not the answerer.


  • This was actually intended, but I will change the behavior when I find some time – Zach Saucier Oct 23 '18 at 12:05
  • I edited the code so if you put "user" it says the name on the post you are commenting and if you put "USER" it will put the OP's. – lois6b Oct 24 '18 at 14:48

It doesn't take into account the International SO sites.

Should add:

// @match        https://*.stackoverflow.com/*

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .