Skip to content

Instantly share code, notes, and snippets.

@Dimentium
Created July 30, 2023 19:48
Show Gist options
  • Select an option

  • Save Dimentium/0606940ede8ceca7758a51e11338638b to your computer and use it in GitHub Desktop.

Select an option

Save Dimentium/0606940ede8ceca7758a51e11338638b to your computer and use it in GitHub Desktop.
leader-layer and commands (like space/doom emacs)
{:des "Leader-key layer"
:rules [
:!leader-layer
[:right_command :right_command nil {:alone [["leader-layer" 1][:noti :leader "leader-key"]]
:delayed {:invoked [["leader-layer" 0][:noti :leader]]}
:params {:delay 2000}}]
:leader-layer
[:s [["leader-layer-s" 1]["leader-layer" 0][:noti :leader "leader-key s"]]]
[{:any :key_code} [["leader-layer" 0][:noti :leader]]]
:leader-layer-s
[:s [:!Cf ["leader-layer-s" 0][:noti :leader]]]
[{:any :key_code} [["leader-layer-s" 0][:noti :leader]]]
]}
@arabshapt
Copy link

Hi DK, could you explain it. It worked) I wish more people new about this...
Could you explain the code by adding comments?
Could you also add more examples how you would use it and is there any way to refactor it? make it shorter and simpler?
There are a couple of thread where some people were looking for this feature. If you could try to use it in your use cases and maybe improve it(making shorter maybe). This is a really great thing and I am almost sure that nobody knows about it. So please consider making something out of it(an article or a longer config(maybe taking default features from spacemacs and converting them to this config and using it in vs code or intellij by converting sequence of keys into their(vs code or intellij) shortcut outputs)).
Whether you do it or not a big thank you from me:)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment