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
1answer
30 views

Unbind key in org-mode (with evil-mode)

I cannot unbind the key M-l in org-mode. When the cursor is in an org-mode buffer, I tried to eval (M-:) (unbind-key "M-l" org-mode-map) ;; ^^^ from bind-key.el (define-key org-mode-map (kbd "M-l") ...
1
vote
1answer
30 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 -- ...
0
votes
1answer
32 views

Run current line or selection in shell then insert result in Emacs buffer (Acme workflow)

Given lines like these: pwd echo "Hello \ World" in a buffer, I would like to do the following: Put the cursor to the first line, then press C-` Select lines 3-4 then press C-` to send the line ...
0
votes
1answer
28 views

auctex and pdf-tools reverse search change keybinding

Inverse search from pdf-tools to auctex uses Ctrl-click on the pdf file to go to the corresponding part of latex file. Is it possible to also assign Alt-click to do inverse search? I am using ubuntu ...
0
votes
1answer
21 views

Getting a dialogue box of custom scripts

I have a bunch of scripts for managing files/directories that I use on a regular basis. Would it be possible to assign a key binding such that whenever I hit this key binding I get a dialogue box that ...
0
votes
0answers
23 views

Unbind SPC from org-agenda

I would like to unbind the space key in the org-agenda. Currently it is scrolling the org-mode file to the currently selected item in the org-agenda (org-agenda-show-and-scroll-up). I am currently ...
0
votes
0answers
15 views

Get time since last keystroke

I would like to know how many seconds have passed since the last keystroke (or character that showed up in the screen, whatever is easier). Is there a timer that is associated to self-insert-command? ...
0
votes
0answers
36 views

C-c c c to invoke org-capture

In my doom-emacs, "C- n n" will invoke org-capture, I want to change it to "C-c c c" as (global-set-key "\C-c c c" 'org-capture) However, it does not work as expected. How could set C-c c c to ...
0
votes
1answer
14 views

Remove image & link related keybindings in eww

I'm using xah-fly-keys which provides a few custom keys for easy navigation. u = backward-word o = forward-word i = previous-line ... Unfortunately, my keybindings are overshadowed when point is on ...
0
votes
0answers
19 views

How to create a prefix key for the hybrid state in spacemacs?

Prefix key can be created in Emacs as described here. The way to define a key for the hybrid state in spacemacs can also be found in the spacemacs document. However, I don't know how to define a ...
3
votes
2answers
51 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: ...
0
votes
1answer
46 views

Emacs Keybindings

I am using ubuntu 18.04. The Esc-v scrolls up by a page as expected (classical Emacs command with Esc being the meta key). But I want to use Alt-v as a "paste command". In other words: can I decouple ...
4
votes
1answer
183 views

What are these prefix commands that start with s-l?

I'm using lsp-mode, and I see these weird prefix commands that start with s-l. How do I type them? `lsp-mode' Minor Mode Bindings: key binding --- ------- s-l ...
0
votes
2answers
21 views

Call mode-specific backspace from “smart-backspace” function

I'm writing an IntelliJ-style "smart backspace" function which does the following: If the whole of the line up to the point is whitespace Join the line to the previous line, killing that whitespace ...
2
votes
1answer
40 views

define-key doesn't seem to work on certain keymap

I'm trying to add some bindings to undo-tree-visualizer-mode-map. To do so I use: (define-key undo-tree-visualizer-mode-map (kbd "S-l") 'undo-tree-visualizer-quit) But it doesn't work, and if I do ...
0
votes
0answers
22 views

C-g doesn't work within Counsel's action menu (M-o)

Let's say I'm completing a file with counsel-find-file. I then press M-o to show the menu with available actions. If within that menu, I press C-g, I get the message "C-g is not bound". The ...
1
vote
0answers
31 views

How to assign new keybinding to Ctrl-i but keep Tab key unchanged? [duplicate]

I want to give a new key binding to Ctrl-i, but when I do that TAB key also maps to the new key binding that I have assigned to Ctrl-i. => Is there any way to give a new keybinding to Ctrl-i and keep ...
0
votes
0answers
33 views

Why certain rebind keys doesn't work in c++ mode?

I've recently started using emacs and wanted to customize the editor. So, I've tried to rebind certains keys, but It's doesn't to work no matter what I do. (global-unset-key (kbd "C-c") ) (global-set-...
1
vote
1answer
23 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
31 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
28 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-...
1
vote
1answer
17 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
42 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
17 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
35 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
62 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
38 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
20 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
26 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
14 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
104 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
51 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
71 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
64 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
63 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
200 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
46 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
371 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
117 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
138 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 [(...
1
vote
3answers
30 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
77 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
27 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
34 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
37 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
34 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
55 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
26 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 2 3 4 5 19