evil, the Extensible VI Layer for Emacs
Questionable name aside, evil is the current state-of-the art when it comes to vim emulation in Emacs (and possibly anywhere else, for that matter). It supports a lot of features that other Vim emulation packages eschew, including:
vim keyboard macros
There is god-mode (https://github.com/chrisdone/god-mode), which uses standard Emacs key bindings but removes the need to hold down modifiers. When god-mode is enabled, C-... bindings require no modifier and M-... bindings use a prefix rather than a modifier.
An example from the GitHub page:
Before: C-p C-k C-n M-^ ) C-j C-y M-r C-x z z M-2 M-g M-g C-x C-s
fset sets a symbol's function definition.
Here, projectile-command-map is used as a prefix command. A prefix command is a symbol whose function definition is a keymap.
The definition of a prefix key is usually the keymap to use for looking up the following event. The definition can also be a Lisp symbol whose function definition is the following keymap; ...
Modalka must be the newest kid on the modal editing block. The github project seems to be all of 10 days old. I don't have enough usage time to comment or evaluate, but here's how it is described:
This is a building kit to help switch to modal editing in Emacs. Main goal of the package is making modal editing in Emacs as natural and native as possible. ...
Interestingly, you can try binding the deletechar pseudo key.
When I check the binding of backspace on my machine with C-h k [backspace], I get:
DEL (translated from <backspace>) runs the command... (blah blah blah)
When I check the binding of shift + backspace on my machine with C-h k S-[backspace], I get:
<deletechar> (translated from &...
I found a solution:
(global-unset-key (kbd "C-x p-"))
I can't find documentation of this anywhere, so I"m not sure if it works by coincidence or by design. However, the reproducible effect is that it disables the keymap and allows me to redefine "C-x p".
Adding my own, thanks @Mark for encouragement.
Xah Fly Keys
Designed from the ground up for emacs, with the goal of being the MOST efficient system, from years experience with ergoemacs-mode. Key choices are science based as much as possible, based on statistics of key frequency and key easy-to-press score. Most frequently used commands are mapped to the ...
It depends on the minor-mode/package. Many make this more configurable, which doesn't seem to be true in this case. I think the simplest thing here would be to just redefine the keymap yourself instead of trying to fiddle with it. Try this
(let ((map (make-sparse-keymap)))
;; These bindings roughly imitate those used by ...
In most cases, you can type the prefix and then C-h to get a list of all the bindings that begin with that prefix. This won't directly tell you what the prefix means and not all prefixes have a specific generic purpose. But, you may be able to tell from the set of functions what the commonality is.
The reason it's "in most cases" is that if the prefix ...
Boon is one of less-known packages for modal editing. It doesn't emulate Vi
(or Vim) but provides original layout optimized for Colemak keyboard layout.
Advantages and Design Principles
Spacial allocation first, mnemonics second: the allocation of keys to
commands is based in priority on the locations of keys on the
keyboard. Whatever is printed on ...
This sounds like exactly what the which-key package does. When you type a prefix key, after a short pause, a list of keys in the keymap and the commands they are bound to is shown in a side window. It's great for things you don't quit do often enough to have memorized.
Install it with package-install which-key and activate it with (which-key-mode).
Ergoemacs also supports modal editing. It doesn't emulate vi, but uses Alt key for most frequently used commands. For example, moving cursor is Alt plus right hand inverted T. (On QWERTY it is Alt+j for left, Alt+l for right, Alt+i for up and Alt+k for down). Deleting char or word is Alt with left hand home-row keys. Key choices are based on command ...
I found a solution—the following works for me:
Control Panel >
Advanced Settings >
Change language bar hot keys >
Ensure Between input languages is highlighted >
Change Key Sequence... >
Change Switch Keyboard Layout from Ctrl + Shift to Not Assigned.
A similar process is outlined here.
There's nothing new or unusual about this. This is how prefix keys work. They are bound to a keymap -- or they are bound to a symbol whose value or whose function definition is a keymap.
The Elisp manual node Prefix Keys tells you this:
The keymap binding of a prefix key is used for looking up the event
that follows the prefix key. (It may instead be ...
You can't. There's no way for a terminal to communicate both control and shift modifiers. The very original terminals (teletypes, actually) implemented the control modifier by masking out the top two bits of the 7-bit character set, allowing for 32 control codes. A Q is character number 0x51, and q is 0x71. The bottom five bits of these are both the same (...
One way to move -mode's keybindings could be with something like
(let ((origmap <foo>-mode-map)
(define-key newmap <prefix> origmap)
(setq <foo>-mode-map newmap))
But this code will fail if run before foo-mode is run. And it will have no effect if run after the mode is entered. So you'll ...
The short answer:
If you wish the prefix to be present in all buffers and all modes, use global-set-key. If you wish it to be present only in one mode, use local-set-key.
The difference between the two is what keymap they put the binding into: The global one, or the local one. When you type a key sequence, the local map is searched first, then the global ...
As I understand your question, you want C-s to start an interactive search, as it normally does, but if you press C-w after you've started that search, you want it to switch to isearch-symbol-at-point.
First off, the feature you're after is almost the same as the default behaviour bound to C-s C-M-w. That will call isearch-yank-symbol-or-char, which is ...
Another semi-modal option is Hydra:
According to the website
Imagine that you have bound C-c j and C-c k in your config. You want to call C-c j and C-c k in some (arbitrary) sequence. Hydra allows you to:
Bind your functions in a way that pressing C-c jjkk3j5k is equivalent to pressing C-c j C-c j C-c k C-c k M-3 C-c j M-...
The problem is that by changing the value of ensime-mode-key-prefix you are doing just that and nothing else. Somewhere after the definition of this option there is code which uses the value. If you haven't changed it then the default value is used, else the value you picked.
But if you change the value after the library has already been loaded, then that ...
I have this in my setup:
(define-key global-map [(shift backspace)] 'backward-delete-whitespace)
(define-key global-map [(shift delete)] 'forward-delete-whitespace)
to make shift+backspace / shift+delete kill all whitespace.
And just in case someone would need these functions, here they are:
(defun backward-delete-whitespace ()
(let ((p ...
The problem in your attempt is that apps comes from a translation via key-translation-map, and this output is not searched in key-translation-map recursively. If you omit apps altogether and work with f19 directly, it works.
(global-set-key (kbd "<f19> s") 'save-buffer)
(define-key key-translation-map (kbd "<f19> d") (kbd "C-c"))
If you want to ...
Define a prefix key for the mode's keymap.
Undefine the other keys that bother you, from that keymap.
Suppose that mode foo-mode binds key C-x o to foo-it, and you don't like that.
(define-key foo-mode-map (kbd "C-x o") nil)
And suppose you want foo-mode-map on prefix key <f9>:
(define-key global-map (kbd "<...
One way to do it is, instead of binding C-c z to a prefix key, bind it to a command that displays what you want and then calls set-transient-map to read a key sequence and interpret it in another map. Any key that isn't bound in the other map will be interpreted in the global map, so rather than wg-prefixed-map, you should provide a keymap where unknown ...
By default, evil binds C-w to the evil-window-map,
within which it stores the rest of the keybindings.
In looking at the source code, the core spot it happens is in
evil-motion-state-map. Depending on how you set
evil-want-C-w-delete and evil-want-C-w-in-emacs-state, it
will also bind the key in evil-insert-state-map and
evil-emacs-state-map as well.
The first answer is that its purpose is to act as a prefix key to the keys that follow it; that is, to serve as a keymap for a certain number of key bindings. Those bindings are also shown in describe-key. Seriously; this is the purpose: to group those keys and their commands. Now what that grouping might be about is another question (see next).
Beyond #1, ...
It looks like the answer is yes, you are right. And there is no cleaner way to deal with it - but see below, for one suggestion.
I'd suggest filing an enhancement request that Emacs add a variable for this keymap: M-x report-emacs-bug.
You can of course define your own map variable for this, basing its value on the current ibuffer.el code. But that won't ...
This binding is in the global keymap. Generally key bindings that work in most or all buffers are in the global keymap. If in doubt, see How can I find out in which keymap a key is bound? to check.
So you can simply call
(global-set-key (kbd "<ESC> <ESC>") 'keyboard-escape-quit)
This overrides the previous binding of ESC ESC as a prefix. Note ...
(Or (fset 'my-temp-map my-temp-map), since you've already created the sparse keymap.)
The point is that you need to not only create the keymap for the prefix key. You also need to give the symbol whose symbol-value is the keymap a symbol-function value that is the same map. my-temp-map needs to be a function, to act as ...