Hi guys, I have installed Juno, with Julia 0.6. I really like it, thanks to all involved.
I’ve been playing around and one thing I like to do when I’m in other IDE’s is press one key to save my script and run it at the same time. I’d like this key to be F5.
Just use Ctrl-Shift-P or Cmd-Shift-P to open the command pane and type in “keymap”. The first entry there should get your keymap file, which might also be json in newer Atom versions (not sure).
Just as per that article I linked to above. And this works in that it clears the console and runs the file. But what I really want is for it to save the file just before running too. All with the f5 key.
Man, I don’t really want to spend half a day learning how to drive Atom. It seems overly complicated and like a ‘black box’ in that there’s no list of available commands, few examples of syntax etc.
I can see that Atom probably can be configured to do anything. But how to get it to do what you want seems akin to learning another small language.
atom.packages.onDidActivatePackage (p) ->
if p.name is 'julia-client'
juno = p.mainModule
atom.commands.add '.item-views > atom-text-editor', 'julia-client:clear-console-and-run-file', ->
atom.workspace.getActiveTextEditor().save()
juno.runtime.evaluation.evalAll()
juno.runtime.console.reset()
in your init.coffee should work in most cases (but error for Untitled buffers). Note however that there is no need to save files before evaluating them. Atom will also keep a copy of unsaved files if close it, so it’s pretty hard to lose progress.
See here should you want to have look into the available API a bit more in-depth.
Also, please escape code blocks in your posts with backticks (``` for codeblocks, ` for inline code) – makes it much easier on the eyes.