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.

1
vote
1answer
65 views

How can I disable the “<C-lwindow> is undefined” error?

I use Windows 10's virtual desktop feature. The hotkey for switching between virtual desktops is Ctrl-Win-Left / Ctrl-Win-Right. When Emacs is focused and I want to switch dekstops, I get an error ...
1
vote
1answer
86 views

Perform key translation in a major mode

key-translation-map allows you to globally translate keys. For example: (define-key key-translation-map (kbd "<f11>") (kbd "<f12>")) But what if I want to restrict the remapping to a ...
0
votes
1answer
98 views

How to define keys in evil mode command mode

I'm trying to create a shortcut in command mode. Basically, by typing :bl, I want it to execute gud-break. I tried the following (evil-define-key 'insert c-mode-map (kbd ":bl") 'gud-break) However, ...
2
votes
1answer
27 views

Keymap doesn't work as is when you use some multiple modifier keys

When I define and evaluate some complicated key combo like below and try to run it, I get an error. (global-set-key (kbd "s-C-M-r") 'newline) The error: <C-M-s-268632082> is undefined I can ...
0
votes
1answer
105 views

Set keybinding to `C-c \`

How can I set a keybinding to something to C-c \? I tried with this but it does not work (global-set-key (kbd "C-c \\") 'something) Evaluating this gives me the error Key sequence C-c \ starts with ...
0
votes
1answer
45 views

Call a function by its key (inside a script)

I have a tool that allows me to use the same key (shortcut) C-c C-f to call different functions. Actually I can choose different options (different functions) to pass to the LaTeX compiler, binding ...
1
vote
1answer
42 views

Binding the “Insert” key when running within a terminal

I accidentally hit the insert key so often that I put some code in my .emacs to disable the overwrite-mode key binding: (define-key global-map [(insert)] nil) (define-key global-map [(control insert)]...
0
votes
0answers
34 views

Bind M-[ and M-] when not in a terminal

What is the correct way to bind keys only for X frames? E.g. some key combinations are part of terminal escape sequences, but otherwise should be bindable when not running in a terminal. Currently, I ...
0
votes
1answer
34 views

How to find all active bindings which act on a region?

As explained https://emacs.stackexchange.com/a/733/ C-h b lists all bindings available in a buffer. Is there a way to list all bindings which act on a region? For example C-w (kill-region) is one of ...
3
votes
1answer
115 views

Cua-mode and keyboard macros

I have just started using emacs, so I decided to use cua-mode. I got this weird problem when I'm using macros and copy/cut (C-c/ C-x). let's assume this simple macro for example: <F3> C-S-right ...
2
votes
1answer
306 views

How can I get winner-mode to not modify my keybindings?

I am trying to bind C-c u and C-c r to winner-mode's undo and redo in my ~/.emacs: (global-set-key (kbd "C-c u") 'winner-undo) (global-set-key (kbd "C-c r") 'winner-redo) However, this doesn't work ...
0
votes
1answer
88 views

C-RET not recognized by Emacs in terminal [duplicate]

Attempting C-c C-RET gives me the following: C-c RET is undefined Any thoughts on what is happening here?
0
votes
1answer
83 views

ztree - use-package key bindings

I tried to set key bindings to ztree (dir and diff), but they are not working after the emacs startup (there is no errors). f8 and C-f8 works but not the navigation keys. Pleas help. When I eval my ...
0
votes
1answer
139 views

Save Nano File on Terminal through 'ssh'

I've accessed a server through the ssh mode in Emacs. I need to create and save a file on the server. I can open a file through nano <filename> and start to type. However, I'm unable to close &...
1
vote
2answers
78 views

Proper way to bind multiple commands to the same key

I am curently redoing my Emacs config and I am switching from autocomplete to company-mode. I want to toggle company-complete with TAB. The issue is that when I do so all the other TAB commands do ...
10
votes
1answer
422 views

decrease time until “C-x-” shows in echo area after pressing the keys

When I try enter commands via C-x, it takes 1-2 seconds until the echo area shows this prefix key, as C-x-. I'm quite new to Emacs, so this often confuses me, and I get lost. The ESC key acts ...
1
vote
0answers
82 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
155 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
2answers
166 views

Disable minor mode when in another minor mode

I'm running a distribution of spacemacs and am currently working in clojure's cider debugger, and an issue I've run into is that several of the cider--debug-mode keybindings are shadowed by evil-mode. ...
0
votes
1answer
148 views

evil quit-window and evil-record-macro integration

I am trying to replicate emacs standard behavior when it comes to 'q', i.e. when in a buffer where insert mode does not make sense 'q' closes it. So I defined the following function (defun evil-new-...
0
votes
1answer
397 views

Unable to bind SPC as a prefix in general (evil mode)

My setup worked perfectly fine, however I recently reinstalled Emacs and therefore updated all packages as well when starting for the first time. Since then I cant get rid of the warning/error: ...
0
votes
1answer
130 views

Enter does nothing in NeoTree

I have NeoTree installed. When I navigate through folders and files in it and when I press enter, nothing happens. I don't get into a directory. I've tried TAB also -- nothing. M-x describe-key ...
1
vote
0answers
107 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
1answer
169 views

How do I create a fully customized keymap, so that I can use that instead of the default global one?

My .emacs file is over 1500 lines long mainly because of unbinding a ton of global keybinds. I've searched all over and could find no tutorials for making a fully customized keymap from scratch. I ...
0
votes
1answer
68 views

Why can't I bind tab to multiple spaces? [duplicate]

I'm trying to bind tab to either a tab or multiple spaces in Latex/ESS-noweb mode but I can't get it to work. I tried (local-set-key (kbd "<tab>") 'self-insert-command) which didn't work, and ...
2
votes
2answers
156 views

Making Keys Pass Completely Through Emacs

An Autohotkey remapping script I'm using uses the function keys F13-F24 to keep track of layers. This means that {F13 Down}, for example, may get sent as a virtual key code. This works fine for most ...
14
votes
3answers
4k views

What is the longest known key sequence in Emacs?

Qt supports Emacs-style keybindings, however for only up to four keys. To make a point why this limit should be increased it would be useful to show examples of Emacs-style keybindings with even more ...
1
vote
1answer
114 views

Jump to where a keybinding is defined?

It is possible to jump to the function that a keybinding is mapped to (via describe-key). Is it possible to jump to where the keybinding itself is defined? Example (define-key my-mode-map "a" 'my-...
1
vote
1answer
202 views

Bindings for source code when debugging in gdb/gud

We can define a bunch of bindings for gud-mode through gud-mode-map. But it seems these bindings only hold when the active window is one of the dedicated gdb windows (or simply the comint window if ...
4
votes
1answer
242 views

Which is a faster argument to pass: kbd, string, or vector?

When specifying a key sequence you have the option of using a kbd, string, or vector. Which one of these is faster? More efficient? Optimal in particular situations? Any trade-offs? Please list your ...
3
votes
1answer
329 views

evil (vi) keybindings for customize-mode

A recent convert to Spacemacs and I'm having trouble trying to change the keybindings in customize mode. From a customize buffer I can change the state with M-m SPC evil-evilified-state and then it ...
4
votes
0answers
139 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 ...
3
votes
2answers
568 views

How to create Spacemacs keybinding starting with “SPC”?

I'm trying to add a keybinding by doing the following: (global-set-key (kbd "SPC-;") 'spacemacs/default-pop-shell) but it gets interpreted as the separate keys S, P, etc and produces the error: ...
0
votes
1answer
186 views

Emacs shortcuts in Mac are worse than in Ubuntu?

I just moved from Ubuntu to Mac. Maybe I'm wrong but I found the shortcuts in Mac Emacs is harder to use than in ubuntu. Such as I have to frequently use the "Arrow" in Mac to select texts while in ...
3
votes
1answer
47 views

How to “swap” only the numerical row of a keyboard inside Emacs?

My question is: when I am editing (La)TeX code, regularly I need to type the famous dollar signs in order to put mathematical code ($x^2+y^2=z^2$), a very frequent thing indeed. Therefore, I would ...
0
votes
0answers
47 views

Can't customize xah-fly-keys

I've read the documentation about customizing but I think my knowledge of Lisp is limiting things a bit. I want to bind a in command mode to move-beginning-of-line and QWERTY q (Dvorak) to move-end-of-...
2
votes
0answers
168 views

Interactive lambda functions [closed]

How do I create interactive lambda functions? (use-package general :ensure t :config (general-evil-setup t) ;;(setq general-default-keymaps 'evil-normal-state-map) (general-define-key :...
1
vote
1answer
92 views

What does emacs want for non-ASCII keys

Under Debian-Jessie, Emacs recognizes qualified special keys, e.g. C-<home>, in an X terminal (e.g. mate-terminal) but in TTY it does not. I have corrected this by making a replacement keymap, ...
4
votes
1answer
66 views

What's the difference between C-u C-u C-u <Command> and C-u 64 <Command>?

In org-mode, C-u C-u C-u Tab expands all trees. When I wanted to check what it's bound to, I wasn't able to do that using C-h k as it quickly told me what C-u is bound to. From experiments, I know ...
2
votes
1answer
201 views

Customize Xah Fly Keys

I am using Xah Fly Keys. How should I change the function one of Xah Fly Keys key bindings calls? For example when in Xah Fly Keys command mode space c . calls the find-file function but I would ...
2
votes
1answer
50 views

Define widget key bindings

The following code: defines a major mode my-mode where C-d binding is redefined; opens a my-mode buffer inserting an editable-field widget. (require 'widget) (require 'wid-edit) ;; Define ...
1
vote
1answer
34 views

Why do I have to double-press alt/option to get a meta key?

I'm using Aquamacs 3.3 GNU Emacs 25.1.1 under MacOSX 10.12.6 (Sierra). It's a fresh install of the operating system and aquamacs. Instead of just doing option-g to get meta-g like I used to, I now ...
1
vote
1answer
83 views

Matching key-bindings between modes

I'm new to emacs, and I'm trying to set it up as my editor for both python and R. Elpy and Ess are both great, and I'm relying on them a lot. However, I'm used to the Ess key-bindings, and would like ...
2
votes
1answer
154 views

rebind C-RET in cua-mode to a different key?

I use column editing in cua-mode (cua-selection-mode) a lot. A main issue I have is that the most frequently used keybinding, C-RET (Control + Return), doesn't work in most terminals (Ubuntu 16.04, ...
0
votes
2answers
102 views

Emacs Prelude key binding for bury-buffer

Does Emacs Prelude provide a key binding for bury-buffer, which I use very frequently?
0
votes
3answers
102 views

Dired+ key binding issues in terminal emacs

Using the Dired+ library, and running Emacs in a terminal, all arrow keys in dired buffers invoke M-O (which is bound to diredp-chown-this-file) instead of correct <left> <right> <up&...
3
votes
1answer
196 views

Priority of keymapping commands

In another question (IDO rebind C-j to C-<RET>), Seraph asked about defining the <C-return> key for ido-mode. It turned out that the key was already bound in cua-global-keymap, which ...
2
votes
1answer
182 views

Key binding to a sequence of commands

I'm trying to define a key binding that executes a sequence of commands. I add this code to my ~/.emacs file (require 'origami) (defun open-close-node () "Open/Close node origami mode" (...
0
votes
1answer
125 views

Custom keybinding for jumping down 2 lines on spacemacs (evil-mode)

What I want is to have the option to scroll faster. Currently when in evil-mode normal state when I press j evil-next-visual-line is called. If I hold jthen the cursor moves down. What I want is ...
1
vote
2answers
99 views

IDO rebind C-j to C-<RET>

How to set it? I tried (add-hook 'ido-setup-hook (lambda () (local-set-key (kbd "C-<RET>") 'ido-select-text))) and (define-key ido-common-completion-map (kbd "C-<...