Fork me on GitHub
#proton
<
2017-03-08
>
reem01:03:28

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

reem01:03:04

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

reem01:03:06

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

dvcrn01:03:34

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

dvcrn01:03:38

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

dvcrn02:03:02

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

reem02:03:25

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

reem02:03:54

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

dvcrn02:03:14

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

dvcrn02:03:28

.proton is actually edn and not clojurescript

reem02:03:59

ah I see that makes sense

dvcrn02:03:06

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

dvcrn02:03:39

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

dvcrn02:03:00

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

reem02:03:18

and the init script is not overriden by proton?

dvcrn02:03:34

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

dvcrn02:03:46

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

reem02:03:20

thanks a ton!

reem02:03:27

proton is very cool just a little under documented 🙂

reem02:03:40

honestly though it

reem02:03:42

it's pretty good

dvcrn02:03:43

need to work on that lol

reem02:03:09

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

reem02:03:38

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

dvcrn02:03:05

yeah emacs can be quite confusing 😛