Questions tagged [key-bindings]

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

Filter by
Sorted by
Tagged with
6
votes
1answer
725 views

How do I bind keys in ido?

I'm trying Projectile + ido + flx-ido (just for Projectile, ido-mode disabled otherwise). But: I don't like using right and left to switch between items. I want to change them into up and down, but ...
5
votes
3answers
357 views

Undefine prefix binding

I've become accustomed to using C-x p for switching to the previous window. And, I recently had to start including a company-wide startup.el file that defines the prefix C-x p-. I don't use any of ...
8
votes
2answers
2k views

Use standard keybindings for copy, paste, cut, etc. as in other software?

I want to use the same basic keybindings for copy (C-c), paste (C-v), cut (C-x), etc. that are supported in some other software. How can I do that?
6
votes
2answers
492 views

Is there a package that can bind S-S (shift-shift) to an interactive function?

IntelliJ has a keybind on a double-tap of Shift. I'm curious if Emacs can emulate this functionality - my first thought was key-chord.el, since it allows double taps of regular keys like qq. But, ...
1
vote
2answers
367 views

How to properly change defcustom prefix key

In a library I use a prefix key defined like this: (defcustom ensime-mode-key-prefix [?\C-c] "The prefix key for ensime-mode commands." :group 'ensime-mode :type 'sexp) In my config file I've ...
13
votes
2answers
2k views

Compose key in Emacs: <Multi_key> is undefined

I set the Alt Gr key on my keyboard as compose key in my system (Ubuntu 14.04) in order to type letters like éóèàùçü and so on. But when I am on Emacs and try to press the Alt Gr key, I have a message ...
3
votes
1answer
206 views

How to change key bindings for Calendar mode?

How to change key-bindings for Calendar Mode only? I'm trying to do something like this: ; original bindings require pressing alt and shift simultaneously ; alt+shift change keyboard layout, so I ...
4
votes
1answer
471 views

Is there a more convenient key binding for RETURN?

Navigation with C-n, C-p etc. is quite easy in emacs, but I have to stretch my hand a lot to hit RETURN. Is there another standard key binding with the same effect as the RETURN key? background of ...
0
votes
3answers
287 views

How can I bind the Ctrl-} key for a LaTeX command?

When working in LaTeX (specifically, with AUCTeX), I want to bind the following functionality to the C-{ and C-} keys: C-{: insert \begingroup followed by a newline C-}: insert \endgroup followed by ...
11
votes
1answer
904 views

Define Control+Shift keys without kbd

I'm trying to add some functionality to someone else's package, and so I'd like to respect their patterns. Unfortunately, one of these patterns is to not use kbd. I need to bind a function to C-S-b, ...
3
votes
1answer
804 views

windmove keybinds are not loaded

I am trying to use windmove with the default bindings and am unable to get the shift key bindings working correctly. When I hit Shift-<up>, instead of selecting another window, the point moves ...
2
votes
2answers
1k views

Keybindings with AltGr

Is there any way to bind a command to a key combination like AltGr-f? The reason I ask is the following: I use the “US international” keyboard layout (on Linux), which remaps the right Alt key to ...
3
votes
1answer
203 views

Bind C-e C-j and C-a C-o TAB to single key, aka insert and jump to newline

C-e C-j will insert a newline below and jump to it indented. C-a C-o TAB will insert a newline above and jump to it indented. Is there a single bind to these or where/how should I bind these commands?...
1
vote
1answer
229 views

“S” key throws error in Evil mode normal state [closed]

I really like typing in vim, but vimscript makes zero sense. Since I'm getting interested in Lisp/Clojure, and I've heard nice things about evil mode for emacs, I thought I'd give it a try. ...
11
votes
2answers
751 views

Convert a normal key into a modifier key

I have a keyboard which, for some inexplicable reason, features a key that sends the Danish Dollar symbol to OS X - §. With shift it sends the plus/minus symbol - ±. Is it possible within Emacs to ...
4
votes
4answers
892 views

Repeating a command n times

For posting code to stackexchange I repeatedly have to do indentation in emacs. I mark a piece of text and then do M-X indent-rigidly four times. Is there an elegant way to do this indentation of text ...
4
votes
3answers
848 views

Custom C-M-; key binding

