Create a variable by putting cursor in text and use a short cut


I am not sure this is available because I have been looking. is it possible or could it be made possible to just write text and then at the end just hit a shortcode say [cmd+ctrl+v] and whatever you had typed becomes a variable? it would save us sometime instead of always going for the $ first. I don’t know why it bothers me but well… maybe I have a little OCD or plain laziness. 🤦


You can add this to your file:

atom.commands.add 'atom-text-editor', 'custom:format-as-php-variable', ->
  editor = atom.workspace.getActiveTextEditor()