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.

1
vote
0answers
20 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
24 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
9 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")...
1
vote
2answers
148 views

Is there a key binding to open the configuration file of Emacs?

I'm going to set key binding to open and edit my init.el. Hotkey will call this function. (defun my-edit-configuration () "Open the init file." (interactive) (find-file user-init-file)) I ...
2
votes
1answer
21 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
0answers
5 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
16 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
38 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
17 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 ...
1
vote
1answer
78 views

Strange behaviour on evil-delete

When I use Emacs with Evil mode for some time, I sometimes get to a point, where I have no choice to what I want to delete when pressing d (or calling evil-delete). The current line gets deleted ...
0
votes
0answers
30 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
49 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
40 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
22 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
21 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
24 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
68 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
42 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
36 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 ...
11
votes
9answers
3k views

Typing quickly when Control, Alt and Esc are hard to reach

I'm very new to Emacs and I'm trying the built-in tutorial. After I went through the basics, I found it really hard to reach the Ctrl and Alt or Esc keys. I'm trying to type faster but since all the ...
0
votes
1answer
928 views

How to assign TAB to indentation and to yasnippet expand key

i'm trying to have the key TAB to: Indent my code (like in any other text editor) Trigger Yasnippet I have theses lines in my config: (global-set-key (kbd "TAB") 'yas-expand) (global-set-key (kbd "...
0
votes
1answer
30 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
1
vote
1answer
231 views

How to bind meta-shift-arrow to mark one word at a time

I am having trouble of marking one word at a time (ctrl-shift-arrow or meta-shift f/b) when connecting from one of my terminals. I would like to bind it also to meta-shift-arrow. I couldn't find what ...
1
vote
2answers
129 views

Emacs bulk indent for Python while `cua-mode` is enabled

I'd like to know how to indent multiple lines while Python is my major mode. The link below answers my question for the most part: https://stackoverflow.com/questions/2585091/emacs-bulk-indent-for-...
26
votes
6answers
10k 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?
1
vote
0answers
212 views

Define key chords for windmove

I'm following info found on this link, but cannot get the desired custom key bindings to work for windmove. Basically, I put the following in my .emacs file: (global-set-key (kbd "C-M-<left>") ...
1
vote
1answer
200 views

Unmap C-c from org-latex-preview-fragment

I don't like that C-c C-c is untoggle the org-latex-preview fragment because it's the "magic key" in org and whenever I press it it untoggle my latex-fragment so I have to toggle it again manually. I ...
2
votes
1answer
136 views

Is there a case aware way to select words?

Is there a way to select words respecting the case... camelCase, snakeCase... e.g.: i have a word "trullyAwesomeFunction" and cursor is on "w", is there an Emacs function I could use that would ...
2
votes
1answer
241 views

Setup a local key for help in tide

I'm trying to setup the F1 key for documentation within typescript mode only. Here is what I got so far. (use-package tide :init ;; (add-hook 'before-save-hook 'tide-format-before-save) ;; ...
59
votes
4answers
6k views

How can I find out in which keymap a key is bound?

I have rebound a the 'd' key in gnus-article-mode, but its old behavior is still active when the point is on an attachment. I can see that the rebinding did not take effect there by doing C-h k d, but ...
1
vote
1answer
75 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
1answer
53 views

What function does C-x invoke?

I learned that M-x invokes command execute-extended-command. Extended commands - GNU Emacs FAQ What command does C-x invoke? I looked through the reference but failed to find the answer.
0
votes
0answers
70 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
23 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
2answers
36 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
39 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?
1
vote
2answers
186 views

esc-right and M-right function differently in org-mode headers

I'm on macOS 10.12.5 and Emacs 25.2.1. For some reason M-right is interpreted as M-f. ESC-right is correctly interpreted as ESC-right. I can't see anything in the macOS keyboard shortcuts list that ...
1
vote
2answers
125 views

Spacemacs: change prefix key from `SPC-b` to `SPC-v`

I use buffer (SPC-b) prefix key very often, and would like to move its keymap to a more convenient key (e.g. SPC-v). Is there a way to achieve this without redefining the entire map? so I would like ...
1
vote
1answer
36 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
26 views

Trying to bind keystrokes to a menu item

I have a menu item added to AucTex's Command Menu, Latexindent. This calls an external process and is added in mu .emacs file by the following: (with-eval-after-load "tex" (add-to-list 'TeX-...
1
vote
1answer
56 views

Keybindings not working?

I'm using spacemacs and I've added the following user config: (defun dotspacemacs/user-config () "Configuration function for user code. This function is called at the very end of Spacemacs ...
1
vote
1answer
51 views

No confirmation for changing global key bindings Interactively in Emacs

I have tried to add global key-bindings to Emacs interactively via M-x global-set-key by following the guidelines in the Emacs Manual. When I add a keybinding though there is no confirmation prompt so ...
4
votes
3answers
810 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
61 views

When using `lisp-state`, how can we repeat an action like slurp, and bind a key to easily perform the repeat?

In vim, I frequently used the "." shortcut for repeating the last command. I found this extremely useful especially when working with clojure tools to do things like slurp-ing and barf-ing to refactor ...
1
vote
0answers
42 views

Using keyboard commands

I am Using Emacs GUI on Windows 10 and am having problems entering commands. I am attempting to use C-h t and I am getting the error message C-c h is undefined. What am I doing wrong?
3
votes
3answers
322 views

How to create a keybinding to a file in Emacs?

I have a frequently opened file in Emacs, which is deep inside my device. I want to bind the F5 key(or any other key) to open that file, how can I do that? (Using android to run emacs. [GNURoot, ...
4
votes
2answers
95 views

Understanding “It is bound to …” message in describe-function

If you ask for a function description, there is a line that starts: It is bound to <...> <...> <...> For example, for isearch it says: It is bound to <menu-bar> <search&...
1
vote
2answers
20 views

Unbind CUA <C-return> key only in dired mode

Goal: unbind <C-return> key ONLY in dired mode in order to rebind it to dired-w32explore. My configuration is using use-package with something like this: (use-package dired :init (unbind-...
0
votes
0answers
31 views

Rebind C-x b to ivy-switch-buffer

I find ivy-switch-to-buffer is handy abo-abo/swiper: Ivy Is it possible to bind the function to C-x b Additionally, my C-x C-b is bonded to ibuffer How could rebind it to function 'helm-buffer-list"...
1
vote
2answers
349 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 ...