Questions tagged [key-bindings]
Keyboard shortcuts, key chords, key sequences, hotkeys, or any association between key combinations and corresponding actions in Emacs.
1,310
questions
1
vote
2
answers
37
views
Alt+(left/right) arrow doesn't indent in Org mode anymore
I just installed Arch (Arcolinux) and everything works fine except emacs which refuses indentation in Org mode files with the Alt-left-arrow (M-<left>)or the Alt-right-arrow (M-<right>) ...
0
votes
0
answers
46
views
Advanced key reconfiguration under Linux
I'm transitioning to Emacs and trying to reconfigure the layout in a way that reduces the strain on my fingers. One thing I would like to have is the following behavior, which I was told is impossible ...
0
votes
1
answer
26
views
C-M-... bindings in emacs -nw
I have an issue when I run emacs with -nw: all my C-M- bindings stop working, as C (control) doesn't register, and only the M- binding is executed.
E.g:
(global-set-key (kbd "C-M-.") '...
0
votes
1
answer
27
views
How to visit an org-roam node from a link without using the mouse
This seems like a silly question, but how can I visit an org-roam node from a link without using the mouse? I have been looking all over the place and can't seem to find an answer.
Some context: I'm ...
0
votes
1
answer
23
views
Call different functions based on buffer mode
I annotate my reading with org-remark and pdf-annot. They work with EPUBs and PDFs respectively, and are not interchangeable, with inconvenient consequences.
What I would like to do is to bind a ...
0
votes
1
answer
15
views
Problem with key bindings in Emacs in the terminal on WSL
The key binding problem happens only when using Emacs in WSL terminal.
For example:
I can not add priorities on headings with shift+arrow key
I can not collapse all headings with shift+tab
I have a ...
0
votes
0
answers
14
views
Why does this keybinding affect all buffers?
I defined a keybinded to effect the dired-mode-map:
(eval-after-load 'dired
'(evil-define-key 'normal 'dired-mode-map (kbd "n") 'dired-create-empty-file))
when I press n in any buffer, ...
0
votes
1
answer
17
views
How to unbind a key bound by org-mode-map? [duplicate]
I'd like to bind jump-to-register with C-', like this: (global-set-key (kbd "C-'") 'jump-to-register.
However, C-' is already bound to org-cycle-agenda-files.
I tried to unbind C-' with (...
2
votes
2
answers
22
views
Can I bind a key as buffer local but not in the active keymap?
So I'm writing some custom functions to help me editing some guitar chords using LaTeX's songs package. I find convenient to rebind isearch-exit, so that when I press RET, the cursor is left at the ...
2
votes
0
answers
34
views
How do I completely re-define the menubar in 28.2
I have been using XEmacs for years and have completely redefined the menubar for my productivity. I would like to replace XEmacs with Emacs 28.2. I have tried several ways to redefine some menubar ...
0
votes
1
answer
46
views
Stop later modes from clobbering a "global" keybinding
I use ace-window to change windows, with M-o as my key-binding.
However, when I enter a window that is in HTML mode, this gets clobbered to "set face." I'm now stuck in this window, and can'...
1
vote
1
answer
57
views
How to change M-v to use cut-paste?
I am switching from Aquamacs to Emacs on OSX v28.2 and trying to setup my preferred key bindings. I set
'(ns-alternate-modifier 'alt)
'(ns-command-modifier 'meta)
'(ns-control-modifier 'control)
'(ns-...
1
vote
1
answer
14
views
How to switch Ctrl-a and Home in Eshell?
I tried the following, but it does not work:
(add-hook 'eshell-mode-hook
(lambda ()
(local-set-key (kbd "C-a") #'move-beginning-of-line)
(local-set-key (kbd ...
0
votes
2
answers
35
views
Hyperbole mode overrides org mode C-c / binding
I'm trying to use Hyperbole mode while also using Org mode. Org mode has a C-c / binding which is what I wish to do, but Hyperbole mode wants to redefine it. From reading of the hyperbole mode code, ...
1
vote
3
answers
79
views
Seamlessly replace a keyboard input key sequence
I need something like abbrev, just without any extra spaces, including spaces which trigger the replacement. I experimented with keyboard shortcuts, like this:
;;(general-auto-unbind-keys)
(global-set-...
0
votes
1
answer
34
views
Rebind key to a different character in a specific mode?
I already tried some different ways of doing this, but never got it quite right, so I put it here.
When working in buffers using some specific modes (lisp-mode, emacs-lisp-mode) I want to make it so a ...
1
vote
1
answer
32
views
delete backwards until indentation
In my config I have
(bind-keys*
("C-<backspace>" . (lambda () (interactive) (kill-line 0))))
which deletes the entire line backwards until column position 0. I would like to only ...
0
votes
1
answer
20
views
ctrl + pgdn doesn't work with ssh
my .emacs.d/init.el has this :
(global-set-key (kbd "C-<prior>") 'backward-page)
(global-set-key (kbd "C-<next>") 'forward-page)
It works fine on my machine but when ...
1
vote
0
answers
25
views
What is Emacs <select> key?
I'm running Emacs 27.2 inside Ubuntu 16.04 in terminal mode inside a Bash version 4.3.48 shell.
Normally the describe-key for the end keyboard key shows that it's <end>.
However, when Emacs is ...
1
vote
0
answers
25
views
Stop translating M- commands to lower case?
In order to for me to be able to use meta + shift + v as a keybinding, I have to tell emacs to pass (kbd "M-V") to global-set-key - if I try and use (kbd "M-S-v") then this ignored,...
0
votes
0
answers
27
views
Mapping Command key to Control key not working for mac
I am trying to map Command key to Control key, and Option key to Meta key in Emacs for mac. I installed using macports.
I located the init file using describe-variable and user-init-file. I copied ...
0
votes
0
answers
28
views
`general-def` is not defined when used in `pre-` or `post-command-hook`
I have a function hooked to the pre- and post-command-hook, with the following code:
(when (window-minibuffer-p)
(when (featurep 'general)
(if (or (derived-mode-p 'prog-mode)
(...
0
votes
1
answer
20
views
Remapping keyboard accent shortcuts
I have a "UK-English International Macintosh" keyboard, and I use the accent shortcuts quite heavily since I'm French (AZERTY is terrible for programming).
Like option+e for ´, option+` for `...
0
votes
1
answer
48
views
prog-mode-map Keybinding
I'm trying to add a keybinding to prog-mode-map, which is supposed to be valid in all programming maps, but I can't be doing it right, cause I have to add lines, like the second one, to have it ...
0
votes
1
answer
62
views
Keymap define key not working for evil mode
I have read multiple posts on this site to try and solve this issue.
I am trying to define an evil key to nil. Like this:
(with-eval-after-load 'evil-maps
(define-key evil-motion-state-map (kbd &...
0
votes
0
answers
23
views
Remove double invocations from a multiple-cursors hydra
I created a hydra for multiple-cursors for a config. However when I
press the prefix keys, C-c m n
then the [head] (action) key...
the action is doubly invoked.
Said another way, if I my hydra key ...
0
votes
1
answer
27
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 ...
0
votes
1
answer
19
views
Home and End key stop working with M-[ f is undefined
I am running a session of emacs (GNU Emacs 24.5.1) in a qt konsole (Konsole: 2.14.2, KDE: 4.14.21, Qt: 4.8.7) with the command emacs -nw on a local machine. At the start of my session, the Home and ...
3
votes
2
answers
70
views
How do I get regular paragraph movement in org mode?
Org mode overrides paragraph movement to replace forward-paragraph with org-forward-paragraph. How do I access the normal forward-paragraph command?
I'm happy to rebind the org-forward-paragraph if I ...
0
votes
0
answers
12
views
How can C-h apply backward-delete-char when cursor is at superstar-bullet in org-mode
I am using org-superstar-mode with org-mode.
(use-package org-superstar
:after org
:hook (org-mode . org-superstar-mode)
:custom
(org-superstar-remove-leading-stars t)
(org-...
0
votes
1
answer
63
views
How to rebind "gj" for org/evil normal mode?
I want gj keys to execute function org-next-visible-heading (in evil normal mode). How should I do it in Spacemacs?
I was reading documentation and googling but I can't figure it out. What I tried ...
1
vote
2
answers
216
views
Way to keybind «» in Emacs
I would like to be able to keybind « and » to easy key bindings.
At the moment in Emacs the only way to write these latin quotation marks is this:
C-x 8 < and C-x 8 >
I tried the following, but ...
2
votes
2
answers
51
views
How to prevent `M-<digit>` from invoking `digit-argument`?
In Windows, it is possible to type the Alt key together with some number to obtain the character associated to that number.
This is useful when your keyboard is not properly mapped or is missing that ...
1
vote
1
answer
36
views
Can I fix Right Alt in console mode without needing to be root?
I am using MobaXterm on Windows 10 to access a remote Linux machine running RHEL 7.5, but this is generally applicable to Emacs (same things happen with PuTTY, for example). My connection is weak and ...
2
votes
1
answer
99
views
Shift key ignored in C-x Shift-o?
I wanted to define a key binding C-x O (similar to C-x o but with a capital O). Before doing that, I tried it to see if it is already used. But it seems that Shift-o is just treated as o without ...
3
votes
3
answers
209
views
How many keybindings does Emacs have
I use Emacs for few years, learning keybinding from time to time. Often, I forget they after a short time. Now I've started to learn keybindings with Anki. And it raised an interesting question: ...
0
votes
0
answers
22
views
RET after move-end-of-line in org-mode
After an update, I'm no longer able to create a newline after the last org-heading
If I use C-e, it uses org-end-of-line and pressing RET just opens the heading.
If I use M-x move-end-of-line, the ...
0
votes
0
answers
23
views
Disable SPC in spacemacs
In edebug, if I press SPC it should jump to the next stop point. But in spacemacs, if I press SPC, a tips window will appear. So how to disable SPC so that I can use edebug space command?
0
votes
2
answers
78
views
Are C-[0-9] and M-[0-9] completely interchangeable?
In all my exploration, it seems that M-[0-9] and C-[0-9] apply numeric prefixes in the same way everywhere. Does this change for any common modes? I'm considering overwriting one of the sets of ...
1
vote
1
answer
35
views
How to disable `q` key (quit) for *Geiser Debug* window?
The *Geiser Debug* window disappears after pressing q. This is normally good for dismissing the error messages in the window (for scheme). However, I'd like to keep this window open so that I can see ...
3
votes
2
answers
128
views
Override all local keymaps
I have this for exiting emacs:
(global-set-key (kbd "C-M-q") 'save-buffers-kill-emacs)
, but this binding exists in many local maps, so I have to override it:
(define-key lisp-mode-map (kbd ...
0
votes
0
answers
23
views
Unable to Override C-M-t Keybinding
I have a weird problem;)
(defun hello-world ()
"Insert snippet."
(interactive)
(insert "Hello World")
)
(global-set-key (kbd "C-M-t") 'hello-world)
This doesn't ...
0
votes
1
answer
51
views
How can I prevent Ctrl+n to prevent write into buffer?
I am using my-run-latex () function (explained here: How can I run additonal linux commands after compiling a latex file) after each save, which I do very often.
I bound it to: (add-hook 'LaTeX-mode-...
0
votes
1
answer
48
views
How to remap org-capture-templates keybindings?
I mapped org-capture with C-c c like this:
(global-set-key (kbd "C-c c") #'org-capture)
Amongst my org-capture-template, two have been set like this:
("i" "Inbox"
...
1
vote
2
answers
28
views
Org-cycle with TAB from isearch without RET
When I've isearched for something in a headline in org-mode, and my cursor is sitting on the headline I want: how do I org-cycle that headline with TAB? Currently I have to first press RET then TAB. ...
0
votes
2
answers
28
views
How to change the binding of "?" on the help command in ediff-mode?
I am willing to learn how to use ediff-mode.
One of the reasons that I am struggling is because I need to ask for help which is bound to ?. Unfortunately, I am having a hard time with ? on an American ...
0
votes
0
answers
18
views
How to make Emacs show the output of the last key stroke of a (kbd ...) sequence?
I have the following code in my init.el, in which a key stroke (C-c y) is defined a sequence of two other key strokes (C-c C-y C-x C-e). The first one moves up the cursor to the ending parenthesis of ...
0
votes
1
answer
51
views
how to unbind non-breaking space A-SPC
It's right ALT+Space. After 'C-h b' it's first character at list 'Key translations' key: A-SPC.
I tried with (global-unset-key (kbd "A-SPC")) or try to find it with (lookup-key (current-...
0
votes
0
answers
19
views
Bind all company completion to <Tab>
I am bit confused about different company completion modes. How can I make company always accept completion by instead of ?
Currently these three commands I use most:
company-complete-selection
...
1
vote
1
answer
45
views
Keybinding for forward-page and backward-page
Have been trying to make a keybinding for forward-page and backward-page with
(global-set-key (kbd "H-]") (forward-page))
(global-set-key (kbd "H-[") (backward-page))
But these ...