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
0answers
20 views

Emacs says invalid-function error on define-key

I'm trying to set a function to be called when you hit return in a certain mode, so I'm using define key, like this: (define-key picolisp-mode-map (kbd "RET") 'newline-and-indent) Unfortunately, ...
0
votes
1answer
32 views

Emacs subshell: how to select options by moving up and down arrow keys?

I open a subshell session using M + x shell and I create a Nuxt.js application using: yarn create nuxt-app myproject. During the installation process, I am suggested which packages/frameworks/...
0
votes
0answers
10 views

how to jump to matching tag in rjsx-mode (react)?

I'm using rjsx-mode for editing react component file. Is there a shortcut to jump to matching tag in rjsx? rjx looks like <div className={classes.root}> <AppBar position="static"&...
1
vote
1answer
40 views

“ESC” no longer works as meta; how can I restore functionality?

I mistyped some command sequence and ESC stopped working as a meta prefix in Aquamacs (it still functions as usual in the command-line emacs, including both Apple's system version and the command-line ...
0
votes
1answer
33 views

Unbind all keys from mode

I would like to prevent modes to add any custom keys to emacs. For example this works for default key map: (global-set-key (kbd "C-c") nil) And this works for ensime: (eval-after-load "ensime-mode"...
1
vote
2answers
22 views

Advertise a binding for TeX-next-error in AucTeX

How can I advertise a binding for TeX-next-error in AucTeX?I There are several bindings for next-error, normally C-x `, M-g n, M-g M-n. With (put 'next-error :advertised-binding "\M-gn") I will see ...
0
votes
0answers
34 views

When I'm trying to use Paredit, M-( turns into C-u 9, how do I disable this?

I am trying to use Paredit, but some of the mode's keybindings can't be pressed because Emacs interprets C-(, C-), M-(, M-) as variations of C-u 9 or C-u 0. This is making paredit unusable, how do I ...
0
votes
1answer
21 views

How can I get RET to follow org-mode links when using evil-mode?

In org-mode, the link-following behaviour of RET, that should be present when org-return-follows-link is set, doesn't work in evil-mode. MWE from emacs -q: Load an org buffer containing a link. Note ...
0
votes
0answers
18 views

How do I override a keybinding defined by evil-mode?

I've searched for this before but I've only seen questions like the below: https://stackoverflow.com/questions/683425/globally-override-key-binding-in-emacs How to override major mode bindings I don'...
0
votes
1answer
36 views

How rollback settings without restart Emacs?

windows 10, emacs 26.1 In my init.el (with-eval-after-load 'magit-status (define-key magit-status-mode-map (kbd "C-<tab>") nil)) This disable C-<tab> after magit-status was load. And ...
0
votes
2answers
57 views

Cannot bind <M-s-left>

I use elpy as Python IDE. I want M-<left> and M-<right> (M = alt) not to be overridden by elpy with elpy-nav-indent-shift-left and elpy-nav-indent-shift-left but insted bind these to ...
0
votes
0answers
19 views

shortcut to view TODO status by keyword in org mode

Background: In org mode C-c / T <keyword> generates a view for that keyword. For example, if I want to view all TODOs with the status of NEXT, the key sequence is C-c / T NEXT RET I have ...
0
votes
1answer
33 views

Backspace strange behaviour when word selected and cursor after open parenthesis

I got a strange issue when I hit backspace while some text is selected and my cursor is close to an open parenthesis, example: b(aaa) If I select aaa and my cursor is on the first a, I would like ...
1
vote
1answer
100 views

What is the difference between `C-i` and `<C-i>`?

I've just set (define-key input-decode-map "\C-i" [\C-i]) (define-key input-decode-map "\C-m" [\C-m]) (define-key input-decode-map "\C-[" [\C-\[]) in my config, but I noticed that C-i is now ...
0
votes
1answer
33 views

How to disable C-<number>

I don't know the name of the command C-<number> <entry> to repeat the <entry>, <number> times. For me it is more annoying than useful, several times I have accidentally ...
2
votes
1answer
48 views

M-= shortcut suddenly stops working in Emacs in KDE

I'm trying to run M-= on a region of text, but nothing happens. I think the shortcut is registered (I don't get a message like "M-= is undefined") but the execution stops for some reason and there is ...
2
votes
2answers
43 views

Change prefix key for compose-character (C-x 8)

According to the documentation, the key C-x 8 can be used to insert non-ASCII characters. For example, C-x 8 ' a will insert "á". Is it possible to change the prefix key to another (shorter) value, ...
0
votes
1answer
20 views

Unexpected behavior of Meta-RET in org-mode

when using lists in org-mode, the Meta-RET binding does not behave as expected. What I expect is that the binding will create a new item at the same level as the previous item. What I get is a new ...
0
votes
0answers
29 views

Is there an equivalent to :behave mswin in spacemacs?

I'm used to paste with C-v in insert mode. Is there something premade for Windows people, or do I need to rebind it?
0
votes
1answer
15 views

How to bind a function to the Windows key

I want to bind the function evil-normal-state to the windows key on my keyboard. How do I do that? Also is there a way to bind the Fn key to other functions? I am using Emacs 26.1 on a Linux-Mint ...
0
votes
1answer
27 views

Evil Mode, how to rebind the caps-lock key to go into normal mode

In addition to the Escape key, I would like to go into Normal mode while editing by pressing the caps-lock key. How do I achieve that? Thus far I have been able to disable the Caps-lock key using ...
0
votes
1answer
32 views

Keyboard shortcuts for applying a theme [duplicate]

I want to bind loading a specific theme to a key-binding. However, this does not work. (global-set-key (kbd "C-<f1>") '(load-theme 'zenburn)) I would like Ctrl and the F1 key to apply the ...
0
votes
1answer
19 views

Unable to mark files in directory listing from `C-x C-d`

I was just wondering if anyone has noticed the following behaviour after doing C-x C-d. I use C-x C-d to navigate to a directories and subdirectories with pdfs. Then I try to mark a pdf file with M-x ...
5
votes
2answers
190 views

How do I add custom hierarchical keybindings?

I am looking for a compact way to store a lot of shortcut keybindings. This is my current idea, for which I'm looking for help how to add this into my emacs config: I would like to make F9 "my" key, ...
0
votes
2answers
51 views

Very short key bindings for emacs commands [duplicate]

There are some text actions that I use so often in emacs that the user-made commands I currently use, invoked with the standard M-x ... RET procedure do not satisfy me. I would like to replace their ...
0
votes
3answers
58 views

C-x requires to look down at keyboard, interrupting flow

I'm trying to get used to emacs (really trying). I use a small apple keyboard. I can't see (in physical terms) how I will ever be able to do C-x without dropping my gaze from the screen and what I ...
2
votes
1answer
23 views

How to bind mouse click to kill an inactive window, but not the buffer

I'm trying to create a binding to kill windows (but not buffers) when they're being pressed by a middle mouse click in their header lines. (Just to note, all windows in my setup have header lines.) ...
1
vote
1answer
19 views

Elpy - Close Window when invoking elpy-shell-kill

Elpy helps a great deal, when editing Python-Code. For example it let's you run the current file with C-c C-c in a new Window with a REPL. When i'm done with this, i can hit C-c C-k (elpy-shell-kill) ...
0
votes
0answers
38 views

shift key not working in emacs via putty [duplicate]

I usually work in Org mode and the same dotfile is shared between a Linux and a windows Machine. In windows Shift+up/ down/ right / left behaves ok (moving dates and cycling TODO states) but ...
2
votes
1answer
64 views

Create a command or key binding for closing code blocks

In AUXtex there is the key binding macro C-c ] which closes the lowest current TeX environment. For example \begin{equation} ... would be closed (by putting an \end{equation} on a new line after ...
0
votes
0answers
20 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
1answer
82 views

C-c C-c is not working

I'm writing a major mode. In that mode I put: (define-key oef-mode-map (kbd "C-c C-c") 'oef-edit-in-browser) ; With Aquamacs (on my mac) the shortcut is working as expected. But with emacs (on ...
1
vote
1answer
130 views

Rebinding C-S-s?

I'm trying to set up C-S-s to run isearch-forward-symbol-at-point, but when I do the obvious step of: (global-set-key [C-S-s] 'isearch-forward-symbol-at-point) It doesn't work. It just does a ...
1
vote
0answers
20 views

Return key when Emacs running inside a terminal [duplicate]

I have re-assigned the RETURN key to exit the insert state in Evil mode. (define-key evil-insert-state-map [return] 'evil-normal-state) But this does't work with emacs -nw in terminal. Any way to ...
1
vote
1answer
52 views

How to remap ctrl-x with key-chord

How to remap C-x with key-chord mode. (key-chord-define-global "uu" 'what-goes-here?) https://www.emacswiki.org/emacs/KeyChord
0
votes
1answer
31 views

Shift + cursor stopped behave as usual in org mode

after a package update and restart shift+arrow does not behave as usual in org mode: move one day up/down in dates or cycling between statuses (todo, done, waiting...) in task lists. org-support-...
2
votes
0answers
26 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-...
1
vote
2answers
112 views

how to solve conflicts between operating system shortcuts and emacs shortcuts?

In some cases operating system shortcuts takes precedence and in other cases emacs shortcuts takes precedence. what's the reason for this kind of behaviour? Eg: (Mojave shortcut) Command + shift + 5,...
5
votes
1answer
58 views

I accidentally set a letter key to another command. How can I reset it?

In the past when this happened, I was able to google the answer with no problem, but this time nothing's coming up.
1
vote
1answer
22 views

Issues adding super keybindings to term-mode-map on Mac OSX

I'm trying to bind Command-{ and Command-} to multi-term-prev and multi-term-next. I only want them in term-mode, since if I use it in a file buffer it will switch to show a terminal (which is rather ...
2
votes
2answers
53 views

Make Emacs short keys work in different language

I have to often switch the OS keyboard language between Latin an Cyrillic. When the keyboard is Cyrillic the short keys don't work because they are not recognized. For example a Latin command of C-x-c ...
0
votes
1answer
36 views

How to `transpose-chars' backwards

I'm trying to make a trivial function that simply transposes chars backwards. This is what I got so far: (defun jd:backward-transpose-chars () (interactive) (transpose-chars -1)) (define-key ...
2
votes
2answers
60 views

Elisp - Activate and Deactivate Linum-Mode when Goto-Line is Triggered

I switched to Emacs from Vim and because of Vims functionality of giving keys a prefix, (for example to jump up several lines etc.) i installed relative-linum-mode right away. Now i found out about ...
3
votes
1answer
44 views

how to provide a parameter for interactive lamda function

I want to be able to perform helm-swoop on an input error: on a compiler output buffer using C-x C-r, here is how I tried to achieve it. (global-set-key (kbd "C-x C-r") (lambda () (interactive) (...
0
votes
2answers
18 views

bind an insertion to a mouse click [duplicate]

I need to change a space to a | here and there and i guessed that the best possibility were to bind a mouse click and the insertion of the pipe (global-set-key [s-mouse-1] '(insert "|")) But when I ...
0
votes
2answers
65 views

How to deal with particular key-binding conflict (F3 key on Mac)

I would like to make a very basic macro on my Mac, to have a command that writes a list of slashes in the current file : //////////////////// The "Basic emacs macros" section of the manual says : ‘&...
1
vote
2answers
58 views

Keybinding for Smerge

I'm trying to change the keybindings to all the smerge commands. I added : (setq smerge-command-prefix "\C-c v") to my Emacs config. M-x customize smerge confirms that the Smerge Command Prefix is ^...
0
votes
0answers
40 views

is it possible for two people, using different emacs and keybindings to edit the same file synchronously?

I want to pair program with a couple of people but my keybindings in emacs are not the same as theirs. Is there a way to edit the same file but keep the keybindings different?
0
votes
1answer
28 views

how to map <C-M-left>, <C-M-right> etc to the correct hex codes in iterm2

I'm looking to configure iterm2 to output the correct hexcodes that correspond to in emacs. There's a whole bunch of mappings predefined but it's very cryptic. I'm a little bit lost as to how these ...
0
votes
1answer
42 views

how can a command be bound to Ctrl-' or Ctrl-<NUM> in the terminal

I want to bind a command to C-', C-` and C-0 through C-9 keys. It's not working in the terminal Is there a way to do so?