Stack Exchange Network

Stack Exchange network consists of 174 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.

0
votes
2answers
108 views

How to overwrite C-c C-v hotkeys for LaTeX-mode-map?

Now i use this: (eval-after-load 'latex '(define-key LaTeX-mode-map (kbd "C-c C-v") nil)) (eval-after-load 'latex '(define-key LaTeX-mode-map (kbd "C-c C-v") 'my-open-file-LaTeX)) I DO NOT use ...
1
vote
0answers
30 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 ...
1
vote
1answer
70 views

Unexpected behavior using SHIFT+arrows and CTRL+arrows on emacs (orgmode) + terminal + mosh + screen

I am connecting in a machine using a terminal, mosh and then screen. Then, in my orgmode file I can't use the shortcuts like SHIFT+up, SHIFT+left or CTRL+up etc. If I press that, it produces something ...
1
vote
0answers
34 views

ALT as my modifier key stops me using a pound sign [duplicate]

I've just switched to Spacemacs (Evil mode), as it is time to change things up, having used Sublime Text for years. I have a British Mac keyboard which relies on ALT + 3 to output the pound sign (#). ...
2
votes
3answers
72 views

is there a keybinding to save curor position for returning after viewing other section of same buffer?

when i am editing a large file, often need to view other sections of the same buffer only once. But after that I need to go back to the position I was editing at. Is there a key for doing that?
0
votes
1answer
34 views

Custom Outline mode key binding

I want to set a key binding for outline-next-visible-heading but I fail to do so. I believe using hooks is a solution for this so I added this to my .emacs (defun outline-mode-test-hook() (define-...
2
votes
1answer
86 views

Use mouse buttons as modifiers

I want to make use of a Thinkpad trackpoint's thumb buttons which I almost never use in Emacs anyway. I'd like to use them as additional Controls in Emacs, and in Emacs only. I've found this answer, ...
6
votes
4answers
335 views

My left pinky hurts. Can I press another key to act as Control?

My left pinky hurts due to repetitively pressing the C button when using Emacs org mode. Not working with Emacs is out of the question, but it needs some rest. I would like to change theC key for ...
0
votes
0answers
27 views

How to enable SHIFT+TAB for multi line code region unindentation?

I have found this code which enables both TAB and SHIFT+TAB for code region indentation and unindentation. The problem is SHIFT+TAB doesn't work on multi line codes and also we have to place the ...
2
votes
1answer
84 views

Yasnippet: How to create multiple snippet key bindings

I have a yasnippet with # binding: TAB f o o in the header. This is processed by the yasnippet library as 9 102 111 111. With respect to a keymap of a major-mode, both \C-i and (kbd "TAB") are ...
1
vote
2answers
185 views

How to unbind a key from a command in general.el?

I am using emacs with evil, and space is my leader key, however, space is bind to dired-next-line in dired-mode. So, how can I unbind space, so I can still use it as my leader key in dired-mode, and ...
0
votes
1answer
55 views

How to rebind org key sequence e.g., (C-a a m)?

org-mode newbie question. I want to invoke the org agenda command that matches a tag query. Currently it is bound to C-a a m. I found the key sequence too long and wanted to bind it to a shorter ...
1
vote
1answer
119 views

Compile and run C-Programs in Emacs

I'm currently learning C with a book that has many small code examples that the reader is supposed to write, run and experiment with. I'm using Emacs as my primary tool for everything that has to do ...
1
vote
1answer
61 views

Toggle string and regex replacement

How can I quickly toggle between string and regexp versions of functions such as replace-string/replace-regexp, query-replace/query-replace-regexp etc? Pretty sure I saw a shortcut once but now I cant ...
1
vote
1answer
134 views

Keybinds on xterm and emacs-nox

I've looked on google, stack exchange, GNU emacs manual, xterm manual, etc. and still haven't found an answer that satisfies my problem(s). Problem: Using Systems: Ubuntu 16.04, xterm, emacs-nox I ...
4
votes
2answers
905 views

Open new window and switch to it

Assume I'm opening a new window with for example C-x 2 or C-x 3 then the buffer opens and I need to switch to it by hand with C-x o. Is there a build in solution to do this with one command? Or even ...
4
votes
1answer
279 views

Display corresponding key binding of command during M-x completion

As an example, when I use M-x save-buffer Emacs says in the minibuffer: You can run the command ‘save-buffer’ with C-x C-s I'm using Swiper/Ivy; I want to know if there is a way to instruct Ivy to ...
0
votes
1answer
22 views

get “jump to column” behavior of fundamental mode in a major mode

I noticed that when in fundamental-mode or prog-mode (basically any mode without an indent-line-function) the TAB key will jump between columns. For example if I have foo bar baz fot bat| ...
0
votes
1answer
123 views

OSX - turn off command key in terminal emacs

I'm trying to disable the command key when running emacs from the terminal. Whenever I mistakenly press CMD-V instead of ALT-V, the text from my Mac clipboard gets copied into the buffer. From related ...
1
vote
2answers
86 views

Aggressive C-g config

Is there a way to configure C-g (or some other key?) to not be usable as normal input in any context, part of a key binding, etc, and instead have it quit in more contexts? e.g. I'd like C-x C-g to ...
0
votes
1answer
84 views

Closing flyspell correction suggestions popup

If I goto correct a word with flyspell-correct-at-point, a word suggestion box will appear, as expected. Unfortunately I cannot close this suggestion box with escape I have to use C-g. Any ideas on ...
0
votes
1answer
176 views

override “C-SPC” set-mark-command

I'm using expand-region and experimenting with it trying to find the right key binding As per expand-region README it binded to (global-set-key (kbd "C-=") 'er/expand-region) But I'm not satisfied, ...
2
votes
2answers
80 views

C-x in terminal

I'm new to emacs and this has been bothering me for a while. Not only because I can't figure out how to do it but I can't find anyone else asking this question online. In M-x term, how can I make C-x ...
1
vote
0answers
49 views

Using alt for Meta with non-US keyboards

I have a non-US Mac keyboard which requires the alt key to type certain characters. In an attempt to use alt as Meta key in Emacs, I checked Use Option as Meta key in Terminal preferences. However, ...
1
vote
2answers
66 views

How to troubleshoot a key binding prompting for more key presses?

I have a function bound to Ctrl-b, this runs a command immediately, however after some time running emacs, pressing this binding shows text C-b in the message bar, prompting for other keys to be ...
1
vote
1answer
75 views

Rebind TAB to show help in counsel minibuffer

I'm in the process of migrating from helm to ivy/counsel, and I would like to replicate a binding that I had in my previous setup. When browsing the results minibuffer (for example in counsel-M-x), ...
0
votes
0answers
45 views

C-S-a doesn't select text to the line beginning

The Key combination Ctrl + Shift + a doesn't work in my GUI-Emacs to select a region from the position of pointer to the line start. Doing C-h k and the above key combination shows no documentation.
0
votes
0answers
24 views

Reassign a key in a particular input method

Running Emacs 25.2.2 on Kubunhu 17.10. At the Kubuntu level, I use Dvorak keyboard. In emacs, at times, I need to input Devanagari characters. So, I M-x set-input-method devanagari-inscript. Based ...
1
vote
1answer
56 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
66 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
90 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
24 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
96 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
43 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 ...
0
votes
0answers
19 views

Binding a key sequence for a mode

It seems that normally C-c & is bound to org-mark-ring-goto in org buffers, but this is overridden by Yasnippet. How do I restore the original binding?
1
vote
1answer
33 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
30 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
33 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
98 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
282 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
55 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
77 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
122 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
66 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
410 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
68 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
133 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
137 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
125 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
349 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: ...