Comments (6)
Ah thanks @vyp, I'd read the README when I first installed, but apparently not well enough. Thanks again @noctuid for putting a lot of thought into this!
from general.el.
https://github.com/noctuid/general.el#mapping-under-non-prefix-keys ?
from general.el.
Yeah, does general-key-dispatch
meet your requirements? general-define-key
doesn't try to automatically rewrite key definitions though; you have to do it manually.
Emacs doesn't have a good way to do this, as you point out, so you have to defer judgement, call the command once a unique key sequence (or timeout) is reached, and then simulate the prior keys. I won't say it works perfectly. There have been problems with repeating, but I've fixed all the ones I'm currently aware of (including for some pretty unlikely cases).
from general.el.
@noctuid Could you help me out with binding the keys/function pairs of cljr--all-helpers
under "cr"?
I want it to work something like this:
(nmap :keymaps 'clj-refactor-map
"c" (general-key-dispatch (if (bound-and-true-p lispyville-mode)
'lispyville-change
'evil-change)
"r" 'cljr--all-helpers
"c" 'evil-change-whole-line))
from general.el.
Right now i just have a separate general-key-dispatch
for each, but maybe just create a function for that and set it as the fallback (I haven't tested this):
(defun lispyville-or-evil-change ()
(interactive)
(if (bound-and-true-p lispyville-mode)
(call-interactively #'lispyville-change)
(call-interactively #'evil-change)))
As for binding r, it seems like those keys are all bound under clj-refactor-map
, so try bindiing "r" clj-refactor-map
.
from general.el.
general-key-dispatch
will now check to see if the command has been remapped, so there is no longer a need to have a separate general-key-dispatch
. For (general-key-dispatch 'evil-change...')
, lispyville-change
will automatically be used instead of evil-change
when lispyville-mode is active (with the latest versions of general and lispyville).
from general.el.
Related Issues (20)
- Making a prefix HOT 1
- Confused about general-create-definer and :prefix-command and/or :prefix-map with :keymaps HOT 1
- `Which-key` not working with `general-chord` prefix HOT 1
- How to "merge" major-mode and minor-mode bindings under same definer? HOT 1
- Vertico keybindings HOT 6
- Add an option to disable autoloading a command in `use-package` integration HOT 1
- Miscompilation of a `:general` form if binding in Evil's insert mode HOT 3
- Key sequence starts with non-prefix key. HOT 2
- Leader key only works in messages buffer after changing modes (EVIL) HOT 4
- Overriding mapping in minor modes HOT 3
- Rewrite HOT 16
- having seeing latex keys in org mode HOT 1
- How to pass a command list to `general-define-key` HOT 1
- Optimizing for speed: do's and don'ts HOT 9
- Prefix is not working with local leader definer HOT 1
- which-key labels not shown in prefix-command keymaps HOT 1
- General.el byte-compile warning HOT 2
- using multi evil states/keymaps in single general-def
- keymaps not activating keymap during major-mode treemacs HOT 2
- `general-def` is not defined when used in `pre-` or `post-command-hook` HOT 1
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 general.el.