Questions tagged [key-bindings]

Keyboard shortcuts, key chords, key sequences, hotkeys, or any association between key combinations and corresponding actions in Emacs.

Filter by
Sorted by
Tagged with
0
votes
0answers
13 views

How can I add a name to prefixes?

My current config looks like this: (use-package general :ensure t :config (general-define-key :states '(normal visual insert emacs) :prefix "SPC" :non-normal-prefix "C-SPC" ;;...
1
vote
1answer
24 views

How does one type <C-menu> or <next> on a keyboard (in Emacs)?

I recently came across these two keybindings in someone else's config and haven't seen them before. I have a US qwerty keyboard, a Kinesis Freestyle Pro. I know where the control, C, key is, and I see ...
0
votes
0answers
14 views

Unsure on how to set Evil keybinds

In order to install evil and evil-collections I added this to my config: (use-package evil :ensure t :init (setq evil-want-keybinding nil) :config (evil-mode 1)) (use-package evil-...
0
votes
0answers
22 views

Default keybindings in org-mode and collision with other established keybindings

I don't know whether the set of emacs users falls apart so sharply that those with "normal" editing needs never use org-mode and vice versa, but I think that I am not the first to ask why the proposed ...
1
vote
1answer
14 views

Setting up the **second** leader key for Xah-Fly-Keys

Inspired by this post, I tried to set up a second leader key for my Xah-Fly-Keys for major mode commands (as suggested in the post). But I couldn't find how I can set up the second leader key for Xah-...
1
vote
1answer
40 views

How to cancel the minibuffer with M-x

I have M-x (and also my menu key) mapped to the command helm-M-x. How to write an elisp function or how to configure emacs so that M-x (and the menu key) performs as C-g when the minibuffer is open. ...
0
votes
0answers
15 views

Unable to set keybinding with the down arrow key in emacs

I have the following keybindings for jumping 10 lines. (global-set-key (kbd "<C-up>") (lambda () (interactive) (previous-line 10))) (global-set-key (kbd "<C-down>") (lambda () (...
0
votes
1answer
30 views

What's the rules to bind keys

I learn the mark-end-of-sentence is handy to select to end of the sentence as handy as C-M-Space which select a word. from Select to the sentence of line in a shortcut The function is not bound by ...
0
votes
1answer
40 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 '...
1
vote
1answer
34 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 ...
0
votes
0answers
19 views

(global-set-key (kbd “C-M-s”) 'mark-end-of-sentence)

I bind key as (global-set-key (kbd "C-M-s") 'mark-end-of-sentence) then issue C-M-s but nothing happened. M-x to invoke mark-end-of-sentence works and check C-M-s has bound to it. What's the ...
0
votes
1answer
19 views

Rebind 'q' key in Emacs Dired to the command 'kill-this-buffer' [duplicate]

If I press 'q' in Dired this buries the current buffer. I would prefer to have 'q' kill the buffer. Hence, I would like to bind the command "kill-this-buffer" to 'q' in Dired. Is this possible and ...
1
vote
1answer
11 views

Mac stopped binding CMD-Up, which I use in Emacs and Racket

CMD/up, used in both Dr Racket and Portacle (Emacs) to retrieve the last command in the buffer, has stopped working for both programs. Other combinations with CMD do work, such as CMD/P, and CMD/X, ...
0
votes
1answer
10 views

What are the key bindings relevant to week-genda view?

Reminder: one enters the week-agenda view by typing C-c a a. Only serendipitously did I find out that ! toggles "deadline inclusion". How would I find the description of similar key bindings from ...
2
votes
2answers
91 views

How to detect the key binding for a function in elisp?

How would I go about getting the key binding for a function in elisp? I'd like to know which key is used to quit. e.g. keyboard-quit. I tried using the function used by help functionality but it's ...
6
votes
1answer
48 views

leakage of define-key in let-bound keymap

I am trying to make a keymap to apply to a buffer region where the map is a composed keymap of several modes. Then, in that map, I want to define C-c C-c to run the command org-ctrl-c-ctrl-c. This is ...
1
vote
1answer
61 views

`use-package` and `define-key`

I'm using multiple-cursors, setting it up with use-package. By default, when multiple-cursors mode is enabled, <return> is bound to multiple-cursors-mode. I'm trying to override that adding this ...
1
vote
1answer
58 views

Is it possible to bind CTRL-SHIFT-xxx and CTRL-num combination?

I'm very new to emacs and essentially came from vim where it is not possible to bind CTRL-num combination like (CTRL-1, CTRL-2, etc) which as well as CTRL-SHIFT-xxx like CTRL-# which essentially works ...
1
vote
2answers
55 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'...
3
votes
1answer
196 views

Unable to bind keys `M-[` and `M-]`

I'm trying to bind M-[ and M-] to the following functions (courtesy of Xah Lee): (defun xah-forward-block (&optional n) "Move cursor beginning of next text block. A text block is separated by ...
2
votes
1answer
44 views

What's the idiomatic way of overriding a key binding for a given major-mode (but no other)?

I'd like to bind C-x C-e to python-shell-send-region when I am in python major-mode. In my config file, I have an add-hook for python mode, but I'd like this keybinding override to be removed/...
3
votes
2answers
356 views

Swap M-x and M-q

How can I swap M-x and M-q? I can swap C-x and C-q with ;; swap C-q and C-x (keyboard-translate ?\C-q ?\C-x) (keyboard-translate ?\C-x ?\C-q) The following errors out (keyboard-translate ?\M-q ?\...
1
vote
1answer
112 views

shift selection not working for rebound M-{ backward-paragraph

I slightly simplified the keys for backward-paragraph and forward-paragraph: (global-unset-key (kbd "M-{")) ;; originally backward-paragraph (global-unset-key (kbd "M-}")) ;; originally forward-...
5
votes
1answer
93 views

Specifying a binding for control shift tab?

I defined a function like this: (defun switch-to-prev-window () (interactive) (other-window -1)) and it appears to work if I call it with M-x. But I've added the binding (global-set-key [(...
0
votes
3answers
28 views

Swap Shift/non-shift key behavior for particular mode

I want to press - on my keyboard and have _ be inserted and vice-versa only for a particular mode. The following does this globally using the post-self-insert-hook, It checks the character just ...
0
votes
1answer
70 views

What does z originate in C-x z (z no relation with repeat literally

In contract to vim's arbitrary behaviors in choosing keys, emacs's key binding performs semantically, C-x (C for commands, x for execute) M-x (M for meta commands or named command, invoke a ...
0
votes
1answer
65 views

C-x C-q wants to quit Emacs

I want to use C-x C-q to make the Dired buffer editable, however, this key combination seems to be bound to quitting Emacs for some reason. I did not bind this key combination somewhere in my config. ...
0
votes
1answer
22 views

How to get rid of ido-find-file

I have recently switched from obsolete ibuffer-mode to ido mode, and it replaced C-x C-f command to ido-find-file with completions. I don't need it. How to revert it back to simple find-file? I tried ...
0
votes
0answers
31 views

Emacs LISP keyboard bindings with OSX and iMac keyboard?

Does anyone know how to change Mac OSX keybindings quickly for use with Emacs? I'm hoping to redefine at least the following keys: iMac KB Key -> Keycode on MacOSX CAPS LOCK -> ...
0
votes
0answers
30 views

Bind chord key to another key

How would I map chord to behave similar to another keybinding? The reason is because C-h c C-g gives me different functions whether I am minibuffer or buffer. (use-package use-package-chords :...
0
votes
1answer
27 views

Emacs keybindings / invocation for Apple iMac keyboard, similar to LMI or Knight?

Does anyone have a HOWTO on creating efficient keybindings and invocation of Emacs for the iMac Bluetooth keyboard pictured here? Specifically one or more of the following use cases: Invocation of ...
1
vote
1answer
54 views

Commands with Keybindings only

When I run helm-M-x and enter characters, I like to see only those commands which has key-bindings. How I can achieve that? I like to have reverse functionality as well, ie.. commands without key-...
0
votes
1answer
25 views

Finding missing Ediff key bindings

I was just looking at the Ediff manual¹ for something, and it's one of those Emacs manuals that (a bit annoyingly) only list keybinds and not function names (so, if you have rebinding going on, you ...
1
vote
1answer
29 views

Can which-key help with extended keyboard shortcuts?

I have two shortcuts defined like this ;; eval in shell (global-set-key (kbd "C-c x s") 'eir-eval-in-shell) ;; eval in ruby (global-set-key (kbd "C-c x r") 'eir-eval-in-ruby) which-key helps me ...
0
votes
0answers
26 views

Emacs mac-right-option-modifier variable doesn't work with Sticky Keys on in macOS

I've set right option modifier as super key using `(setq mac-right-option-modifier 'super) but if I have Sticky Keys on on macOS, it doesn't work.
1
vote
1answer
23 views

Command that does different things based on whether something is selected

I am trying to make emacs function somewhat like sublime text, where C-x cuts text that is selected and cuts the whole line when nothing is selected. I got the full-line cut to work using (global-set-...
0
votes
1answer
18 views

Display time of “You can run the command … with …” minibuffer hints

I type in, for example, M-x occur and it says You can run the command occur with M-s o. How can I make that last hint display for more than one second?
2
votes
1answer
51 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 [...
1
vote
1answer
30 views

Can't change company coq mode map

I installed a minor mode for coq-mode, called company coq. It binds the <menu> key to company-coq-toggle-definition-overlay here: (defconst company-coq--core-map (let ((cc-map (make-sparse-...
0
votes
1answer
29 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 ...
1
vote
0answers
22 views

C-< and C-, keys are echoed as C-\ in no-window mode

I'm trying to edit multiple lines with multiple-cursors package. MC package has C-< keybinding but when I do C-< (Control+less-than sign) it is echoed as C-\ (Control+backslash). I don't know ...
1
vote
1answer
26 views

remove keybinding from ess-extra-map

Related: https://stackoverflow.com/questions/7598433/how-to-remove-a-key-from-a-minor-mode-keymap-in-emacs How can I find out in which keymap a key is bound? There is a default keybinding in ESS ...
0
votes
1answer
34 views

How to use unbound keys as “non-sticky” modifier keys

I would like to setup keyboard shortcuts with other keys that traditional modifier keys, as modifier keys. example : bind "f1-left" ( so F1+←) to a command. But not bind the sequence F1 ← to the ...
0
votes
1answer
63 views

How to set key binding for read-only-mode? in order to simplify cursor movement

moving point command: next-line, previous-line, forward-char, backward-char, etc. How to omit Ctrl key in read-only-mode? How can I combine with read-only-mode-hook to automatically enable keybind ...
0
votes
0answers
26 views

Translating C-M-S-s to H

I followed a Linux tutorial that turns the Caps Lock key into the hyper modifier, so I defined some keys such as H-b. I'm using the same Emacs configuration on macOS, so I tried to map caps lock to ...
0
votes
2answers
81 views

Trouble binding C-return: C- must prefix a single character

This is what I have: (add-hook 'magit-status-mode-hook (lambda () (local-set-key (kbd "<C-return>") 'magit-diff-visit-file-other-window))) Opening a magit-status buffer fails with "C- ...
1
vote
1answer
30 views

With “japanese” input method, unmap kanji selection via the spacebar?

In emacs-26.1, I am enabling the Japanese input method as follows ... (toggle-enable-multibyte-characters 1) (set-language-environment "Japanese") (set-input-method "japanese") (setq coding-system-...
0
votes
0answers
52 views

Howto define TAB and S-TAB in keymap of custom mode

I'm trying to bind the TAB and shift TAB keys to a custom readonly buffer mode. The skeleton of the mode looks like this: ;; 8< --- exmode.el ------- (defun exmode-i () (interactive) (message ...
3
votes
1answer
77 views

What is the point of the Ctrl-M binding? Can I overwrite it if I use the Return key?

Looking for a new convenient keybinding for a frequently used command I stumbled upon Ctrl-M which is the same as Return/Enter. What is the point of this binding? Can it cause some problem if I ...
0
votes
0answers
57 views

<M-S-return> (org-mode) failing on Windows install

I've just installed Emacs 26.2 on a Windows 7 machine. This is a clean install, with no previous version of Emacs installed. Editing an Org file, I want to insert a new TODO item using "M-S-return". ...