I have a custom comment-dwim-line command that I want to bind to the key combination C-M-; (in other words, control, meta and ; buttons pressed simultaneously). The built-in comment-dwim command is ...
2
votes
1answer
117 views

How to use keybindings containing @ in MacOS X?

I'm using Aquamacs 2.x in MacOS X 10.6. (I'm using the Command key as M and the Ctrl key as C.) WHen I try to use keybindings containing "@", it does not work, e. g. C-c @ C-t in outline-minor-mode. ...
1
vote
1answer
175 views

How do I change a key binding which also has its own prefix key?

I want to change a couple of key bindings for @wasamasa's eyebrowse package, because I'm on a laptop and the keys < and > aren't easy to access. The thing is, this package defines a custom prefix ...
8
votes
2answers
149 views

How to detect keystrokes which don't edit the buffer?

What's the best way to detect keystrokes (e.g. via a hook) which don't edit the buffer? I mean things like arrow-keys for point motion, calls to beginning-of-buffer, etc. The reason for this is that ...
10
votes
1answer
3k views

How to remap Company's select next and select previous keys?

I don't like the default M-n and M-p keys for company-select-next and company-select-previous so I was wondering if it's possible to remap those to C-n and C-p without affecting the mappings when ...
1
vote
1answer
4k views

TAB does not auto-indent lines anymore

I used to have a configuration for TAB which was doing something like this : This is the code before hitting TAB. template<typename T> class A { }; // This is where I hit TAB The code ...
6
votes
3answers
720 views

god-mode: swap keys

I'm using the Dvorak keyboard layout and have swapped C-x and C-t, because I find it easier to type on Dvorak. (define-key key-translation-map [?\C-x] [?\C-t]) (define-key key-translation-map [?\C-t] ...
3
votes
2answers
81 views

How to copy or move code in current scope to end of another file

I find myself refactoring code fairly frequently and my screen space is at a premium. I'd like to be able to move to a particular scope (class, function, or even if-statement/for-loop blocks) and ...
1
vote
1answer
181 views

Elisp: Added one key-binding to dired-mode and lost basic dired functionality

