Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [key-bindings]

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

0
votes
0answers
9 views

Calling deadgrep from ido-find-file produces minubuffer error

I'm trying to add a key binding to ido-find-file, so that it calls deadgrep from the current directory. Similar to how pressing C-d from ido-find-file calls dired. The problem is that both deadgrep ...
1
vote
1answer
35 views

use euro symbol (or any symbol) for emacs keybinding

I set up this duplicate line function: https://kundeveloper.com/blog/duplicate-line/ and bound it to the euro symbol like this: (global-set-key (kbd "M-€") 'duplicate-line) And it worked (for a ...
0
votes
1answer
15 views

Binding simple keys in spacemacs

I would like to set a projectile find file function to the hotkey C-e, and a elpy-goto-definition function to the hotkey F12, but I'm not sure why spacemacs is not recognizing the config that I'm ...
0
votes
0answers
30 views

Remapping keys in org mode agenda view

I currently trying to remap my org mode agenda keymap in Spacemacs for org-agenda-next-item and org-agenda-previous-item. In the agenda view I like to map the functions to k for next-line and l for ...
4
votes
2answers
48 views

How to run whichever function is bound to a certain key

There are a lot of occasions where, by default, the key-binding C-c C-c does something useful - e.g. in org-mode or magit. I would like to take whatever function C-c C-c runs, and bind that function ...
1
vote
2answers
40 views

Add additional function to cua-mode processing for `C-c`

I'm running cua-mode, and I'm trying to override the cua binding for C-c so that I can insert a function somefunc before passing the baton to the original cua binding which is cua-prefix-override-...
1
vote
2answers
18 views

Enter a string interactively on specific keyboard shortcut

I'm new to this kind of Q&A site. Now I'm writing some article using Sphinx (reStructured text). Writing an equation (like E = mc^{2}) in Sphinx is a little bit demanding, because you have to ...
0
votes
0answers
19 views

binding a minor mode's function to already defined key in global-map

