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.

0
votes
0answers
5 views

spacemacs - rebind existing keys

I am trying to rebind j, k key as well as capital E, B and Y, but cannot get them to work. Any pointers? I put this into my .spacemacs (in dotspacemacs/user-config): (evil-define-key 'normal key-...
0
votes
0answers
16 views

Mac OSX and remote Emacs sessions, keybindings

I have questions regarding keybindings and cut & paste for Emacs and OSX v10.14.3. I'm hoping there are some Emacs users with similar configurations that can provide guidance as to be productive ...
0
votes
1answer
18 views

Force C-c to cua-copy-region

I have CUA mode enabled, but sometimes when I hit C-c, emacs simply does not copy anything because it starts to think Iam typing some C-C something command. I tried: (global-set-key (kbd "C-c") 'cua-...
1
vote
0answers
21 views

unbind ALL C-x and C-c shortcuts in org-mode with CUA-mode

For a special purpose application of emacs with org-mode I want to dramatically simplify the shortcuts. I'm already quite satisfied with my config based on CUA mode. The one thing that bothers me ...
0
votes
0answers
9 views

Why is C-i executing TAB instead of evil-jump-forward? [duplicate]

For some reason, pressing ctrl+i is sending a TAB command instead of executing evil-jump-forward. Viewing the lossage, I see: C-o [evil-jump-backward] TAB [c-indent-line-or-region] From describe-...
0
votes
0answers
18 views

Rebinding smartparens keys using Evil

I use vanilla Emacs with evil. I did not install smartparens but it is present and enabled on my system as a dependency of something. I need to rebind the M-s keys to something other than the default ...
0
votes
0answers
7 views

Shortcut to actual previous line in markdown mode, or end of section

I use markdown-mode and often fold the tree. I sometimes need to go to the last line of a tree, e.g. if I adjust the tree heading and then want to work at the last leaf. I suppose a shortcut can take ...
0
votes
0answers
18 views

How can I 'disable' left_C-x and enable only 'right_C'-x

I'm a emacs user, and my left pinkie start to feel it a bit (overuse of C-x day long) .... so I thought that before crying over some emacs induced RSI, I should unset some bindings so my bad habits ...
0
votes
1answer
18 views

How do I select surrounding block

What is the command for Emacs/Spacemacs to select the surrounding (logical) block? I know I've used this some time ago, I just don't remember how exactly :)
0
votes
0answers
17 views

Creating aliases for key sequences

I found that I can, in evil normal-state, use <leader> c as an abbreviation for (or rather alternative to) C-c: (evil-leader/set-key "c" (lambda () (interactive) (setq unread-command-...
0
votes
1answer
36 views

How to make `ESC` key act like a real Meta modifier key?

I would like to make the ESC key act like a Meta (modifier) key. For example, when I move backward by words by (M-b), I want to keep my pinky finger on ESC, not press it once for each backward move. ...
1
vote
2answers
36 views

Shortcut to put the selected region in an ordinary LaTeX environment (not with begin-end style) using auctex

In auctex if one has a selected region and then apply the command c-c c-e (LaTeX-environment) then by selecting an environment, the selected region will be folded between that environment. Is there a ...
2
votes
1answer
128 views

Changing the prefix of many chords

It just occurred to me that the org-babel prefix C-c C-v must be what it is because of the proximity of c and v in qwerty, and that it would be better for me to use C-c C-f. Is there a simple way to ...
2
votes
1answer
61 views

How to revert a buffer using the “g” shortcut

I can refresh my dired buffer using M-x revert-buffer and I've seen multiple places that I can do this more easily using g but don't understand how that would be run. Does it mean M-x g or running g &...
1
vote
1answer
26 views

How to define a function that calls two commands where the first one requires an arguments

I use emms to play music in emacs and I have this function to add a music directory and shuffle it. (defun my-emms-command() "Run `emms-add-directory' and `emms-...
0
votes
1answer
57 views

Spacemacs keybinding to execute shell script in directory the file in the current windows buffer is located in

I need a keybinding (either a key like F12 or a mnemonic key sequence like SPC f12) in Spacemacs. When hitting the keybinding in a window containing a file in its buffer the shell script script in the ...
1
vote
1answer
21 views

org-use-extra-keys won't load

I'd like to get access to org mode's extra keys. However, although the value of org-use-extra-keys is set to "on (non-nil)" (and has been for several Emacs sessions), I don't seem to have access to ...
1
vote
0answers
56 views

How to bind Ctrl-Super-[? [closed]

I tried (global-set-key (kbd "C-s-[") 'xxx) but when I use it I get: <C-s-268632091> is undefined
0
votes
0answers
15 views

evil-embrace: remove default mappings

I use evil-embrace together with evil-surround and remapped the evil-surround keys with: (setq-default evil-surround-pairs-alist '((?b . ("(" . ")")) (?c . ("{" . "}")) ...
4
votes
1answer
51 views

How to bind 'C-u M-x shell' to 'C-c s'? [duplicate]

I would like to define the keybinding C-c s which should start a new shell in the current directory (so C-c s should behave like C-u M-x shell). I know how to define a keybinding based on a function (...
1
vote
1answer
21 views

binding M-[ causes mouse focus to insert characters

I have bound M-[ to backward-paragraph. This causes a problem in terminal mode, whereby every time the mouse enters or leaves the frame (i.e., Emacs gains or loses focus), the characters I and O are ...
0
votes
1answer
34 views

set key for 'comment-or-uncomment-region in python-mode

i want a shortcut for the nice little function comment-or-uncomment-region. The thing is, it works fine for me in every mode using M-x comment-or-uncomment-region. And espacially it works differently (...
0
votes
1answer
49 views

Disable left win key in Emacs for Windows

With AutoHotkey If I press the key Win alone, then nothing happens. That's true except with Emacs, because it opens the Windows menu. Is there a way to prevent it? Update: In AHK I have exaclty ...
6
votes
1answer
150 views

How do I keep Mac Emacs from trapping M-`?

I want to use the command key on my Mac as the meta key, so I customize ns-command-modifier. But I also want to still use ⌘-` to cycle through all the windows in Emacs - just like in all other Mac ...
3
votes
3answers
72 views

How did some of my text get highlighted with a magenta background?

I pressed some combination of letters by mistake and part of my Python buffer got a purple background color (or magenta, fuschia, violet, orchid, depending on knowledge of colors). The only way I ...
0
votes
1answer
58 views

OS copy/paste not working for emacs-mac

GNU Emacs 26.1 (build 1, x86_64-apple-darwin16.7.0, Carbon Version 157 AppKit 1504.83) of 2019-01-27 I just recently installed the emacs-mac port of GNU Emacs 26, and the OS copy/paste functionality ...
1
vote
1answer
26 views

How to enable Ctrl-Option combinations with OS X

I can't get simultaneous presses of Ctrl + Option and other keys to register in Emacs. For example, if I press Ctrl-h c (describe-key-briefly) and then Ctrl-Opt-f, it doesn't recognize that I've ...
1
vote
1answer
87 views

Emacs evil-mode C-c/C-x to “cc”/“cx”. ( key translation)

I read in evil wiki that I can change prefix keys such as C-c or C-x and so on to cc, cx, but I'm not experienced in Elisp and I tried a lot of variants but I can only define c as C-c but not a cc to ...
2
votes
1answer
45 views

Emacs think there is an accented character in the keystroke

Version GNU Emacs 26.1 (build 1, x86_64-apple-darwin14.5.0, NS appkit-1348.17 Version 10.10.5 (Build 14F2511)) of 2018-05-31 Use emacs -Q with following config: (setq mac-command-modifier 'super) (...
0
votes
0answers
19 views

Can not keep keybindings

How can I keep key-bindings in all modes? Following bindings are initially working though overwritten by another major mode e.g. org (defun dotspacemacs/user-config () (exwm-input-set-key (kbd "M-h")...
2
votes
1answer
22 views

Binding a key to 'open -a Terminal .' on macOS

I'd like to do something like this (global-set-key (kbd "C-c t") (kbd "M-! /usr/bin/open -a Terminal . RET")) ... in order to open a (real, the) terminal from the current working directory in macOS ...
0
votes
2answers
60 views

pdb within eshell up/down keys dont work

I am running python3 in eshell. When I use import pdb; pdb.set_trace() in my code, pdb opens within eshell. Everything works in pdb but the up/down keys don't work for running the previous command. ...
0
votes
0answers
23 views

Extending ido-find-file to call deadgrep produces minubuffer error

I'm trying to add a key binding to ido-find-file, so that it calls deadgrep from the current directory. Similar to how pressing C-d from ido-find-file calls dired. The problem is that both deadgrep ...
1
vote
1answer
44 views

use euro symbol (or any symbol) for emacs keybinding

I set up this duplicate line function: https://kundeveloper.com/blog/duplicate-line/ and bound it to the euro symbol like this: (global-set-key (kbd "M-€") 'duplicate-line) And it worked (for a ...
0
votes
1answer
22 views

Binding simple keys in spacemacs

I would like to set a projectile find file function to the hotkey C-e, and a elpy-goto-definition function to the hotkey F12, but I'm not sure why spacemacs is not recognizing the config that I'm ...
0
votes
0answers
55 views

Remapping keys in org mode agenda view

I currently trying to remap my org mode agenda keymap in Spacemacs for org-agenda-next-item and org-agenda-previous-item. In the agenda view I like to map the functions to k for next-line and l for ...
4
votes
2answers
53 views

How to run whichever function is bound to a certain key

There are a lot of occasions where, by default, the key-binding C-c C-c does something useful - e.g. in org-mode or magit. I would like to take whatever function C-c C-c runs, and bind that function ...
1
vote
2answers
42 views

Add additional function to cua-mode processing for `C-c`

I'm running cua-mode, and I'm trying to override the cua binding for C-c so that I can insert a function somefunc before passing the baton to the original cua binding which is cua-prefix-override-...
1
vote
2answers
25 views

Enter a string interactively on specific keyboard shortcut

I'm new to this kind of Q&A site. Now I'm writing some article using Sphinx (reStructured text). Writing an equation (like E = mc^{2}) in Sphinx is a little bit demanding, because you have to ...
1
vote
0answers
26 views

binding a minor mode's function to already defined key in global-map

(use-package anaconda-mode :defer t :config (progn (unbind-key "M-." anaconda-mode-map) (unbind-key "C-_" global-map)) :bind ((:map anaconda-mode-map ("C-_" . anaconda-...
0
votes
1answer
45 views

CC mode: make Tab just insert one tab or complete, no auto-indenting

I am dissatisfied with current behaviour of Emacs in CC Mode. I'm not sure if this applies to other major modes, but that's one I'm currently struggling with. Here are my problems: When I press tab, ...
1
vote
1answer
69 views

Interactive lambda only calls 1 of several functions called in body

In term-mode I've configured the keybindings for term-line-mode and term-char-mode as follows: (setq term-bind-key-alist (list (cons "C-c C-j" '(lambda () (interactive) ...
1
vote
0answers
43 views

cannot rebind M-p [closed]

I try to customize the scrolling experience within Emacs and for that rebound M-n and M-p to a new functionality, namely (global-set-key "\M-n" "\C-u20\C-v") (global-set-key "\M-p" "\C-u20\M-v") ...
1
vote
1answer
37 views

Keybinding fails although it is not set

I'd like to use the key binding M-n p for ess-swv-purl in .Rmd documents and thus tried (define-key global-set-key (kbd "M-n p") 'ess-swv-purl). If I'm in an .Rmd (Rmarkdown) document, M-n p still ...
0
votes
1answer
35 views

Given a keyboard command, how do you find the interactive function? [duplicate]

I have a key sequence for C-u C-c . How would I find the function that's bound to it. I thought it was describe-key but that doesn't seem to work. Cheers
0
votes
0answers
129 views

how to have EMACS use the right alt key the same as the left alt key

I regularly use the backspace key to delete whole words at a time to the left of the cursor, but this would be a MUCH easier keystroke if it could be done one-handed. For that to happen - I would ...
0
votes
0answers
26 views

How can I press a key combination including CTRL and ALT_GR on a Swedish keyboard?

I am running Emacs (26.1 - build 1, x86_64-w64-mingw32) on Windows 10 and I cannot type any key combination including CTRL and ALT_GR on my swedish keyboard. I stumbled on this when I tried to use ...
1
vote
1answer
114 views

Using tab for both cycling and completion in org mode

I use company for completion and I have company-indent-or-complete-common bound to tab for certain modes. In org mode, tab is bound to org-cycle, which either cycles visibility or calls the global ...
1
vote
2answers
43 views

German input method: missing ' (single quote)

I am typing with a German ISO keyboard that I've set to US English in X: setxkbmap -layout us -model pc102 For entering German characters in Emacs, I do: (set-input-method 'german) Some special ...
0
votes
1answer
54 views

How to use `backspace` to navigate to the parent folder in Spacemacs?

When I use C-f to find a file in Spacemacs, how can I use <backspace> to navigate to the parent folder?