2022 Developer Survey is open! Take survey.

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
3 answers
35 views

Keyboard shortcut for running shell commands

I want to trigger running makefile from inside emacs. I followed this link and added to (defun set-exec-path-from-shell-PATH () (let ((path-from-shell (replace-regexp-in-string ...
user avatar
0 votes
0 answers
14 views

Replicating Doom's Tab Key Behavior Using Evil in Org-Mode

When I'm editing an Org file using Doom Emacs in insert mode and my cursor is on the line of a heading, the Tab key seems to demote the heading while Shift-Tab seems to promote the heading. On the ...
user avatar
3 votes
2 answers
224 views

What exactly are keys like `<copy>`, `<paste>` etc (CUA not enabled)?

I see these keybindings sometimes in the help docs. E.g. from C-h f clipboard-kill-ring-save It is bound to <copy>, <f16> So, what might this be on my keyboard assuming I do not have CUA ...
user avatar
  • 133
0 votes
1 answer
23 views

C-; shows a strange popup with letter 'e'

I don't know when this problem began, may be 1 or 2 months ago. When I press "C-;", Emacs shows a popup with letter "e". But this key binding is for "avy-goto-char-timer"...
user avatar
0 votes
0 answers
22 views

How can I temporarily disable all (other) key bindings?

How can I write a command, and bind it to a key, so that when invoked it disables all key bindings other than the current key, until that same key binding is pressed again? The goal is to facilitate ...
user avatar
  • 1
1 vote
1 answer
24 views

Blocked keys! How can I get emacs to see all keystrokes?

Windows 7 64-bit emacs 27.1 Some keys of the form C-M-<char> evidently are not sent to Emacs. How do I get them sent to Emacs? Example: Emacs does not respond C-M-s. Also, does not show binding, ...
user avatar
0 votes
0 answers
30 views

Access key bindings for a major mode

Running Doom Emacs 3.0 on Emacs 28. I have installed todotxt.el using: (package! todotxt) in packages.el. When I Open my todo.txt file and M-x todotxt-mode, sPC h b m shows all the keybindings ...
user avatar
  • 1,668
4 votes
2 answers
94 views

Can't reset Ctrl-; or Ctrl-. in emacs

I am using GUI emacs 28.1 on ubuntu 22.04. Emacs won't let me reset the key C-; I want to use: (global-set-key (kbd "C-;") 'evil-normal-state) Resetting the key C-. won't work either. The ...
user avatar
  • 278
1 vote
0 answers
30 views

Key Binding not Working

I have the following code as shown below for my .emacs file. For some reason the keybinding is not working nor are the extensions for deft I am pretty sure. Does anybody know why this is? (require '...
user avatar
0 votes
0 answers
26 views

macOS 11.6.3: Emacs acts like control, meta keys are sticking; how to diagnose?

I'm a longtime GNU Emacs and macOS (and GNU Emacs on macOS) user, on a US Gov't owned MacBook Pro (16-inch, 2019) running macOS 11.6.3. For the last few weeks, GUI versions of Emacs are acting as if ...
user avatar
  • 101
4 votes
2 answers
53 views

How to go up one level in the menu-bar when using the keyboard to access menus

When I go many levels down into the menus in the menu bar, is there a way to go back up just one level? To illustrate: Start Emacs Press F10 to open the menu bar Press Ctrlf to reach the "Edit&...
user avatar
  • 553
2 votes
1 answer
51 views

How to define key-combinations involving multiple `C-u`s

I wanted to define a short key combination for preview all latex fragments in a org file. Per this answer: To preview all latex fragments in the buffer pass C-u twice before calling org-latex-preview....
user avatar
  • 902
0 votes
0 answers
29 views

MacOS right option modifier setting does not work when using Emacs in the terminal

I have a macbook hooked up to an external monitor and use an external keyboard. I've already set it up in the MacOS terminal to use alt (option) keys as Meta in the options menu. So, I would like to ...
user avatar
3 votes
2 answers
286 views

What is the difference between `C-u C-c C-l` and `C-c C-l`?

C-c C-l points to org-insert-link. In the minibuffer I am ask for a link type, link url and description. But C-u C-c C-l shows me dired-like folder structure in the minibuffer and I can navigate to an ...
user avatar
  • 499
1 vote
1 answer
28 views

Disable mouse-3 (right click) from deleting/killing text

Is there an easy way to disable mouse-3 (right click) from killing selected regions? I didn't see anything in the customize options that looked like it would do it. Wouldn't mind disabling middle ...
user avatar
  • 197
0 votes
0 answers
28 views

Windows Terminal (WSL2) and M-S, C-S in Org Mode

UPDATE: I just tested emacs -nw with the MSYS2 terminal (Windows) and with iTerm (macOS) and they all have the same problem. emacs -nw on WSL2 with the Windows Terminal has many known issues with key-...
user avatar
0 votes
2 answers
31 views

Right Control key problem when using Emacs remotely - Emacs thinks it's `C-M-`

I'm doing some remote work using Azure & Bastion to access a customer site. The problem is that in this context, with Emacs, my right Ctrl key doesn't work normally. What it's doing instead is ...
user avatar
1 vote
1 answer
34 views

Override minor mode map based on major mode

Emacs Prelude binds C-a to crux-move-beginning-of-line using the following in its prelude-mode minor mode map: (define-key map (kbd "C-a") 'crux-move-beginning-of-line) It works good for ...
user avatar
  • 746
0 votes
2 answers
36 views

Change the "^" keybinding prefix

Some keybindings require you to type the ^ character (ie magit smerge) and for starters, on an UE AZERTY keyboard (which is a very bad layout design BTW) there are two of those, and they each input a ...
user avatar
  • 821
5 votes
1 answer
87 views

How to exit minibuffer with one key?

How can I tell emacs that one key press of <f12> should terminate the minibuffer, like C-g does by default? I tried in scratch buffer: (global-set-key (kbd "<f12>") 'keyboard-...
user avatar
  • 127
1 vote
1 answer
48 views

Why does a code block that contains only comments seem to change key bindings?

This is very odd. I have my Emacs config in code blocks in an org-mode file that is called from my init file using (org-babel-load-file "~/.emacs.d/emacs-config.org"). I've tried to assign ...
user avatar
  • 314
1 vote
1 answer
22 views

How to pass in a function for define-key's DEF

I'm using spacemacs and setting a binding with spacemacs/set-leader-keys. The documentation for this states that it uses define-key: spacemacs/set-leader-keys is a Lisp function in ‘core-keybindings....
user avatar
2 votes
1 answer
15 views

shortcut to select data to the last row

I'm new to Emacs. First of all sorry if my English is weird because it is not my first language. I don't know much about the terminologies used in Emacs. Currently, I'm just using Emacs for data ...
user avatar
2 votes
1 answer
40 views

Key binding to `C-<` and `C->` not working when creating minor mode

I wrote a couple of functions to automatically convert sequences like "<<" in «. (Yeah, I know that input methods can do the same, but I don't want the extra bindings: I'm planning to ...
user avatar
0 votes
1 answer
29 views

"General" leader key not working in some modes *Messages* on initial startup only

I use evil and have general bindings like so defined after evil is installed through use-package. (use-package general :straight t :after evil :config (general-...
user avatar
  • 892
2 votes
3 answers
85 views

How can I quit windows like *Help* and *Messages* without first selecting them?

I find myself running C-h k/f/v and after reading the popup that's in the other window, going to that window and closing it. Is there a way to streamline that process a bit more (maybe adding a hook ...
user avatar
  • 892
0 votes
1 answer
25 views

How can I replicate Spacemacs's evil bindings on the helm-find-files / helm switch to buffer modes?

I'm moving away from Spacemacs to vanilla Emacs + Evil and I liked the C-hjkl shortcuts that were available while navigating helm buffers (C-h / C-l moved up/down directories in helm find files, C-j ...
user avatar
  • 892
0 votes
1 answer
34 views

Evil-leader: Leader key working in special buffers like *Message*, *Backtrace*, etc

The leader key works most buffers and in other special buffers like Help but not in others. Is there a setting for having evil-leader work in all buffers? This is an example of my evil-leader ...
user avatar
  • 892
1 vote
1 answer
49 views

Insert space before link with org-insert-link

In Doom Emacs and org-mode, I want to use org-insert-link pressing the minimum amount of keys. So I want to combine two-four commands in one. The default behaviour doesn't leave space before or after. ...
user avatar
1 vote
1 answer
40 views

Why does `C-h b` show `??` as the command name for my key binding?

I've just added a nice custom key binding: ;; Open files in dired mode using 'open' (eval-after-load "dired" '(progn (define-key dired-mode-map (kbd "z") (lambda () (...
user avatar
  • 115
0 votes
0 answers
13 views

Doom Emacs Haskell helper type infer

I try my hand on Emacs and has a great time developing with Haskell. Below is a feature that is invaluable to me. After writing a function without the type, Doom Emacs automatically infer its type, ...
user avatar
  • 101
1 vote
1 answer
32 views

How to unbind `C--` from being the shortcut for scaling font size (`text-scale-decrease`)

The org manual states: To mark a task with a repeater as DONE, use {{{kbd(C-- 1 C-c C-t)}}}, i.e., ~org-todo~ with a numeric prefix argument of =-1=. However, I can't manage to do this as my C-- is ...
user avatar
1 vote
0 answers
35 views

How can I change buffer local key binding C-h, C-x, M-x in term raw mode?

I'm running a specific console application in a term window (char/raw mode). This application has no need for C-h, C-x, and M-x, so they should just do what they always do in Emacs. However, I don't ...
user avatar
  • 21
0 votes
0 answers
20 views

Pass through commands into ansi-term

I'm running into this problem: I have a tmux session on a remote machine running in ansi-term. I want to be able to, for example, copy and paste stuff in this session, but C-SPC for example, is ...
user avatar
  • 10.8k
1 vote
0 answers
82 views

isend: Why additional C-RET required when sending code to ansi-term?

The following code (from here) allows to send lines of code to an open *ansi-term* buffer via C-RET. It works well but the very first time I hit C-RET, the current line is not sent (nothing happens). ...
user avatar
0 votes
0 answers
34 views

Remove all keybindings (apart from the evil ones)

I love many things about Emacs, but its movement system (and key bindings) isn't one of them. It's just not for me. I would like to remove all Emacs key bindings, including ones by external modes, and ...
user avatar
  • 101
0 votes
1 answer
25 views

M-h not working on Mac (minimizes window instead of org-mark-element)

Using Mac OS Big Sur, org-mode 9.2.6 with GNU Emacs 27.2. I am trying to mark the whole item under the point. But when I use the M-h keystroke, the Emacs windows disappears and I need to click its ...
user avatar
  • 103
0 votes
0 answers
31 views

How to bind term-interrupt-subjob in term-raw-map with use-package?

I am trying to bind term-interrupt-subjob in term-raw-map like this, (use-package term :bind (:map term-raw-map ("C-c". term-interrupt-subjob) ("C-'". kill-buffer))) ...
user avatar
  • 725
1 vote
1 answer
32 views

Key binding to run Clojure code in running cider REPL and specified namespace

I have cider working just fine in Emacs with my Clojure code. I am following a tutorial that uses Cursive as the IDE; in the tutorial they were able to define a key binding to a line of code in a ...
user avatar
0 votes
1 answer
35 views

Listing of all the key mappings with function names and key map names which are currently active?

Is there a way in emacs (I'm using version 27.2 currently) to get a listing of all the key mappings that are active in the current buffer as well as the name of the mapped function? I also want the ...
user avatar
  • 522
0 votes
0 answers
31 views

some emacs bindings undefined on macOS

For instance, for s-! (M-! on my linux machine, running a single shell command) it says it is undefined, although s-x (M-x) works just fine (It seems like on mac it calls it s and not M?) Help am new ...
user avatar
1 vote
1 answer
47 views

Spacemacs missing some keybindings

I just installed Spacemacs v.0.300.0 but the following Spacemacs keybindings from this link do not exist: https://www.spacemacs.org/layers/+emacs/org/README.html#key-bindings The Key Binding tables ...
user avatar
  • 1,333
1 vote
1 answer
46 views

How to know whether a local keybinding map exists (for a given package) and its name

I was wondering if we can know whether a given package has a local map of keybindings. For example, I'd like to bind the function pdf-occur of the pdf-tools package by using the use-package macro. ...
user avatar
  • 59
2 votes
1 answer
45 views

Binding several keys to one yasnippet

Suppose we have a snippet for sql mode: # -*- mode: snippet -*- # name: select * # key: sel # -- SELECT ${1:*} FROM $2; Sometimes I forget to switch the keyboard layout and type Russian "ыуд&...
user avatar
  • 845
0 votes
1 answer
51 views

Key binding in terminal emacs [duplicate]

I started to use Linux Mint. On the Terminal, I can use emacs -nw and emacs. I can't get the same key behavior about the following two configs. In particular, these settings work in emacs, but not in ...
user avatar
  • 101
0 votes
3 answers
136 views

Some key bindings don't work on Ubuntu 20.04

Some of my many Emacs 27.5's customized key bindings do not work when I work with Ubuntu 20.04 on a Lenovo ThinkPad T15g Gen 1 with a US keyboard. Most key bindings work, but some like super-o or ...
user avatar
  • 59
0 votes
2 answers
112 views

How to map keybindings to find-file?

How I can map keybindings to find-file since there is no find-file-mode-map or something like that? I am using the vertico minimalistic vertical completion UI.
user avatar
2 votes
1 answer
231 views

How can I disable the Emacs NEWS shortcut?

While coding, I'll occasionally fat-finger a key combo and find myself dropped into the GNU Emacs NEWS buffer (M-x view-emacs-news or C-h n). This is never what I want, since it totally breaks my flow....
user avatar
  • 123
1 vote
1 answer
25 views

Display define-key output in echo area

This is my function, (define-key global-map (kbd "µ") (display-message-or-buffer (message "`%s'" (eval '(solar-sunrise-sunset-string (calendar-current-date)))))) But, when I ...
user avatar
  • 257
0 votes
1 answer
67 views

How to define multiple key bindings more concisely?

I'm trying to write a helper macro to conveniently define keybindings in my configuration file. The idea is to replace the following configuration entry: (use-package org-roam :config (define-key ...
user avatar
  • 103

1
2 3 4 5
25