Skip to main content

Questions tagged [prefix-keys]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
1 answer
57 views

Equivalent of describe-key for prefix keys?

describe-key works for complete keys. How can I instead describe a prefix key? For example, I'd like to be able to do something like this: M-x describe-prefix-key C-x And have it describe the keymap ...
JBentley's user avatar
  • 163
0 votes
0 answers
63 views

How to make all key combinations insert themselves into vterm?

I'd like to create a keymap vterm-insert-map for vterm that self-inserts all or at least all currently bound key combinations, except for one, which acts as an escape key. I can use set-transient-map ...
Alexander Praehauser's user avatar
1 vote
1 answer
62 views

How to unbind all keybindings that start by a specific prefix?

I want to fully define my own C-c keymap, but some modes add default keybindings under that prefix. For example, I have C-c C-c for rustic-mode bindings and C-c & for yasnippet bindings. How can I ...
Haf's user avatar
  • 115
0 votes
2 answers
43 views

Is it reasonable for a mode-writer to bind keys relative to other keymaps?

Suppose, that I am writing an Emacs mode for some language. I am creating a corresponding keymap to bind various keys. I want to provide some kind of help/documentation function. I can bind it (within ...
Artem Yu's user avatar
  • 185
4 votes
1 answer
148 views

How do I learn which key prefix a keymap is bound to?

Suppose, I have some keymap bound to a key prefix, e.g. help-map bound to C-h. However, suppose also that I don't know what the prefix is. It might be C-h, it might be C-x h, it might be just C-? or ...
Artem Yu's user avatar
  • 185
0 votes
0 answers
35 views

How can I bind a prefix key to escape term-line-mode?

I've figured out how to get out of char mode, but not the other way around;) #+begin_src elisp (with-eval-after-load 'term ;Terminal Orientation ;(define-key term-raw-map (kbd "C-M-e o l"...
Jason Hunter's user avatar
0 votes
2 answers
76 views

Emacs calling unbound key sequence `C-c @` a "non-prefix key" [closed]

Emacs won't let me bind C-c @ TAB to outline-cycle in outline-minor-mode. It complains "Lisp error: (error "Key sequence C-c @ TAB starts with non-prefix key C-c @") -- but C-c @ is ...
Jeffrey Benjamin Brown's user avatar
0 votes
0 answers
36 views

Removing prefix from minor-mode keymap

Have been constructing a minor mode, taking code for the keymap from outline.el. I want to remove the use of a prefix key but I am unsure by what thing (key-description outline-minor-mode-prefix) ...
Dilna's user avatar
  • 1
1 vote
0 answers
128 views

Prefix key in general package does not work with emacs start up page (fundamental mode)

I am trying to define key bindings with general.el following emacs from scratch. However, the leader-prefix key (SPC) does not seem to work from the Emacs start-up page (Fundamental mode). It works ...
sm10's user avatar
  • 31
0 votes
1 answer
134 views

How to add prefix to suggestions in evil-mode?

Spacemacs has a way to add prefix descriptions with (spacemacs/declare-prefix ...). However, some evil-mode keybindings are lacking prefix descriptions. For example, in evil-mc g r is the prefix for ...
HRSE's user avatar
  • 123
0 votes
1 answer
45 views

Diacritic marks in emacs for macOS

I've run in a problem when I wanted to use diacritic marks (ąęśćłóżź) in the emacs for mac. Usually, to get them I use the right option key ⌥ along with the character I want to enter (⌥+aesclozx ...
user1146081's user avatar
1 vote
1 answer
111 views

What's wrong with my tab key?

I very recently started having an issue with my tab key while editing latex files. Normally, the tab key will indent according to whatever mode I'm editing in. Now, when I hit the tab key the ...
Brian Fitzpatrick's user avatar
0 votes
2 answers
114 views

Change the "^" keybinding prefix

Some keybindings require you to type the ^ character (ie magit smerge) and for starters, on an UE AZERTY keyboard (which is a very bad layout design BTW) there are two of those, and they each input a ...
yPhil's user avatar
  • 983
1 vote
1 answer
28 views

Trouble aliasing ctl-x-map, C-x 8 insert command?

I'm reading the beginning of the Emacs manual on inserting text. It says you can run C-x 8 [ to insert a left single curly quote. That works. In my init.el I have this: (define-key global-map [(...
Rob N's user avatar
  • 649
5 votes
1 answer
2k views

What is the difference between C-x and C-c and the concept behind it?

I was asking a similar question about the main concept behind default emacs key bindings. But this one is more specific to C-c and C-x. I know and use some commands/functions/features bind to C-c or C-...
buhtz's user avatar
  • 729
1 vote
1 answer
2k views

general.el error Key sequence starts with non-prefix key

I am having a problem with general.el package. I have SPC set as a prefix and then other keys as sub-prefix, then some other keys as actions, like how Doom Emacs has. (nvmap :states '(normal visual) :...
apoorv569's user avatar
  • 113
1 vote
2 answers
712 views

Stop major modes from overwriting my keybinding [duplicate]

By default C-x n is a prefix keymap used for narrowing. I want to bind C-x n to windmove-down. (global-set-key (kbd "C-x n") 'windmove-down) This works fine for Text mode. But many major ...
Kaligule's user avatar
  • 339
1 vote
1 answer
753 views

How do I bind C-x p to the project.el project-prefix-map?

Following the advice of Mastering Emacs I'm trying to use the project.el package. My problem is that C-x p isn't bound to the prefix keymap and I can't figure out how to bind it correctly. I'm pretty ...
afrosteve's user avatar
  • 131
3 votes
1 answer
390 views

Dead keys suddenly not working in Emacs

I'm using the emacs package on debian 10 and the dead keys for typing accents on characters (for instance, á) are no longer working. WHen I type the dead key, some kind of tiny window or artifact gets ...
korppu73's user avatar
  • 135
1 vote
1 answer
258 views

How to redefine prefix key in org mode?

I have rebound C-u to another function, and try to use C-j for the prefix, but now it seems I cannot use the prefix in org-mode. It does seem to work in other modes though. ; This is the relevant part ...
cammil's user avatar
  • 509
1 vote
1 answer
280 views

Forward, backward etc sexp not working

I want to use the forward-sexp function in Emacs, which on my Spacemacs for Mac is bound to C-M-f. Similarly for the backward-sexp. However, upon pressing C- for Control, and then the Meta key, which ...
zendevil.eth's user avatar
1 vote
1 answer
794 views

How to assign a command to "g" key when using evil

The question is quite intricate. I am using doom-emacs and evil and I am customizing the keys. Usually, something like (define-key evil-normal-state-map "g" 'evil-paste-after) would work. ...
Rareform's user avatar
  • 219
0 votes
1 answer
546 views

How to launch projectile mode with default configuration

I looked at the quickstart here: https://github.com/bbatsov/projectile#installation https://projectile.readthedocs.io/en/latest/usage/ And have this in my init.el: (require 'projectile) (define-key ...
Mittenchops's user avatar
2 votes
3 answers
481 views

make local map bindings available through a global prefix

I am trying to set up something like Spacemacs, but fully under my control. I have already created a tree of my own keymaps with global commands, and it is available on M-SPC. But now I'd like to ...
q.undertow's user avatar
0 votes
1 answer
185 views

How to use prefix C-SPC instead of prefix C-h, for `which-key-mode-map`?

I'd like to change the C-h prefix to C-SPC and so I added the following to my init.el, but it has no effect. (define-key which-key-mode-map (kbd "<C-SPC>") 'which-key-C-h-dispatch) Help ...
Ari's user avatar
  • 339
2 votes
2 answers
327 views

What's the difference between ‘global-set-key "\M-…’ and ‘define-key esc-map "…’?

Same for global-set-key "\C-x … and define-key ctl-x-map "…. I prefer (global-set-key (kbd "M-KEYS") #'COMMAND) because it's more readable, but I would like to know if the two kinds of binding -- ...
Arch Stanton's user avatar
  • 1,707
4 votes
2 answers
291 views

How do I add a keybinding to use during an interactive isearch, `C-s ...`

Can I assign a key binding starting with C-s such as: (global-set-key (kbd "C-s C-w") 'isearch-forward-symbol-at-point) but I want to keep (kbd "C-s") for i-search. I am having following error: ...
alper's user avatar
  • 1,400
0 votes
2 answers
1k views

Emacs wont let me bind a key, tells me, "Key sequence C-z c starts with non-prefix key C-z"

I tried to set this: (use-package avy :defer t :bind (("C-z c" . avy-goto-char-timer) ("C-z l" . avy-goto-line) ("C-C j" . avy-resume)) :custom (avy-timeout-seconds 0.3) (avy-style '...
basedrum1's user avatar
2 votes
2 answers
325 views

How do I describe C-z?

I tried to bind a key using a prefix-key of C-z, but Emacs told me: Key sequence C-z c starts with non-prefix key C-z. I guess this means that C-z is already bound to something. So I tried to do M-x ...
basedrum1's user avatar
2 votes
2 answers
350 views

What does it mean to type the "at" symbol in `C-c @ C-h`?

I'm using hideshow and I like it. The package is recommending me that I use the keys C-c @ C-h to hide a block instead of typing some really long command. I'm familiar with C-c and with C-h, but I can'...
Wilmer E. Henao's user avatar
2 votes
1 answer
751 views

Remapping global keybindings to a prefix command

The following works: (define-prefix-command 'my-map) (global-set-key (kbd "C-@") 'my-map) ;; MacOS (global-set-key (kbd "C-SPC") 'my-map) ;; Windows 10 The following does not: (global-set-key [...
LumpyGrads's user avatar
0 votes
1 answer
119 views

macOS not-terminal: why "S-" is translated away from S-RET?

I am trying to bind S-RET to something, but it's getting ignored. If I do C-h k S-RET, I see RET (translated from <S-return>) runs... - which seems to suggest that Emacs sees the S- in S-RET ...
Laurynas Biveinis's user avatar
2 votes
1 answer
201 views

Prelude: How to add smartparens key bindings to C-c prefix?

I am using Emacs with Prelude. When I hit C-c prefix in a clojure buffer, I would like to show a smartparens key bindings. Like in screenshot below I would like to to add entry for smartparens key ...
Imaxd's user avatar
  • 123
3 votes
1 answer
314 views

Rebind just `C-c` to some command

I'd like to rebind C-c to eshell-interrupt-process, so I don't need to press C-c C-c. I tried the naive (local-set-key (kbd "C-c") 'something) And similar commands but when I press C-c emacs waits ...
RedPointyJackson's user avatar
1 vote
1 answer
654 views

"ESC" no longer works as meta; how can I restore functionality?

I mistyped some command sequence and ESC stopped working as a meta prefix in Aquamacs (it still functions as usual in the command-line emacs, including both Apple's system version and the command-line ...
outis's user avatar
  • 188
2 votes
2 answers
493 views

Change prefix key for compose-character (C-x 8)

According to the documentation, the key C-x 8 can be used to insert non-ASCII characters. For example, C-x 8 ' a will insert "á". Is it possible to change the prefix key to another (shorter) value, ...
Federico's user avatar
  • 217
1 vote
2 answers
655 views

Spacemacs redefine main prefix `M-m`

I am trying Spacemacs with emacs keybindings, so the commands starting with SPC, like SPC f e d, can be invoked by replacing SPC with M-m. Since M-m is bound to back-to-indentation in stock emacs, I ...
Nisba's user avatar
  • 905
2 votes
0 answers
44 views

Get keymap that called function

I am trying to write a function that can be used to make a keybinding "remember" the key sequence that led up to the function being called. (defun modal-function (func) (funcall func) (set-...
Eric Egan's user avatar
2 votes
2 answers
675 views

Spacemacs: change prefix key from `SPC-b` to `SPC-v`

I use buffer (SPC-b) prefix key very often, and would like to move its keymap to a more convenient key (e.g. SPC-v). Is there a way to achieve this without redefining the entire map? so I would like ...
Mark's user avatar
  • 440
1 vote
0 answers
286 views

Why can't I bind to "M-s" prefix in global-map?

Running the following code: (global-set-key (kbd "M-s s") 'forward-char) Then using the command M-s s outputs M-s s is undefined. I have to bind to override-global-map for it to work: (define-key ...
Dodgie's user avatar
  • 482
-1 votes
1 answer
280 views

how bind `C-c g g` to `vc-git-grep`

How can I bind C-c g g to vc-git-grep ? So far I tried ;; in scratch buffer (global-set-key (kbd "C-c g g") 'vc-git-grep) ;; then M-x eval-region ;; then switch to another buffer ;; C-c g g
american-ninja-warrior's user avatar
3 votes
0 answers
378 views

how can i thoroughly change (key "C-x") in ivy-minibuffer-map?

one thing very interesting, i tried to (define-key ivy-minibuffer-map (kbd "C-x") 'ivy-kill-line) ..well then i restart my emacs, the first time i use the ivy to complete something, i type C-x ...
Yu Su's user avatar
  • 111
2 votes
1 answer
300 views

Binding a key to (MAP . CHAR)?

According to the define-key docstring, binding a key to a cons (MAP . CHAR) should cause that key to act as CHAR in MAP. However, I cannot get this to work. For example, evaling this and trying to use ...
noctuid's user avatar
  • 439
1 vote
1 answer
1k views

What is the difference between global-set-key and local-set-key?

I want to make a prefix key. So which command is better for making a prefix key? REF: https://www.emacswiki.org/emacs/PrefixKey
Big Shield's user avatar
3 votes
2 answers
965 views

Binding <ESC> <ESC> to have <ESC> <ESC> <ESC> functionality

I'm not a fan of hitting escape 3 times so I am trying to have the same functionality with two key presses. I have tried the following: (define-key key-translation-map (kbd "<ESC> <ESC>")...
sp00kyb00g13's user avatar
4 votes
1 answer
1k views

Proper way to change prefix key for minor-mode map?

The package HideShow (hs-minor-mode) defines some key bindings with prefix key C-c @. What is the proper way to change this prefix key to C-c h? The new key binding should also replace the old key ...
jue's user avatar
  • 4,596
8 votes
1 answer
1k views

What does `(fset SYMBOL KEYMAP)` do?

I was reading through the projectile source file and they do the following: (defvar projectile-command-map (let ((map (make-sparse-keymap))) ; define-keys map) "Keymap for Projectile ...
Czipperz's user avatar
  • 317
0 votes
1 answer
1k views

Normal C-c in ansi-term

In ansi-term, it automatically rebinds C-c to have the same keybindings as C-x. I want to turn this behaviour off, so I can access the keybindings I have behind C-c. (I know about C-c C-j, but that's ...
Kahr Kunne's user avatar
3 votes
2 answers
1k views

How to make emacs recognise C + SHIFT combinations in terminal mode?

Emacs cannot currently pick up C-SHIFT sequences in terminal mode. For example, C-) and C-( are instead just read as 0 and 9 respectively. I'm aware that using GUI mode is one way around this, but I ...
achalk's user avatar
  • 589
2 votes
1 answer
85 views

Relocating an anonymous prefix keymap

ibuffer uses / as a prefix key for filter commands, like ibuffer-filter-by-name (/n). As an evil user, I wanted to use a different prefix, since evil uses / for searching. I use space as a leader-...
ivan's user avatar
  • 1,948