hello! I'm trying to add a little shortcut for myself to open up .proton
, specifically I want SPC-f-c
to open .proton
. I understand how to set something to SPC-f-c but I am having trouble figuring out what I should put in the :action field
if anyone knows what action I should use to open a file that would be great, even better would be some info about where to go to find the answer to this sort of question myself
refining my question: how do I do atom.workspace.open("~/.proton")
as an :action
@reem there is already a shortcut for opening the dotfile under SPC f e d
or SPC _ d
but to answer your question, you can't do this from the .proton
file since you have to execute javascript and the current dotfile isn't designed to be able to do that.
So you either have to
a) Create a plugin that implements this action and exposes it (so proton can use it)
b) Modify the core layer / create a new layer, though this requires compiling
I see
:action
is any action that is available inside atom, either from core atom or added through a plugin
do you recommend maintaining basically your own plugin that gets sourced into proton for any js needs?
and just out of curiosity why is it not possible to just write the equivalent clojure inside of .proton?
clojurescript is a compiled language that needs to get compiled to javascript first before it can be used. Adding clojurescript into .proton
would mean that we'll have to compile/parse it on the fly
.proton
is actually edn and not clojurescript
ah I see that makes sense
for your first question, I believe you can just add new actions in your init script
a quick google gave me code snippets like this:
atom.commands.add 'atom-text-editor', 'custom:exec-and-move', ->
editor = atom.views.getView(atom.workspace.getActiveTextEditor())
atom.commands.dispatch(editor, 'hydrogen:run')
atom.commands.dispatch(editor, 'core:move-down')
having that and you should be able to use custom:exec-and-move
from withing .proton
and the init script is not overriden by proton?
I don't think we're touching that currently, no
give it a try 🙂 add console.log
or something like that and see if it prints
will do
thanks a ton!
proton is very cool just a little under documented 🙂
yeah...
honestly though it
it's pretty good
need to work on that lol
I just started using it today and I already feel like I have a better grasp of how to mess with it and atom than I do after using spacemacs for months
esp. because I already know js and the ecosystem very well
yeah emacs can be quite confusing 😛