Comments (4)
I think there's some confusion here about what signals are exactly, and what the point is of corkey.
Signals are a corkey-specific concept. They're a level of indirection, in this case instead of saying in the keys file: ", l p
is bound to sesman-link-with-project
", we say "what , l p
does conceptually is link to a repl on the project level (:link-repl/project
). This is just a symbol that we pick. Then in the bindings file we say: "when in cider-mode, to link to a repl on the project level is done with sesman-link-with-project
".
This achieves two things, it means that we can have a mnemonic like SPC t w
(toggle writable), or , e e
(eval) which "just works", no matter which mode you're in. So in most buffers it'll toggle read-only-mode
, but in dired buffers it toggles wdired-mode
, because that's what making a dired buffer writable means. So you get consistency, you have to memorize fewer distinct bindings, your knowledge transfers.
The second thing this achieves is being able to rebind keys, e.g. maybe I want to use M-RET
to eval, so I can add that to my user-keys file, and this binding will now be able to eval forms in any language we support. Depending on the mode it could be calling eval-last-sexp
, cider-eval-last-sexp
, geiser-eval-last-sexp
, and so forth.
To really understand the motivation you can look at Spacemacs. Spacemacs tries to achieve a certain degree of consistency in key bindings, but they do this by adding and maintaining separate bindings for each mode. The result is that they're all slightly different and drifting apart, and if you want to use a different key for something you need to add bindings in your own config for every single mode where you want to use it.
The idea has also always been that this allows providing completely new keys files, e.g. you could create a keys file with Calva style mappings. Say that in that keys file it says ("C-f" :buffer/incremental-search)
, and in your user-signals file you have (:buffer/incremental-search <some-fancy-search-package>)
, now you can install that calva-style keys file, and still get your preferred commands.
from corgi.
Maybe I'm being a bit slow and am missing some of the subtitles or perhaps I'm just not being clear/concise, but what you wrote seems to mirror what I think my understanding of corkey is.
My main uncertainty was with definitions like
("p" "Link with project" :link-repl/project sesman-link-with-project)
in the corgi-keys.el file and
:link-repl/project sesman-link-with-project
in the corgi-signals.el file. I would have expected the corgi-keys.el file to just have
("p" "Link with project" :link-repl/project)
The grammar explanation also seems to say that a target is either a signal or a command and that a signal is a keyword. The definition in the corgi-keys.el file seems to be a keyword and a command?
from corgi.
Oh sorry I missed that part. That's definitely a mistake, the keys file in this case should only contain the signal keyword.
from corgi.
OK, thanks that clarifies things for me. I'll focus on my clojure project for the next few days until the chrun from the move to emacs-corgi settles down (it was getting my clojure dev setup tweaked which brought me to corgi in the first place, so I need to make sure I'm not getting distracted from the main goal 😄 ).
from corgi.
Related Issues (20)
- Corkey how do I define only insert mode commands? HOT 1
- Consider replacing which-key HOT 4
- Status and direction? HOT 6
- corgi-stateline not working HOT 8
- Emacs version and compatibility HOT 2
- Where to put "snippets"? HOT 1
- Smart completion packages HOT 6
- Creating a Corgi github org HOT 14
- Do we actually want evil-unimpaired HOT 5
- clj-refactor, clj-kondo, clojure-lsp HOT 6
- Corgi key binding policy HOT 1
- evil-escape package for alternative Esc keybindings HOT 2
- Update straight.el URL
- What is the best way to refactor in corgi? HOT 3
- Integrating 'jj' or 'jk' into corgi config. HOT 1
- Looking up functions HOT 2
- Corgi is not initialising correctly, error: could not find package string-edit HOT 6
- Typo User instead of corgi HOT 2
- Unable to boot cider off a fresh corgi install? HOT 15
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from corgi.