On screen, the first time we hear the nickname "Scotty" for Montgomery Scott is in the episode "The Naked Time":
KIRK: I'll hold you to that half second, Scotty.
The reboot films go out of their way to create a foundational conversation where the nickname "Bones" for McCoy is used for what is clearly the first time; however, they give no such treatment to "Scotty". The nickname comes up all of a sudden in the 2009 film, several scenes after meeting Scott:
KIRK: How are we, Scotty?
SCOTT: Unbelievably, sir, the ship is in position.
To be clear, I'm not wondering why he has this nickname — it's clearly an affectionate reference to his family name and heritage. I'm wondering who gave it to him. Was it Kirk? Was it someone else in the crew, like McCoy? Or was it a nickname he was already fond of, and then encouraged Kirk and others to use?
The Memory Alpha article on Scotty simply says that he is "referred to as Scotty by his shipmates".
The official StarTrek.com database entry on him only says that he is "known as 'Scotty' as well as 'the miracle worker' to his longtime comrades James T. Kirk and crew".
Who gave Scotty his nickname?