I wanted an alternative to the awful C-^ shortcut for moving up one directory so I added the following to init file: (defun dc/dired-mode-keys () "User defined keys for dired mode." (...
6
votes
1answer
626 views

How to define a keybinding with a key-down/up (Alt-Tab-like) behaviour

The usual behavior of Alt-Tab in window managers is that as long as Alt is pressed, the user can Tab or Shift-Tab through the list of windows, and then when Alt is released the currently selected ...
5
votes
2answers
1k views

How can I permanently rebind keys?

How can I permanently rebind keys? I'd like to rebind C-i, C-j, C-k, and C-l to act like the arrow keys. However, when using (global-set-key (kbd "C-l") 'forward-char) it will only do so for the ...
9
votes
1answer
588 views

How can I go from a key 'code' back to its keyboard equivalency?

I have the following documentation: mc/keymap is a variable defined in `multiple-cursors-core.el'. Its value is (keymap (67108903 . mc-hide-unmatched-lines-mode) (27 keymap (118 . mc/cycle-...
11
votes
4answers
1k views

Problem “<dead-acute> is undefined” appearing when typing Greek stress ( ' )

I started using Emacs and I wrote a text in Greek. The problem is that the stress that is used upon some letters (ό, ύ, ί, ύ) doesn't work! It is usually inserted by pressing the ; (I mean by ...
16
votes
1answer
678 views

Best (minimal keystrokes) method of jumping to the start of a function and then back to current point?

Sometimes I'm inside a long function where the start of the function is not visible. While I have recently learned about (which-function-mode) which tells me in the modeline the name of the function, ...
4
votes
2answers
2k views

Defining key-bindings within `helm-map`: getting a `void-variable helm-map` error

Am going through this Helm tutorial at the moment; I pasted in the code verbatim (for now, I'll adapt it to suit my preferences later). I did a quick google search for this particular error but it ...
1
vote
3answers
615 views

Global key binding overriden by undo-tree [duplicate]

I am trying to remap globally C-/ but the undo-tree package hinders me from doing so. When calling this command (in my init file): (global-set-key (kbd "C-/") 'left-char) after having loaded undo-...
3
votes
1answer
222 views

how to reveal function names that are bound to mouse buttons (eg <down-mouse-1>)?

Emacs buttonizes specific expression in the buffers. For example, email ids, urls attachments in gnus buffer, and [back], [forward] in help buffers and so on. When we click on those with mouse, they ...
2
votes
1answer
981 views

How to disable completion-at-point in emacs shell (i.e., so I can have my `TAB` key back)?

Any suggestions on how to disable completion-at-point in Emacs shell (see below)? I've looked in the GNU docs on the relevant hook (which is oddly named) - completion-at-point-functions - but given ...
26
votes
4answers
4k views

How can I simulate an arbitary key event from Elisp?

Is it possible to simulate an arbitrary key event from elisp? I am aware of ways that I can find the binding for a given key, and then call that command interactively, but what if that key event is ...
4
votes
1answer
553 views

How do I configure moving by and deleting words in ansi-term?

In ansi-term's "char run" mode, I can use C-<left> and C-<right> to move around in steps of one word, but as soon as I start typing again, the point moves back to where it was. They work ...
7
votes
4answers
786 views

The C-x C-j binding for dired-jump stopped working

I used to have a keyboard shortcut for the following action: "Open the folder containing this file in Dired+, and place point (cursor) on the file" I believe it was C-x C-j, and I don't recall ...
6
votes
2answers
1k views

Press F5 to save, compile, and run current rust file

Similar to Visual Studio, when working with Rust programs, I'd like to press F5 to save the current file, compile it, and run it. What's a good way to do this?
4
votes
3answers
214 views

How can I quickly delete the trailing pathname component in ido-mode?

I use ido-mode for finding files and directories, which is generally very efficient in terms of keystrokes. The one annoyance I've found is when deleting the trailing pathname component when using ...
2
votes
2answers
122 views

How to modify bindings to match ECB window numbers?

ECB windows display their number: W-0, W-1, etc. Is there a way to define bindings so that I can get to these windows using bindings such as C-c . w 0, C-c . w 1, rather than using C-c . g d to go ...
5
votes
1answer
458 views

What does “less-than” key “greater-than” mean in terms of keybindings?

I'm trying to define a prefix keymap for a minor mode, but I'm getting a result I've not seen yet: `link-grammar-mode' Minor Mode Bindings: key binding --- ------- <C-.>...
29
votes
3answers
6k views

Problems with keybindings when using terminal

I have the following line in init.el: (global-set-key [(control \;)] 'comment-region) It works very well in GUI window, but if emacs is invoked with the -nw option then C-; doesn't comment region, ...
13
votes
4answers
412 views

Differences between setting major mode keys with a hook versus adding them to the mode map

Assume that I have downloaded a major mode called magical-mode, and it has its own magical keymap called magical-mode-map. This mode also provides a hook magical-mode-hook which is run each time ...
16
votes
2answers
4k views

Shift+Up isn't recognized by Emacs in a terminal

Very often I use Shift+Up/Down to select a region in Emacs. It works fine in GUI mode, but when emacs is invoked with -nw option I can select lines only with Shift+Down. The Shift+Up doesn't work, I ...
7
votes
1answer
698 views

Simulating mouse operations with keyboard

Is there a way, via some command that can be invoked by the keyboard, of making Emacs think that I clicked at a particular point (so that it does whatever it would have done if I clicked there, e.g. ...
29
votes
4answers
5k views

Show unbound keys

I want to define some key bindings for my new found usage of helm, amazing mode btw, and I want to do it without overwriting the usage of other keys. I realize that the number of different key ...
4
votes
2answers
115 views

Trigger a function when a key is held down after X seconds?

I have highlight-symbol enabled with the delay set to 0. It's great, but unfortunately when I navigate by holding down j or k (evil-mode), the feedback is not great. So I was wondering if it's ...
5
votes
1answer
132 views

Why does local-key-binding return a 1 for a key with no local binding

When I evaluate (local-key-binding key) for any arbitrary key that does not have a local binding, I expect a return value of nil, but I almost always get a 1. If the key actually does have a local ...
5
votes
2answers
244 views

Detect when a key is rebound to another command

First, some context: I am in the process of debugging a strange interaction between smartparens and Org Speed Keys: After editing an .org file for a while, specific speed keys for navigating the ...
30
votes
6answers
12k views

How do I list all key-bindings available in a given buffer?

I am trying out a new major mode, how can I take advantage of Emacs' documentation system to get a listing of key bindings available in that specific buffer?