(use-package anaconda-mode :defer t :config (progn (unbind-key "M-." anaconda-mode-map) (unbind-key "C-_" global-map)) :bind ((:map anaconda-mode-map ("C-_" . anaconda-...
0
votes
1answer
22 views

CC mode: make Tab just insert one tab or complete, no auto-indenting

I am dissatisfied with current behaviour of Emacs in CC Mode. I'm not sure if this applies to other major modes, but that's one I'm currently struggling with. Here are my problems: When I press tab, ...
1
vote
1answer
68 views

Interactive lambda only calls 1 of several functions called in body

In term-mode I've configured the keybindings for term-line-mode and term-char-mode as follows: (setq term-bind-key-alist (list (cons "C-c C-j" '(lambda () (interactive) ...
1
vote
0answers
41 views

cannot rebind M-p [closed]

I try to customize the scrolling experience within Emacs and for that rebound M-n and M-p to a new functionality, namely (global-set-key "\M-n" "\C-u20\C-v") (global-set-key "\M-p" "\C-u20\M-v") ...
1
vote
1answer
35 views

Keybinding fails although it is not set

I'd like to use the key binding M-n p for ess-swv-purl in .Rmd documents and thus tried (define-key global-set-key (kbd "M-n p") 'ess-swv-purl). If I'm in an .Rmd (Rmarkdown) document, M-n p still ...
0
votes
1answer
30 views

Given a keyboard command, how do you find the interactive function? [duplicate]

I have a key sequence for C-u C-c . How would I find the function that's bound to it. I thought it was describe-key but that doesn't seem to work. Cheers
0
votes
0answers
64 views

how to have EMACS use the right alt key the same as the left alt key

I regularly use the backspace key to delete whole words at a time to the left of the cursor, but this would be a MUCH easier keystroke if it could be done one-handed. For that to happen - I would ...
0
votes
0answers
23 views

How can I press a key combination including CTRL and ALT_GR on a Swedish keyboard?

I am running Emacs (26.1 - build 1, x86_64-w64-mingw32) on Windows 10 and I cannot type any key combination including CTRL and ALT_GR on my swedish keyboard. I stumbled on this when I tried to use ...
1
vote
1answer
74 views

Using tab for both cycling and completion in org mode

I use company for completion and I have company-indent-or-complete-common bound to tab for certain modes. In org mode, tab is bound to org-cycle, which either cycles visibility or calls the global ...
1
vote
2answers
36 views

German input method: missing ' (single quote)

I am typing with a German ISO keyboard that I've set to US English in X: setxkbmap -layout us -model pc102 For entering German characters in Emacs, I do: (set-input-method 'german) Some special ...
0
votes
1answer
39 views

How to use `backspace` to navigate to the parent folder in Spacemacs?

When I use C-f to find a file in Spacemacs, how can I use <backspace> to navigate to the parent folder?
1
vote
1answer
26 views

Trying to bind keystrokes to a menu item

I have a menu item added to AucTex's Command Menu, Latexindent. This calls an external process and is added in mu .emacs file by the following: (with-eval-after-load "tex" (add-to-list 'TeX-...
1
vote
1answer
52 views

Keybindings not working?

I'm using spacemacs and I've added the following user config: (defun dotspacemacs/user-config () "Configuration function for user code. This function is called at the very end of Spacemacs ...
1
vote
1answer
51 views

No confirmation for changing global key bindings Interactively in Emacs

I have tried to add global key-bindings to Emacs interactively via M-x global-set-key by following the guidelines in the Emacs Manual. When I add a keybinding though there is no confirmation prompt so ...
1
vote
0answers
42 views

Using keyboard commands

I am Using Emacs GUI on Windows 10 and am having problems entering commands. I am attempting to use C-h t and I am getting the error message C-c h is undefined. What am I doing wrong?
1
vote
2answers
19 views

Unbind CUA <C-return> key only in dired mode

Goal: unbind <C-return> key ONLY in dired mode in order to rebind it to dired-w32explore. My configuration is using use-package with something like this: (use-package dired :init (unbind-...
0
votes
0answers
29 views

Rebind C-x b to ivy-switch-buffer

I find ivy-switch-to-buffer is handy abo-abo/swiper: Ivy Is it possible to bind the function to C-x b Additionally, my C-x C-b is bonded to ibuffer How could rebind it to function 'helm-buffer-list"...
2
votes
1answer
61 views

When using `lisp-state`, how can we repeat an action like slurp, and bind a key to easily perform the repeat?

In vim, I frequently used the "." shortcut for repeating the last command. I found this extremely useful especially when working with clojure tools to do things like slurp-ing and barf-ing to refactor ...
1
vote
1answer
53 views

What function does C-x invoke?

I learned that M-x invokes command execute-extended-command. Extended commands - GNU Emacs FAQ What command does C-x invoke? I looked through the reference but failed to find the answer.
3
votes
1answer
46 views

Binding a key sequence to a key sequence instead of a command

In my .emacs, I tried to use (global-set-key (kbd "M-r") (kbd "C-x r j") so I can use M-r to jump to a register. However, doing this and using the command gives After 0 kbd macro iterations: Args ...
0
votes
1answer
40 views

Emacs subshell: how to select options by moving up and down arrow keys?

I open a subshell session using M + x shell and I create a Nuxt.js application using: yarn create nuxt-app myproject. During the installation process, I am suggested which packages/frameworks/...
1
vote
1answer
51 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 ...
0
votes
1answer
46 views

Unbind all keys from mode

I would like to prevent modes to add any custom keys to emacs. For example this works for default key map: (global-set-key (kbd "C-c") nil) And this works for ensime: (eval-after-load "ensime-mode"...
2
votes
3answers
37 views

Advertise a binding for TeX-next-error in AucTeX

How can I advertise a binding for TeX-next-error in AucTeX?I There are several bindings for next-error, normally C-x `, M-g n, M-g M-n. With (put 'next-error :advertised-binding "\M-gn") I will see ...
0
votes
1answer
50 views

How can I get RET to follow org-mode links when using evil-mode?

In org-mode, the link-following behaviour of RET, that should be present when org-return-follows-link is set, doesn't work in evil-mode. MWE from emacs -q: Load an org buffer containing a link. Note ...
0
votes
1answer
130 views

How do I override a keybinding defined by evil-mode?

I've searched for this before but I've only seen questions like the below: https://stackoverflow.com/questions/683425/globally-override-key-binding-in-emacs How to override major mode bindings I don'...
0
votes
1answer
47 views

How rollback settings without restart Emacs?

windows 10, emacs 26.1 In my init.el (with-eval-after-load 'magit-status (define-key magit-status-mode-map (kbd "C-<tab>") nil)) This disable C-<tab> after magit-status was load. And ...
0
votes
2answers
81 views

Cannot bind <M-s-left>

I use elpy as Python IDE. I want M-<left> and M-<right> (M = alt) not to be overridden by elpy with elpy-nav-indent-shift-left and elpy-nav-indent-shift-left but insted bind these to ...
0
votes
1answer
37 views

Backspace strange behaviour when word selected and cursor after open parenthesis

I got a strange issue when I hit backspace while some text is selected and my cursor is close to an open parenthesis, example: b(aaa) If I select aaa and my cursor is on the first a, I would like ...
1
vote
1answer
117 views

What is the difference between `C-i` and `<C-i>`?

I've just set (define-key input-decode-map "\C-i" [\C-i]) (define-key input-decode-map "\C-m" [\C-m]) (define-key input-decode-map "\C-[" [\C-\[]) in my config, but I noticed that C-i is now ...
1
vote
1answer
49 views

How to disable C-<number>

I don't know the name of the command C-<number> <entry> to repeat the <entry>, <number> times. For me it is more annoying than useful, several times I have accidentally ...
2
votes
1answer
60 views

M-= shortcut suddenly stops working in Emacs in KDE

I'm trying to run M-= on a region of text, but nothing happens. I think the shortcut is registered (I don't get a message like "M-= is undefined") but the execution stops for some reason and there is ...
2
votes
2answers
60 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, ...
0
votes
1answer
31 views

Unexpected behavior of Meta-RET in org-mode

when using lists in org-mode, the Meta-RET binding does not behave as expected. What I expect is that the binding will create a new item at the same level as the previous item. What I get is a new ...
0
votes
1answer
27 views

How to bind a function to the Windows key

I want to bind the function evil-normal-state to the windows key on my keyboard. How do I do that? Also is there a way to bind the Fn key to other functions? I am using Emacs 26.1 on a Linux-Mint ...
0
votes
1answer
68 views

Evil Mode, how to rebind the caps-lock key to go into normal mode

In addition to the Escape key, I would like to go into Normal mode while editing by pressing the caps-lock key. How do I achieve that? Thus far I have been able to disable the Caps-lock key using ...
0
votes
1answer
42 views

Keyboard shortcuts for applying a theme [duplicate]

I want to bind loading a specific theme to a key-binding. However, this does not work. (global-set-key (kbd "C-<f1>") '(load-theme 'zenburn)) I would like Ctrl and the F1 key to apply the ...
0
votes
1answer
22 views

Unable to mark files in directory listing from `C-x C-d`

I was just wondering if anyone has noticed the following behaviour after doing C-x C-d. I use C-x C-d to navigate to a directories and subdirectories with pdfs. Then I try to mark a pdf file with M-x ...
5
votes
2answers
205 views

How do I add custom hierarchical keybindings?

I am looking for a compact way to store a lot of shortcut keybindings. This is my current idea, for which I'm looking for help how to add this into my emacs config: I would like to make F9 "my" key, ...
0
votes
2answers
55 views

Very short key bindings for emacs commands [duplicate]

There are some text actions that I use so often in emacs that the user-made commands I currently use, invoked with the standard M-x ... RET procedure do not satisfy me. I would like to replace their ...
0
votes
3answers
65 views

C-x requires to look down at keyboard, interrupting flow [closed]

I'm trying to get used to emacs (really trying). I use a small apple keyboard. I can't see (in physical terms) how I will ever be able to do C-x without dropping my gaze from the screen and what I ...
2
votes
1answer
25 views

How to bind mouse click to kill an inactive window, but not the buffer

I'm trying to create a binding to kill windows (but not buffers) when they're being pressed by a middle mouse click in their header lines. (Just to note, all windows in my setup have header lines.) ...
1
vote
1answer
24 views

Elpy - Close Window when invoking elpy-shell-kill

Elpy helps a great deal, when editing Python-Code. For example it let's you run the current file with C-c C-c in a new Window with a REPL. When i'm done with this, i can hit C-c C-k (elpy-shell-kill) ...