stephendavidmarsh / control-mode Goto Github PK
View Code? Open in Web Editor NEWControl mode
Control mode
When the mode is enabled C-m doesn't work (it should insert new lines or do whatever RET is bound to).
The package would benefit from good visual feedback similar to that used in Evil mode. That is, when we're in “normal” mode let cursor be in form of box (by default, it will be configurable), while in “insert” mode let it be in form of thin bar.
I made heavy use of this package in short time and it would be absolutely impossible to use without this visual feedback. If you agree that this will be an improvement, I will include necessary changes into pull request I'm working on.
When defining key binding translations with key-translation-map
, they are currently not respected in control-mode
. For example, if I have:
(define-key key-translation-map (kbd "C-x ;") (kbd "C-x C-;"))
Then in control-mode
the translation won't happen and x ; will be equal to C-x ;, not C-x C-;. Is it possible to somehow support translations of key bindings in control-mode
?
By the way, great package. I'm planning to open a PR with cosmetic improvements, also consider tagging the package, so it will be available in MELPA stable for example.
I really like control-mode. I think it would be more useful if it has the following feature: Using number argument as a place holder for the number of controls the next command is going to use:
My idea basically is, if you are in control mode, pressing a number (i.e. 2,3 or 10 - a random number) will count the amount of controls "pressed" in the future. By default, if the control mode is on, pressing normal characters keys (any character but modifiers and number key) consumes a "control token" and control count is decreased. If a character key is pressed along with other modifier key such as Meta or Super, a "control token" is not decreased and the character key is combined with the other modifier keys.
For example, suppose we have 2 "control tokens". We press x first, which will consume a token and the key sequence is considered C-x. However, for the next character key such as f, we press Meta as a prefix, a token will not be consumed and the key sequence is M-f.
In the mode line, along with letter C to indicate control mode is on, there should be another variable which displays the token count. For example. [C 2] indicates that control mode is on, and the tokens remaining in used is 2. Default is [C 1], which means if a key is pressed, it will decreased to 0, and further key strokes are counted as part of key sequence without control prefix (except other modifier keys if pressed).
Doing it this way, we won't have to add any Elisp code to avoid collisions between key sequences for different commands i.e. as you provided in your description. Also, instead of pressing C-z to get into this mode, we can actually bind directly to Control key to switch between control/edit mode (kinda like vi, but for Emacs users). This way, Emacs users won't have to use Evil mode to get something like Vi and still can use their original key bindings.
I am looking forward to it! I hope you can implement it. I am willing to learn Elisp to help it out.
Most 'unbound' keys in org-mode are bound to 'org-self-insert-command, rather than 'self-insert-command.
Supporting org-mode out of the box appears to be just a matter of adding 'org-self-insert-command to 'control-mode-overrideable-bindings.
Normally, isearch-forward
is bound to C-s, according to the documentation, it should be available in control mode as s, but when I hit s in control mode, s-
is displayed in the echo area, and seemed to wait for input to complete.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.