Is there any updated documentation nr a tutorial about creating your own layer for personal customisations in proton? This document https://github.com/dvcrn/proton/blob/master/HOW-TO-LAYER.md doesn’t really have specifics about where to put files etc, and seems more tailored to creating a layer to add to the proton project proper (I mainly want to set up some keybindings with proper context etc and need a layer to do that).
@beetlefeet having your own 'private' layer is currently not possible just because of how clojurescript works. In contrast to elisp (emacs, spacemacs), clojurescript has to get compiled to javascript first to be usable inside atom. Layers are built with normal clojurescript and therefore currently can't get evaluated during runtime
.proton
works because it is edn and not clojurescript. That's why you can't actually use functions in it
there is some big progress on bootstrap cljs, aka clojurescript compiling clojurescript but that's not ready for prime time last time I checked
Right, that all makes sense. I’m just revisiting something I tried to do a while back, that is bind some additional ‘spacemacs’ shortcuts that require context. I use ‘copy project path’ a lot and would like to have that as SPC p y
Not sure how to achieve that..
hmmm
I can just bind it to the sequence outside of proton’s knowledge, but then I don’t get the nice menu and consisten behaviour
there were also talks of completely isolating the keyhelper so you can put things in it independently of proton
alternatively, we could maybe try to configure a function proton should execute from .proton
. In that case you could package your own plugin and just wire it to proton
actually that should be already possible
:keybindings {:c {:category "github"
:y {:title "test"
:action "hello"}}}
:action
is a atom action, it can come from a plugin or from atom coreIt feels like when you trigger an atom command from the key helper (like copy project path) it should somehow just have the right context, no idea what is technically the issue there though 🙂
Yes I’ve done that, but the issue is that only commands that don’t have a particular scope (especially ‘current editor’ type one) don’t work.
I see
ie: from https://github.com/dvcrn/proton/blob/master/MANUAL.md#custom-spc-keybinding : "As a limitation you can not specify a :target or a :fx key that describes where or how your custom command should get executed. If you definitely need this functionality, I'd recommend to create a layer and compile proton with it."
we could allow a css selector as :target
but doesn't seem like that's helping in your case
maybe some way of having target set by default
it might?
actually no
it needs the specific editor not just like “atom-text-editor” 🙂
https://github.com/dvcrn/proton/blob/master/src/cljs/proton/lib/atom.cljs#L138-L149
hmm
how about a predefined selection of possible targets?
:workspace
:current-editor
:window
etc
that would be excellent
wondering if there's a simple way to give the user full control over that
can we maybe deserialize a function from edn http://stackoverflow.com/questions/35247645/how-to-serialize-clojurescript-functions-to-edn-and-then-later-deserialize-and-i/35379300
Any security concern around that? I guess if someone is editing your .proton you might have other issues 🙂
never tried it, so not quite sure how trivial it is
Oh I figured something out from looking at the proton code. You can specify:
:target ".editor.is-focused”
and it will use that selector to find a DOM element and it works for :action "editor:copy-project-path”
\o/
Also works for reveal in tree view, my other bug bear. Yay, thanks for the pointers dvcrn.
:keybindings {
:p {:category "project"
:y {:title "copy project path"
:action "editor:copy-project-path",
:target ".editor.is-focused"}
}
:f {:category "files"
:t {:title "reveal in tree view"
:action "tree-view:reveal-active-file",
:target ".editor.is-focused"}
}
}
❤️
oh haha 👍
if you are good with wording, it would be great if you could add this into the MANUAL and create a PR @beetlefeet
will do
Has anyone else run into:
Error starting rsense
exec error: Error: Command failed: ~/.gem/ruby/2.3.0/bin/rsense start --port 47367 --path /Users/jpinnix/Code/Elixir/ProgrammingElixir
/bin/sh: /Users/jpinnix/.gem/ruby/2.3.0/bin/rsense: No such file or directory
I get this each time I open up files in Atom (using only proton)
@jpinnix looks like ruby layer. If you install rsense, does the problem disappear?
not sure why that plugin starts even when not editing ruby files
@dvcrn Installing rsense did not fix the problem. Indeed, I’m not working in ruby right now, so I’m really confused by that. So I removed ruby from my proton settings. Opened up the directory, it ran proton and removed ruby stuff. Closed and opened again, it’s fine now. Of course, I do work in ruby, so I’m not quite sure what will happen when I have to turn that back on.