Fork me on GitHub
#proton
<
2016-11-14
>
beetlefeet08:11:49

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

dvcrn08:11:40

@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

dvcrn08:11:58

.proton works because it is edn and not clojurescript. That's why you can't actually use functions in it

dvcrn08:11:02

there is some big progress on bootstrap cljs, aka clojurescript compiling clojurescript but that's not ready for prime time last time I checked

beetlefeet08:11:52

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..

beetlefeet08:11:40

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

dvcrn08:11:04

there were also talks of completely isolating the keyhelper so you can put things in it independently of proton

dvcrn08:11:57

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

dvcrn08:11:26

actually that should be already possible

dvcrn08:11:41

:keybindings {:c {:category "github"
                    :y {:title "test"
                        :action "hello"}}}
:action is a atom action, it can come from a plugin or from atom core

beetlefeet08:11:41

It 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 🙂

beetlefeet08:11:28

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.

beetlefeet08:11:42

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."

dvcrn08:11:27

we could allow a css selector as :target but doesn't seem like that's helping in your case

beetlefeet08:11:29

maybe some way of having target set by default

beetlefeet08:11:28

it needs the specific editor not just like “atom-text-editor” 🙂

dvcrn08:11:32

how about a predefined selection of possible targets? :workspace :current-editor :window etc

beetlefeet08:11:11

that would be excellent

dvcrn08:11:54

wondering if there's a simple way to give the user full control over that

beetlefeet08:11:51

Any security concern around that? I guess if someone is editing your .proton you might have other issues 🙂

dvcrn08:11:10

never tried it, so not quite sure how trivial it is

beetlefeet09:11:10

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/

beetlefeet09:11:00

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"}
       }
  }

dvcrn09:11:55

oh haha 👍

dvcrn09:11:23

if you are good with wording, it would be great if you could add this into the MANUAL and create a PR @beetlefeet

jpinnix21:11:20

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

jpinnix21:11:46

I get this each time I open up files in Atom (using only proton)

dvcrn22:11:59

@jpinnix looks like ruby layer. If you install rsense, does the problem disappear?

dvcrn22:11:21

not sure why that plugin starts even when not editing ruby files

jpinnix22:11:02

@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.