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
0
votes
1answer
65 views

vhdl-mode key binding not working

I want to use the vhdl-mode in Emacs. I can use the templates when working with the meta key like: M-x vhdl-template-process If i want to use the corresponding key binding like: C-c C-t P it won't ...
3
votes
1answer
267 views

Trying to make control-f search exactly like control-s does!

I am trying to configure Emacs to not only use CUA, but also for control-f to search exactly like control-s does in the standard configuration. What I have achieved is that I can key in control-f and ...
7
votes
3answers
139 views

Near-identical commands on multiple keys

Visual Studio has this nice feature where you can put the point on something, press C-f3 and it'll both find the next instance of the thing under the point and it'll remember it. You can then press ...
2
votes
2answers
211 views

How can I rebind C-n from evil-paste-pop

I am trying to bind C-n and C-p to call next-buffer and previous-buffer. They seem to conflict with some evil-mode key bindings and I don't seem to be able to overwrite them. When I press them I get ...
16
votes
2answers
2k views

Convention about using C-x or C-c as prefix keys

What are the conventions for using C-x, C-c, or M- as prefix keys? For example: is C-x, etc., for saving or visiting buffers? Is C-c, etc., for text editing? Background Maybe this is a silly ...
1
vote
2answers
44 views

How to disable a keybind to allow shift selection with custom cursor keybind [closed]

I have back-to-indentation bound to M-u. When I hold Shift with M-u I'm unable to select the text because M-U (note the capital 'U') is bound to upcase-word So I disabled that bind by putting: (...
2
votes
1answer
78 views

What keys can I use to create/delete and select side windows?

I have a shell buffer that's a good candidate for a side window: I also regularly use an org buffer, that's always good to have around. https://www.gnu.org/software/emacs/draft/manual/html_node/elisp/...
0
votes
1answer
29 views

Trying to make keybinding in spacemacs

I'm trying to bind ",," to eval the topmost S-expression containing the cursor in common lisp layer, from this page I assumed it would be done like so: (spacemacs/set-leader-keys-for-major-mode '...
2
votes
1answer
35 views

Emacs execute keymap entry

Emacs defines a fair variety of objects that can be bound to keys, with e.g. global-set-key. (The canonical list can be found here). I would like to simulate the invocation of a keymap entry. For ...
0
votes
0answers
63 views

“No such file or directory, bind-key” after installing use-package [duplicate]

I'm using Emacs on Windows 10. I want to override key bindings, so after reading How to override major mode bindings, I installed use-package with the built-in package manager (via M-x package-install ...
1
vote
1answer
139 views

Invalid modifier in string for command unset “\C-;”

The command (global-unset-key "\C-;") fails with the message: Invalid modifier in string. Perhaps because of the special character ;. What is the proper way to unset this key? Any other normal ...
2
votes
1answer
49 views

Run command on region AucTeX

I would like to run force-compile (see Run TeX-command-run-all when there are no changes in .tex-file) on a region of my LaTeX document. (defun force-compile () "Set the file modification times on ...
1
vote
1answer
223 views

Spacemacs evil-window key bindings not working?

I have these keybindings in my dotspacemacs/user-config function: ;; Modify evil-mode keybindings from hjkl motion to jkl; ;; Motion mappings (define-key evil-motion-state-map "H" 'evil-window-bottom)...
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 ...
0
votes
2answers
169 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 ...
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 ...
1
vote
1answer
88 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
36 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
73 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
70 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
119 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
439 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 ...
2
votes
1answer
127 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
373 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
78 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
188 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
68 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
220 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 ...
6
votes
2answers
1k 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
402 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
23 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
175 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
101 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
110 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
295 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
125 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
2answers
70 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
103 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
50 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.
1
vote
1answer
81 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
116 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
134 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
28 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
124 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
46 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
58 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
38 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
36 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
140 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
343 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 ...