proton

https://github.com/dvcrn/proton
reem 2017-03-08T01:08:28.000126Z

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

reem 2017-03-08T01:09:04.000127Z

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

reem 2017-03-08T01:47:06.000128Z

refining my question: how do I do atom.workspace.open("~/.proton") as an :action

dvcrn 2017-03-08T01:58:34.000129Z

@reem there is already a shortcut for opening the dotfile under SPC f e d or SPC _ d

dvcrn 2017-03-08T01:59:38.000130Z

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

reem 2017-03-08T01:59:59.000131Z

I see

dvcrn 2017-03-08T02:00:02.000132Z

:action is any action that is available inside atom, either from core atom or added through a plugin

reem 2017-03-08T02:00:25.000133Z

do you recommend maintaining basically your own plugin that gets sourced into proton for any js needs?

reem 2017-03-08T02:00:54.000134Z

and just out of curiosity why is it not possible to just write the equivalent clojure inside of .proton?

dvcrn 2017-03-08T02:02:14.000135Z

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

dvcrn 2017-03-08T02:02:28.000136Z

.proton is actually edn and not clojurescript

reem 2017-03-08T02:02:59.000137Z

ah I see that makes sense

dvcrn 2017-03-08T02:03:06.000138Z

for your first question, I believe you can just add new actions in your init script

dvcrn 2017-03-08T02:03:39.000139Z

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')

dvcrn 2017-03-08T02:04:00.000140Z

having that and you should be able to use custom:exec-and-move from withing .proton

reem 2017-03-08T02:04:18.000141Z

and the init script is not overriden by proton?

dvcrn 2017-03-08T02:04:34.000142Z

I don't think we're touching that currently, no

dvcrn 2017-03-08T02:04:46.000143Z

give it a try 🙂 add console.log or something like that and see if it prints

reem 2017-03-08T02:05:18.000145Z

will do

reem 2017-03-08T02:05:20.000146Z

thanks a ton!

reem 2017-03-08T02:05:27.000147Z

proton is very cool just a little under documented 🙂

dvcrn 2017-03-08T02:05:36.000148Z

yeah...

reem 2017-03-08T02:05:40.000149Z

honestly though it

reem 2017-03-08T02:05:42.000150Z

it's pretty good

dvcrn 2017-03-08T02:05:43.000151Z

need to work on that lol

reem 2017-03-08T02:06:09.000152Z

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

reem 2017-03-08T02:06:38.000153Z

esp. because I already know js and the ecosystem very well

dvcrn 2017-03-08T02:07:05.000154Z

yeah emacs can be quite confusing 😛