Questions tagged [key-bindings]

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

129 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
5
votes
1answer
193 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
0answers
191 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
404 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
945 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
1answer
155 views

Is there a way to use CTRL and SUPER key modifiers together in a keybinding?

I would like to be able to use CTRL and SUPER key modifiers together in a keybinding. Since I'm on Mac OSX I use Command key for SUPER modifier. I tried this: (global-set-key (kbd "C-s-i") 'move-...
3
votes
1answer
95 views

Bind keybord shortcuts to a MIDI keyboard?

I'm exploring the possibility of using a programmable keybord like this one: https://storefront.expertkeys.com/startseite/28-expertkeys-ek-20-usb-tastatur-0700587547911.html to expand and simplify ...
3
votes
0answers
61 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
0answers
143 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
173 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, ...
2
votes
2answers
58 views

Zoom with mouse-button + scroll wheel?

I'd like to enable changing the font size by holding down the right mouse button and using the scroll-wheel. Emacs does however treat mouse buttons as keys, so this obviously cannot be achieved ...
2
votes
1answer
77 views

Remapping global keybindings to a prefix command

The following works: (define-prefix-command 'my-map) (global-set-key (kbd "C-@") 'my-map) ;; MacOS (global-set-key (kbd "C-SPC") 'my-map) ;; Windows 10 The following does not: (global-set-key [...
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
0answers
1k 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 problem with defining alt key as meta. try (setq mac-command-modifier 'meta) in ~/.emacs.el and then eval-buffer ...
2
votes
0answers
53 views

Evil keybindings in reftex-toc

I would like to bind j to reftex-toc-next and k to reftex-toc-previous whilst in a reftex-toc buffer. According to the documentation, the keymap active in *toc* buffers is reftex-toc-map. I'm using ...
2
votes
1answer
306 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
233 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 (...
2
votes
0answers
25 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
190 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
98 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 <...
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
0answers
221 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
541 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
276 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
72 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
1answer
172 views

Generate dynamic keybindings depending on keyboard layout

This is a bit of an esoteric request so I will try to phrase it clearly. I am currently beginning to learn colemak and doing so through a series of transitional layouts that go by the group name of ...
2
votes
0answers
359 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
230 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
144 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
84 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 ...
2
votes
0answers
726 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 ...
1
vote
1answer
53 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 -- ...
1
vote
1answer
137 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-...
1
vote
0answers
34 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
21 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
46 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
201 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
51 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
39 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-...
1
vote
0answers
44 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
1answer
102 views

Browse url at point when clicking and pressing super

I am trying to make emacs open the url displayed under the current point when I left click and press the super key at the same time. I am trying with this code but it does not work (global-set-key (...
1
vote
0answers
33 views

Unbind SLIME's slime-edit-uses (M-_)

I installed undo-tree-mode into my emacs. It does have a lot of nifty features, one of them being undo-tree-redo (bound to M-_). It so useful that I put the following code inside my ~/.emacs.d/init.el:...
1
vote
2answers
350 views

Spacemacs: change prefix key from `SPC-b` to `SPC-v`

I use buffer (SPC-b) prefix key very often, and would like to move its keymap to a more convenient key (e.g. SPC-v). Is there a way to achieve this without redefining the entire map? so I would like ...
1
vote
0answers
188 views

Why can't I bind to “M-s” prefix in global-map?

Running the following code: (global-set-key (kbd "M-s s") 'forward-char) Then using the command M-s s outputs M-s s is undefined. I have to bind to override-global-map for it to work: (define-key ...
1
vote
0answers
150 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 ...
1
vote
0answers
245 views

How can I disable the M-h keybinding in org-mode with evil-mode?

The problem seems to be that evil-mode translates the key chord M-<left> into M-h. Unsetting M-h by binding it to nil in the local, global or org-mode map in a org-mode hook does not help.
1
vote
0answers
196 views

How to get hungry-delete working in paredit-mode?

Using hungry-delete is really nice, see this Blog post. But with paredit activated, hungry-delete functions are not triggered. paredit defines <delete> as paredit-forward-delete and DEL as ...
1
vote
0answers
446 views

“<t> is undefined” error on first keypress

So here's a pretty weird issue. Sometimes, when I start my emacs and press a key combination, the message <t> is undefined` gets printed in the echo area, and I need to press the key combo again....
1
vote
0answers
171 views

Key bindings are not recognized with non-Latin keyboard layouts on Ubuntu

A lot of times I have to change the input language of the keyboard (from English to a different one) causing the problem of the Emacs commands to not be recognized. Normally when you press Ctrl+A you ...
1
vote
1answer
2k 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 "...
1
vote
0answers
266 views

Remove all custom key bindings/Reset key bindings to default

I don't know Lisp unfortunately. I have a friend, and I really liked his color scheme/default Emacs setup. However, I hate his hotkeys and I am used to the ones that come as default with Emacs. Is ...