Questions tagged [key-bindings]

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

97 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
5
votes
1answer
183 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
151 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
332 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
758 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
103 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
145 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
0answers
32 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
615 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
37 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
0answers
20 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
144 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
54 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: ...
2
votes
0answers
82 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
34 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
168 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
1answer
160 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
293 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
191 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
125 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
70 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
676 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
0answers
22 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
0answers
23 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
28 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
43 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
54 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
22 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
180 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
117 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
1answer
192 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 ...
1
vote
0answers
129 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 (...
1
vote
0answers
99 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
34 views

How to graphically represent Meta characters

Given that the variable x contains the numeric representation of the key "Control-Z", say (setq x ?\C-z), one may graphically represent its contents by issuing the command (char-to-string x), ...
1
vote
0answers
151 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
148 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
392 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
1answer
267 views

Setup a local key for help in tide

I'm trying to setup the F1 key for documentation within typescript mode only. Here is what I got so far. (use-package tide :init ;; (add-hook 'before-save-hook 'tide-format-before-save) ;; ...
1
vote
0answers
125 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
0answers
191 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 ...
1
vote
0answers
90 views

Spanish keyboard set ! to ¡

I'm using emacs 26.0.50.1 in my spanish laptop and keyboard. Emacs has binding to the ! key for examle M-! => M-x shell-command In a Spanish keyboard this is impossible (at least for me) to amke ...
1
vote
0answers
13 views

What is the <select-window> key on the Apple extended keyboard?

[OS X 11.6, Emacs 25.1] Using my Apple Extended Keyboard I just stumbled on an Emacs key called <select-window>. It is bound, naturally, to select-window. I discovered the key by accidentally ...
1
vote
0answers
489 views

Ubuntu Emacs Meta Key problem related to keys

I'm using emacs 24.5.1 on ubuntu 16.04 on a Vaio x64 pc. earlier I ran the emacs tutorial and got through it completely no problem. Then I started playing with the "replace-string" command and now my ...
1
vote
0answers
77 views

Make backspace(+?) remove a level of indentation in ReST mode

I often find myself in the situation where ReST-mode has correctly identified that my last line can be followed by an idented line, but I want to continue on the next higher level of indentation. How ...
1
vote
0answers
406 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 ...
1
vote
0answers
88 views

How do I run a function upon pressing a prefix key?

Trivial example of what I would like to do: (define-prefix-command 'my-prefix-map) (defun populate-my-prefix () (define-key my-prefix-map (kbd "a") #'move-beginning-of-line)) (define-key global-...
1
vote
0answers
566 views

Map ESC to keyboard-escape-quit

I like Emacs but I hate the default shortcuts. I'm trying to make them more like Sublime Text, Atom, ... Most shortcuts I can change without a problem, but ESC seems to be more difficult. I don't wont ...
1
vote
0answers
196 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") (...
1
vote
0answers
29 views

How to mark all entries for particular feed as read in newsticker?

I've got bunch of rss feeds in newsticker and it's nearly perfect but poorly documented. Sometimes people reinstall their blog software (wordpress is particular pile of crap in this regard) and as a ...
1
vote
0answers
66 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: ...
1
vote
0answers
180 views

How to keybind helm-projectile-other-file

I like using helm-projectile-find-other-file to switch between header and cpp files, for example. I tried to keybind it to C-c h with the following in my .emacs: (global-set-key (kbd "C-c h") 'helm-...