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
1
vote
1answer
13 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 [(...
0
votes
0answers
10 views

Mimicking the action of `C-c C-n` in ess-R to work similarly in Python3

When one uses the ess ( emacs speaks statistics ) package written for R, C-c c, runs the whole buffer in the R interpreter in the other window. But, C-c C-n just runs one line which is sometimes ...
0
votes
1answer
17 views

How to bind a terminal command to a key for python code autoformatting using autopep8

I'd like to autoformat my python code from the buffer that contains it with a key. I was looking at this tutorial. One can autoformat the code from the terminal with the command: autopep8 --in-place --...
0
votes
0answers
17 views

How can I prevent opening URL in the browser using `cmd+ret` in org-mode

If I am on top of a URL and pressed Ctrl+Enter (C-m), it opens the link on my default browser. I just want to have default behavior of C-m, which is new-line. Is it possible to prevent this while ...
0
votes
0answers
20 views

itemize shortcut environment in emacs

I know that M-RET creates a \item in emacs (latex mode) even if there is no \begin{itemize} \end{itemize} around. In the case we are not within such environment I am wondering if it is possible to ...
0
votes
1answer
17 views

How to set shortcut for `M-" ` in emacs config file?

I need to assign M-" as a shortcut to some function. How do I do that? Doing this gives error (define-key some-mode-map (kbd 'M-"') 'somefunction)
2
votes
1answer
41 views

How to move from one source block to another, in Org-mode?

Is there a key-binding, command, or even evil extension for Emacs, so that I can move from one source block to another? For example,org-forward-heading-same-level, which is bound in my system to C-j, ...
3
votes
1answer
117 views

Keymap that is dependent on the buffer

I want to create a "toggle shell" shortcut with F1 such that it will run shell when I'm in any other buffer, but will call mode-line-other-buffer when I'm in the shell buffer. What is an ...
0
votes
1answer
35 views

How to remap C-w to quit emacs without saving?

Similar to how I close tabs in Chrome, I would like emacs to behave as if I pressed C-x C-c when I press C-w alone. Is that possible? I don't care if C-w was previously used to do some command. I am ...
1
vote
0answers
34 views

Using define-word

I want to use dictionary on emacs and found define-word. I downloaded it and wrote the following setting in init.el. But, I can't use this and any word return 0 definitions found. Are other settings ...
1
vote
0answers
26 views

How can I get Emacs 21-style file-name completion in GNU Emacs 25.1.1?

How can I make file-name completion in GNU Emacs 25.1.1 act like it did in version 21.x.x? There are a few things that bother me: The *Completions* buffer opens up in a custom fit-to-content window. ...
0
votes
2answers
15 views

Unable to remap mouse under dired in macos emacs

I'm not sure whether this should be considered an appropriate post for emacs.stackexchange, or whether this should go to some sort of macos forum. Please let me know if I need to ask the following ...
1
vote
1answer
66 views

Shift+Ctrl+arrow to enlarge and shrink windows does not work in org-mode

Similarly to what is described here, org-mode overrides C-S-<arrow> key-binds which, in order to control the size of the windows, I have defined as follows: (global-set-key (kbd "S-C-<...
0
votes
0answers
23 views

Cygwin ctrl-number not working (in cli emacs)

Originally posted to superuser. Cygwin ctrl-number is not working in cli emacs. I disabled the mintty options for keyboard shortcuts, so now ^- does work the same as ^u -1. Still, ctrl-number ...
0
votes
0answers
29 views

TAB in Emacs doesn't work properly

My tab key in emacs behaves as follows: Instead of inserting a tab, it now removes all leading spaces of the line: Test Line After pressing the tab key at any position of the line: Test Line ...
0
votes
0answers
13 views

smart-shift: exit 'smart shift keychord'

I use https://github.com/hbin/smart-shift. I bound keys to do smart-shift-left / right But when I press them I stay in 'smart shift keychord' mode and must press C-g to exit. I wonder how to exit ...
0
votes
1answer
29 views

evil-mode unmap TAB key from evil-jump-forward

I use evil-mode and evil-collection. The TAB key is bound/maped (?) to evil-jump-forward. I do not know which of the evil-packages or parts did this. I do not use this function. I need the TAB key for ...
0
votes
1answer
23 views

How can I add global (usable outside of Emacs) hotkeys?

Several applications like Mumble allow the use of global hotkeys that even get intercepted if Mumble is not in focus at the time of the key press. Is there a way within Emacs to create such shortcuts, ...
1
vote
1answer
34 views

Key sequence to automatically make math-mode fragments in org-mode?

My hands are getting lazier every day. Is there a key sequence to automatically type \(_\), where _ just denotes the position of my cursor, when I'm in org-mode? (Or \[_\], of course: same question.)
1
vote
1answer
45 views

Why binding M-Z to a command in org-mode with (define-key org-mode-map (kbd "<M-Z>") 'my-command) fails?

For Emacs 26.3 running in terminal mode, I am trying to map a my-command to M-Z in org-mode by using the following code: (with-eval-after-load org (define-key org-mode-map (kbd "<M-Z>&...
1
vote
1answer
27 views

Can't change keybinding in prolog-mode

I have the following code that is launched on Emacs startup: (defun my-prolog-mode () (define-key prolog-mode-map (kbd "M-a") 'pop-tag-mark)) (eval-after-load "prolog-mode" '(my-...
0
votes
1answer
40 views

bind-keys with a macro for lambda functions

I am trying to bind keys to a lambda function using bind-key.el. I have the following factor macro ;; taken from Emacs Doom (defmacro cmd! (&rest body) (declare (doc-string 1) (pure t) (side-...
3
votes
1answer
356 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-...
0
votes
1answer
11 views

Why do I have missing keybindings for magit in spacemacs?

I am trying to use magit in spacemacs. When I read instructions to use magit, I am instructed to hit spc + g + s. However, when I push spc + g I see only one shortcut which is spc + g + f + s, which ...
0
votes
1answer
30 views

Why emacs opens a menu with the keybinding bound to another command? [duplicate]

I want to use the command just-one-space which is bound to M-SPC, see the describe key associated with it: Unfortunately, if I press M-SPC a menu opens up in Emacs: I was expecting to execute just-...
7
votes
1answer
444 views

`M-[` causes emacs to print weird (possibly escape) sequences

I am using emacs from a remote ssh session. So I ssh remote in a terminal and launch it from there with emacs. When I set the following key binding (global-set-key (kbd "M-[") 'backward-...
0
votes
0answers
49 views

How do you work out the prefix key for a mode map and major mode in which it is activated?

Given the name of a keymap how do you work out the prefix key for the keymap, and the mode in which that keymap can be activated? In the example below org-mode-map, C-c v and <f6> are the ...
2
votes
0answers
59 views

Dealing with aggressive desktop environments

I use Emacs on Linux systems. Nowadays most programs don't use modifiers, except for a few Ctrl-something (e.g., Ctrl-B toggles bold characters practically everywhere), so developers of modern desktop ...
0
votes
0answers
36 views

How to type in multiple nikud characters for a single Hebrew consonant

Emacs 26.1, on debian, set default "input method" for "hebrew" `q' works fine to "switch levels" and type a single nikud character. But, Biblical Hebrew consonants often ...
0
votes
1answer
49 views

Default yank keyboard shortcut does not work

I am using Emacs 27.1 (GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.24, cairo version 1.16.0) of 2021-03-28, modified by Debian). When I hover the mouse pointer over the "copy&...
1
vote
0answers
27 views

On installing a handler for SIGUSR1

The documentation quoted in this answer mentions two different way of installing a handler for a SIGUSR1 signal, namely: (define-key special-event-map [sigusr1] 'sigusr1-handler) and (global-set-key [...
0
votes
2answers
39 views

funcall inside local-set-key

Programming Perl in cperl-mode I often use _ symbol, so I decided to remap it with / symbol, so I could type faster. I created the following functions: (defun add-underscore () (interactive) (...
1
vote
1answer
68 views

I want when "C-w" is pressed, execute delete-backward-char when no region is selected and kill-region when the region is selected

Similarly, I want to delete word backward when C-u C-w is pressed. I would also value recommendation on cut/paste/kill conventions. I tried to bind C-w to delete-backward-char, but kill-region stopped ...
0
votes
1answer
98 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) :...
0
votes
1answer
50 views

How to lists all shortcuts available for currently active major mode? [duplicate]

I simply want to get the list of shortcuts. For example, when my cursor is in Treemacs, I press '?' and then mini-buffer opens which show all available shortcuts. But same thing isn't true for other ...
0
votes
1answer
184 views

How to use Ctrl-C on WSL (key binding conflict)

I'm learning Emacs, using WSL-1 in cmder shell on Windows 10. C-c seems an essential key binding yet on Windows this combination is tied to copy from buffer. Same applies for Ctrl-v - right from the ...
0
votes
0answers
38 views

`C-M-SPC` is not working anymore for `mark-sexp`. It has changed to `C-M-@`. Why did that happen?

I have been using mark-sexp often because I am working with Common Lisp. Until now, the binding C-M-SPC has worked out pretty well. For some reason that I do not understand, the binding has changed. ...
0
votes
1answer
32 views

How to set keybinding to `C-c C-t` in sh-mode?

By default C-c C-t has sh-tmp-file binding in sh-mode, which I want to change.: C-c C-t runs the command sh-tmp-file (found in sh-mode-map), which is an interactive compiled Lisp function in ‘sh-...
1
vote
1answer
343 views

How can I unbind (C-M-x) globally?

I was trying to bind (C-M-x) to er/expand-region but I checked the key combination with (C-h k) and noticed that it was binded to eval-defun. So I tried to unbind it with any of the following commands:...
2
votes
1answer
56 views

What does the `@` mean in key-shortcuts?

For beginners it is sometimes hard to understand the description of key-shortcuts. I found a @ sign in this context; e.g. C-c @ C-f What does it mean? More examples here: https://elpy.readthedocs.io/...
0
votes
1answer
28 views

In Magit, the command `magit-status` opens the buffer with the status buffer. Is there some similar command to do the same but with the Slime's REPL?

I am using Emacs powered with Slime to write code on Common Lisp (SBCL). In addition, I am also using magit. Magit has a handy command called magit-status (C-x g). I use it a lot and I tend to have 2 ...
0
votes
0answers
13 views

find-tag M-. vs Windows 10 emoji [duplicate]

Recent Windows update kills my M-. (Meta-dot) binding, it intercept the keystroke (Windows Key+.) and display the emoji windows. I already try this link https://techcult.com/how-to-enable-or-disable-...
0
votes
0answers
22 views

Using with-editor and custom key bindings

I am trying to use the with-editor package with the kubectl edit command in the kubernetes-el package. I proposed a patch for the same. I am trying to understand how to create custom key bindings like ...
1
vote
1answer
43 views

Bind function key when in python-mode

I want to bind f5 to launch pdb, but the minibuffer always says <f5> is undefined. (use-package python-mode :bind (:map python-mode-map ("<[f5]>" . realgud:pdb)) :...
0
votes
1answer
25 views

How do I bind C-x <someKey> to a key in god-mode?

I really like god-mode (https://github.com/emacsorphanage/god-mode), but one thing that bothers me about it is that i use commands such as C-x k, C-x b, C-x 1 ect. all the time. It doesnt feel ...
1
vote
1answer
24 views

Mollyguard specific functions (delete-frame)?

I have recently started using multiple frames regularly. I keep accidentally hitting C-x 5 0 instead of C-x 5 o. I do want to still be able to close frames, but I want an "are you sure? (y/n)&...
0
votes
2answers
118 views

How can I override an OS keybinding in Emacs?

One of my major modes defines the keybinding C-M-t, but every time I use it, my operating system (Ubuntu Linux) intercepts the keybinding and opens a terminal. The OS keybinding overrides the Emacs ...
0
votes
1answer
71 views

How to override org-mode-map key bindings?

I would like to override the C-c C-j keybinding. I put this in my init file (global-set-key (kbd "C-c C-j") 'counsel-org-goto) However, it won't override the command org-goto (found in org-...
2
votes
2answers
69 views

Wrap all emacs key-bindings ... override command loop?

---+ 1: BRIEF: How can I wrap all or almost all key-bindings? Both those already defined, and those that will be defined in the future? E.g. can you point me to code that overrides the command loop ...
1
vote
1answer
52 views

Create a function that deletes word on point and replace with the yank register on Evil-emacs

I want to emulate this vim remap in evil-emacs (doom emacs). nnoremap <leader>mpp ciw<C-r>0 I want to change the word on point (I don't mind word or Word, just want the evil-change with ...

1
2 3 4 5
24