Questions tagged [key-bindings]

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

166 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
5
votes
1answer
220 views

Forcing keys to run emacs commands instead of other app's commands

I am using Mac OS X Yosemite if this matters at all. Is there a way, while in the emacs GUI, to force every key combination to run the emacs command specified by this key binding instead of other ...
4
votes
1answer
346 views

`<dead-grave> is undefined`

for a few month, I use Emacs for Latex, and I am French. today (for the first time) when I use C-c ` to see my errors, Emacs answers <dead-grave> is undefined I try to add in my .emacs (...
4
votes
0answers
219 views

How to make Emacs not intercept Command-Ctrl-Space, used for Special Characters on macOS?

On macOS the CommandCtrlSpace shortcut opens an Emoji picker which can be expanded into a Special Characters picker. But when I type this shortcut on Emacs in order to input a character, instead of ...
4
votes
0answers
452 views

Detect keyboard layout?

Q: how can I detect the keyboard layout from Emacs? I'm writing some code that will set keybindings dynamically by selecting easy-to-reach keys (eg, those on home row). To do this, though, I need to ...
4
votes
0answers
1k views

Why can't I remap the laptop fn key modifier?

I've remapped the laptop key fn to Hyper using: (setq ns-function-modifier 'hyper) to scroll other window I set (global-set-key (kbd "H-n") 'scroll-other-window) (global-set-key (kbd "H-p" ) '...
3
votes
0answers
17 views

Look up the key bound to a definition in a specific keymap, ignoring indirect bindings

How can I look up what key(s) are bound to a particular definition in a keymap? Basically the converse of lookup-key. where-is-internal is almost the answer I'm looking for, but it doesn't seem to ...
3
votes
0answers
2k views

Meta key in Mac for Emacs

I have been working with GNU emacs on a Linux server but my keyboard is for mac. I have a problem with defining the alt key as meta. tried (setq mac-command-modifier 'meta) in ~/.emacs.el and then ...
3
votes
0answers
66 views

Preferring org-cycle to yas-expand when hitting tab

If both org-mode and yasnippet are active, tab will expand a snippet if possible and otherwise execute org-cycle. Is it possible to reverse this priority? org mode version: 9.0.9. yasnippet version: ...
3
votes
1answer
173 views

Horizontal Scroll Wheel on Mouseover Buffer

My mouse has a horizontal scroll function, where I can tap the scroll wheel left and right to scroll horizontally. By default, it seems Emacs does nothing with that. The scroll wheel produces <...
3
votes
0answers
185 views

How to disable/ignore all key-bindings for a file-formats mode?

There are some file-type modes I mainly use for syntax highlighting (some other features may be handy - eldoc for example), however when loaded they add key-bindings that override my existing bindings....
3
votes
0answers
188 views

How to ignore Caps Lock state for keyboard shortcuts?

When Caps Lock is on, typing commands may bring surprising results, because the capital letters are used instead of what has been intended. In some modes it leads to deleting large chunks of texts, ...
3
votes
0answers
808 views

How to disable the map from esc to meta?

I installed the oh-my-emacs configuration and try to use emacs in the terminal. oh-my-emacs configuration enables evil-mode in default, and my problem is that, I found esc is mapped to meta, while ...
2
votes
1answer
52 views

How show corresponding key binding of command during M-x completion?

Linux Mint 20 Emacs 27.2 ido-mode When I press M-x then show (ido-mode) the list of functions. Nice. But sometime it is not enough. I need to know what is keybinding for this functions. Is it ...
2
votes
0answers
33 views

Get keymap that called function

I am trying to write a function that can be used to make a keybinding "remember" the key sequence that led up to the function being called. (defun modal-function (func) (funcall func) (set-...
2
votes
2answers
431 views

Show Link Tooltip mouse over with keystroke

When I use mouse-over on an Link (thanks to Tobias) it shows an Image and text. When I used display-local-help the image disappeared (perhaps due to lack of space in the message area). I want to ...
2
votes
1answer
417 views

Whenever I type a caret in emacs, it waits for me to type another character. Can I disable that behaviour?

I'm a relatively new user to emacs, having just come over from many years of using vim. I'm mostly thrilled with evil mode and emacs in general, but there are a few annoyances still lingering. One of ...
2
votes
0answers
215 views

how can i thoroughly change (key “C-x”) in ivy-minibuffer-map?

one thing very interesting, i tried to (define-key ivy-minibuffer-map (kbd "C-x") 'ivy-kill-line) ..well then i restart my emacs, the first time i use the ivy to complete something, i type C-x ...
2
votes
0answers
26 views

How to reliably redefine scroll wheel in isearch? [I'm using Mitsuharu Yamamoto's Mac port]

I decided to define <wheel-up> and <wheel-down> to isearch-repeat-forward and isearch-repeat-backward in the isearch-mode-map. This works, but if you scroll quickly, it reverts to ...
2
votes
0answers
228 views

How does one set input-decode-map on GUI frames in emacsclient?

I'm trying to adjust bindings in input-decode-map (to distinguish C-m and RET in GUI mode). None of the advice given on Stack Overflow, gnu.emacs.help, Reddit, or Super User seems to work. I ended ...
2
votes
0answers
36 views

Record Emacs interactive function invocations

I want to optimize my keybindings, in a way that the more a command invoked interactively, the more accessible will be a key-binding for it. Is there a way to record all interactive function ...
2
votes
1answer
3k views

How to assign TAB to indentation and to yasnippet expand key

i'm trying to have the key TAB to: Indent my code (like in any other text editor) Trigger Yasnippet I have theses lines in my config: (global-set-key (kbd "TAB") 'yas-expand) (global-set-key (kbd "...
2
votes
0answers
253 views

Dead keys not working in Emacs OSX

I created a custom keyboard layout (using ukelele) where I use F1-F4 as dead keys to input pinyin (accents for tones). Is there a way to get it to work in emacs? I tried the (require 'iso-transl) but ...
2
votes
2answers
719 views

auto-complete Key binding doesn't work in one emacs mode

I have changed the keybindings for yasnippet and autocomplete so that I can use tab for indentation anywhere in a line without accidentally autocompleting or inserting a snippet. I have this in my ...
2
votes
0answers
680 views

`which-key` displays “lambda” when keybinding bound to lambda expression

I'm using the which key plugin in my emacs setup and I notice that when I set a key binding in a keymap with a lambda expression, like this (define-key my-yank-keymap "l" (lambda () "Yank whole ...
2
votes
0answers
311 views

Equivalent to vim's nnoremap?

Just began transitioning from vim to spacemacs and I can't find a way to define keymappings such as this: nnoremap N Nzz I tried defining it like this: define-key evil-normal-state-map (kbd "N") (...
2
votes
0answers
83 views

using prefix binding along with Key-chord binding

I am using my capslock key as a prefix key and have already set "capslock-v" to 'helm-show-kill-ring. This however does not work with copying outside code into emacs so now I want a set up as such: ...
2
votes
0answers
507 views

Pressing both Ctrl keys at the same time is recognized as Ctrl plus Meta

When pressing both C at the same time, the combination is recognized as C-M on a Win7 machine and Emacs 24.5. I've stumbled on this by mistake while pressing C-C-SPC. While on a Linux machine, this ...
2
votes
0answers
243 views

Trace Evil-mode commands

At the moment, I only know one way to determine which Emacs functions are called by any given Evil command (e.g. a sequence of key bindings in the Normal state): read the Evil source code. Is there a ...
2
votes
0answers
161 views

How to bind a keycode to hyper key in Aquamacs

I am using Aquamacs. I have used Seil to change my caps lock key to emit key code 110. I would like to bind that code to super/hyper/another modifier so that I can create more key combinations. How ...
2
votes
0answers
92 views

Is it possible to use the mouse wheel for company mode?

I'm using the Cocoa version of Emacs. When company mode presents a list of completions you can use the mouse to select one. It would seem natural to be able to use the mouse wheel to scroll through ...
1
vote
0answers
19 views

How to define global keybinding for `C-c >` and `C-c <` using defhydra

I am trying to apply following solutions's keybinding to overwrite all mode's keybindings for C-c > and C-c <. From the answer for Can we do C-c > and > and > to continue indentation: (...
1
vote
0answers
18 views

Mac OS and possibly other GUIs: Why is default “s-g” behaving differently from “C-s” in isearch-mode

I don't really want s-g to exit the Isearch minor mode but it does. The reason this is happening to me is unclear, because investigation of the binding of s-g reveals it is supposed to be a standard ...
1
vote
0answers
75 views

How to set major mode localleader keybinding to both `SPC m` and `comma` in Doom

I want to be able to use both SPC m and , as major mode localleader keybinding in Doom. With my current Doom setup, I can only use , as localleader key. SPC m is undefined currently.
1
vote
0answers
38 views

How to specify that a package uses my key bindings

For example, I use M-s as isearch-forward: (global-set-key (kbd "M-s") 'isearch-forward) When I try to install isearch+ with use-package: (use-package isearch+ :straight t) I get the ...
1
vote
1answer
344 views

Can I use Right Alt/Ctrl Keys as Alt/Super/Hyper modifier keys of Emacs in Windows 10?

I noticed that I've rarely used Right Control Key and Right Alt Key in my keyboard, so I'm wondering if I can use them as Alt/Super/Hyper modifier key in Emacs. Is such a thing possible in Windows 10? ...
1
vote
0answers
36 views

Autocomplete when editing file links

When I insert a link into an org-file using C-c C-l (Doom Emacs, if that matters) and select file:, it show me the files in the current directory to autocomplete from. However, when editing such a ...
1
vote
0answers
23 views

Is the Hyper modifier key usable on non-X11 platforms?

I have a hyper modifier setup, however I was wondering if it's possible to use this on any windowing systems besides X11, for example: macOS Wayland Win32 The terminal.
1
vote
0answers
38 views

keybinding behavior and smartparens

I am using a german keyboard layout and because it is very annoying to type curly brackets I have remapped them to C-7 and C-0 in addition to the default binding AltGr-7 and AltGr-0. I also want to ...
1
vote
0answers
26 views

Don't understand the keybinding for auto-yasnippet

I am looking to use auto-yasnippet but I don't understand the keybindings they are suggesting such as H-w and H-y. I haven't seen any keybinding that starts with H so I am not sure what that is. I ...
1
vote
0answers
95 views

How to remap meta-arrow keys in org-mode

Say I want ctrl-shift-arrows to do what meta-arrows normally do in org-mode. How do I do this? I tried (define-key org-mode-map "C-S-<up>" 'org-meta-up)) (and so on for down, left, ...
1
vote
0answers
37 views

Ignore meta key when inputting unicode on OSX

I'm a newbie running emacs 26.3 (9.0) on OSX in the graphical mode (i.e. not in the terminal) and am writing a document with Devanagari (sanskrit text). Some of the letters in the inbuilt devanagari ...
1
vote
0answers
59 views

Show custom key-bindings in the list of commands

I'm using merlin in Emacs, and in my init.el file I have the following : (global-set-key (kbd "C-c t") 'merlin-type-expr) But when I press M-x and type merlin to show the list of commands (...
1
vote
0answers
32 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? ...
1
vote
0answers
72 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
0answers
38 views

Keybindigs conflict between minor modes

The configuration that I have for python mode implies loading both elpy.el and python.el. The things is that I found the python.el keybindings more natural than the elpy.el ones. And most of the ...
1
vote
0answers
76 views

How to navigate SPC commands with Vim cursor?

I am very used to Vim keys BUT I love to use Emacs. That's why Spacemacs in Evil mode is perfect for me. There is one thing I still cannot figure out how to do. I don't know how to use h,j,k,l for ...
1
vote
1answer
384 views

spacemacs - rebind existing keys

I am trying to rebind j, k key as well as capital E, B and Y, but cannot get them to work. Any pointers? I put this into my .spacemacs (in dotspacemacs/user-config): (evil-define-key 'normal key-...
1
vote
0answers
81 views

unbind ALL C-x and C-c shortcuts in org-mode with CUA-mode

For a special purpose application of emacs with org-mode I want to dramatically simplify the shortcuts. I'm already quite satisfied with my config based on CUA mode. The one thing that bothers me ...
1
vote
0answers
540 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 ...
1
vote
0answers
41 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-...