How can I run a piece of code using keybind without write a line and then press ctrl-enter?
atom.commands.add 'atom-workspace',
'custom:teste', ->
atom.commands.dispatch("print(2)", 'hydrogen:run')
UPDATE 1:
Sorry, I mean execute a language program, as Python or R.
atom.commands.add 'atom-workspace', 'custom:teste', ->
atom.commands.dispatch("x <- 2", 'hydrogen:run')
and then a use this variable in the editor
print(x)
2
Is possible to do that?