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
26 views

Bind multiple keys to a command using `global-set-key` interactively

I want to bind multiple keys interactively to a single function using global-set-key. For example, let M-. g bind to project-find-file function. How to achieve this?
0
votes
0answers
8 views

Map maximizing window and frameset-to-register/restore frame configuration to C-x 1

Currently C-x 1 maximizes the current window. What I wish to have is to use C-x 1 to maximize the current window (if there are more open) AND store the current frameset to an arbitrary register (eg. ...
0
votes
2answers
24 views

Make Evil Mode “s” key behave like Vim

Doom Emacs' s key does not behave like Vim's implementation. In Vim, s deletes the character under the cursor and puts you into insert mode whereas Evil Mode performs a search, similar to f and t. Is ...
0
votes
1answer
26 views

How can we get input using emacs?

In order to compile my lua code i use this config (defun lua-main-compile () "use lua to compile my lua code" (interactive) (compile "lua main.lua")) In my lua code when i type x =...
0
votes
0answers
4 views

Can't run command using C-. keybinding with Evil

I'm trying to use racket-mode for programming Racket. One of the racket-mode commands is bound to C-c C-. (control c, control period). However, whenever I try to press C-c C-., it appears to get ...
0
votes
1answer
41 views

Leave evil's insert state with Control + c

I would like to be able to leave the insert state (I think that's what it's called in emacs?) using the Ctrl+c combination I know from vim. I'm using doom-emacs in case that's important, and I'm ...
1
vote
1answer
42 views

Understanding emacs keys

I'm vim user and I've just started using emacs with evil. But one thing I'm finding really hard to understand is when do we use <C-x>, <M-x> etc. I want to understand when to use Control ...
0
votes
1answer
20 views

I need a key binding of: “M-x compile” then in Compile commant type the “Compile command: love2d /home/huseyin/Documents/Programming/Lua/”

I need a key binding of: M-x compile then in compile command type like Compile command: love2d /home/huseyin/Documents/Programming/Lua/ I am tired of doing that again and again.
0
votes
0answers
23 views

How to set leader-key-like chord sequence in Evil mode?

I am using Spacemacs with evil mode and this works: (define-key evil-normal-state-map (kbd "m") 'set-input-method) However, I would like to use something like this: (define-key evil-normal-...
1
vote
1answer
40 views

Why do these two different use-package declarations (for the same package) have different effects?

What I want to accomplish is to add a keybinding C-<backspace> to the eshell-mod-map that calls func. That can be done like this, (use-package eshell :init (defun add-func-keybinding () (...
1
vote
1answer
64 views

How to bind a keybinding to add `\textit` or `textbf` for the word, where the cursor is pointing?

I am working on a LaTex file. Is it possible to bind a keybinding to add \textit or textbf for the word, where the cursor is pointing? For example, cursor is on top of word hello: hello converted ...
0
votes
1answer
30 views

How can I bind `C-c C-j` to always do `org-journal-new-entry`?

I did: (use-package org-journal :ensure t :defer t :config (setq org-journal-dir "~/org/journal/" org-journal-date-format "%A, %d %B %Y" org-journal-time-...
1
vote
1answer
44 views

Can I use Right Alt/Ctrl Keys as Alt/Super/Hyper modifier keys of Emacs in Windows 10?

I noticed that I've rarely used Right Control Key and Right Alt Key in my keyboard, so I'm wondering if I can use them as Alt/Super/Hyper modifier key in Emacs. Is such a thing possible in Windows 10? ...
0
votes
0answers
29 views

setting C-, and C-. key bindings

I am unable to set the C-, and C-. key bindings! I tried adding the following, (global-set-key (kbd "C-,") 'forward-char) (global-set-key (kbd "C-.") 'forward-char) In various ...
0
votes
1answer
37 views

Any way to remap the meta key with evil?

Function modifiers in Emacs conflicts with many hotkeys I have (for example, conflicts with i3wm). By using evil I could use evil to avoid most of conflict hotkeys. However, I do still need to use ...
3
votes
1answer
57 views

Can we do `C-c >` and `>` and `>` to continue indentation

I am using following answer to handle indentations Emacs bulk indent for Python C-c > or C-c C-l shifts the region 4 spaces to the right C-c < or C-c C-r shifts the region 4 spaces to the left ...
1
vote
1answer
26 views

Defining keyboard shortcuts from an argument in a function

I would like to write a command that defines key bindings for me, so that I can feed in key y (for example) and have it define key bindings for M-y, C-y etc. I'm trying to concat the command argument ...
0
votes
0answers
15 views

How can I stop iso-transl running

I have run the macport emacs 27 on macOS. The bindins of my keys as as per mac-keys-mode (anmd aquamacs) and have Command key acting as alt. Thus all my key bindings are A-key This normally works. ...
2
votes
1answer
64 views

Binding XF86Cut and XF86Copy to Emacs Commands

I have a keyboard with dedicated keys for XF86Cut, XF86Copy, XF86Paste. I want to bind these to Emacs commands. The goal is get the usual behavior for cut-and-paste between Emacs, my terminal, and my ...
0
votes
0answers
12 views

How to prevent M-TAB to print “;9~”

I have defined a key-binding for M-TAB , as follows: (global-set-key (kbd "M-TAB") 'suspend-frame) This works fine but once in a while it prints ;9~. I am not sure the main cause of this. ...
6
votes
1answer
263 views

How to protect myself from my own mistakes?

I use Emacs for programming and also read mail in Gnus. My problem is that I'm typing fast, switching buffers and Windows etc, and too often accidentally hit some key that is bound to some command ...
1
vote
1answer
29 views

How to set smerge-command-prefix to “\C-cv”

I find the default prefix for smerge-mode C-c^ and I have following setup: (setq smerge-command-prefix "\C-cv") (setq smerge-command-prefix "\C-c\C-v") Also C-c ^ runs the command ...
0
votes
0answers
12 views

Keybinding causes only a cursor blink ('\C-t') and no command is executed

This article is about the keyboard key combination 'Control + t' (smallcase 't') This problem is exclusive to the GUI version and does not come up while using the terminal. I am using Wayland Control+...
1
vote
0answers
30 views

Autocomplete when editing file links

When I insert a link into an org-file using C-c C-l (Doom Emacs, if that matters) and select file:, it show me the files in the current directory to autocomplete from. However, when editing such a ...
0
votes
2answers
30 views

How to loop over keymaps and assign keys?

If I have a key binding I want to apply to multiple keymaps, for example. (evil-define-key 'visual c-mode-map (kbd "C-M-?") 'c-comment-from-c++) (evil-define-key 'visual c++-mode-map (kbd &...
1
vote
0answers
18 views

Is the Hyper modifier key usable on non-X11 platforms?

I have a hyper modifier setup, however I was wondering if it's possible to use this on any windowing systems besides X11, for example: macOS Wayland Win32 The terminal.
1
vote
2answers
39 views

Implement modal interface in a major mode

I am creating a major mode, and would like to have modal interface (such as vi) on it. I want to have a special key that toggles the behaviour on arrow keys. So, for example, if the special key is hit,...
2
votes
1answer
37 views

Cannot bind Meta + Shift + Character

I am not able to bind Meta + Shift + any character. I do not experience these problems with other key combinations (such as Control + Shift + Key). Below is the specific case that I cannot get to work:...
0
votes
0answers
12 views

Make ido-completing-map override minibuffer-inactive-mode-map

I'm trying to bind a key in ido-completing-map, and I want it to override the key-binding with the same key from minibuffer-inactive-mode-map. But the latter seems to take precedence. How can I remedy ...
0
votes
1answer
36 views

How to track down where Emacs message “<Scroll_Lock> is undefined” comes from?

I am using Emacs 25.5 and now am getting the message: "<Scroll_Lock> is undefined" appearing regularly in the Messages buffer. If I turn on debug-on-error, it doesn't stop on it and ...
0
votes
0answers
21 views

keybinding behavior and smartparens

I am using a german keyboard layout and because it is very annoying to type curly brackets I have remapped them to C-7 and C-0 in addition to the default binding AltGr-7 and AltGr-0. I also want to ...
0
votes
0answers
14 views

how to get out of a (R) repl’s multi-line (multiple-line) / line-continuation mode

My question: In (an R-repl from ESS layer) in spacemacs, I can’t end a multiple-line after I start it myDf %>% # here i hit RET so then the REPL goes into multi line mode: + myDf %>% myDf %&...
2
votes
1answer
47 views

Umlauts in Emacs on Mac

Sorry for the newbie question. I have been using Aquamacs more many years. As it is not as actively developed as it used to and became increasingly buggy in the past two years I want to make the ...
2
votes
2answers
165 views

Inserting timestamp in mini buffer in Emacs

I keep on saving various org files in their respective folders using Filename as YYYY-MM-DD.org files . So I ended up typing C-x C-w 2020-10-06.org at least thirty times today. Can this process be ...
0
votes
0answers
15 views

Evil and adding a binding for evil-ex-define-cmd globally for tabbar mode

I’m using spacemacs: •  How can I (globally —ie, permanently) bind a new command :tabe to open a new tab in the emacs built-in minor mode TabBar? •  Right now, :tabnew works. But I want to make :tabe ...
1
vote
0answers
24 views

Don't understand the keybinding for auto-yasnippet

I am looking to use auto-yasnippet but I don't understand the keybindings they are suggesting such as H-w and H-y. I haven't seen any keybinding that starts with H so I am not sure what that is. I ...
4
votes
1answer
58 views

Why my minor mode bindings do not get precedence over global/major mode bindings? BUG?

EDIT: ANSWER The cause for the problem in this question was pointed out in the Emacs mailing list. It is due to the (kbd ...) forms not getting evaluated because the keymap in the define-minor-mode is ...
3
votes
2answers
79 views

How to specify prefix argument in key binding

The description of C-x C-e mentions: ...Interactively, with a non '-' prefix argument, print output into current buffer. I understand this to mean this logic is triggered when I issue C-u C-x C-e, ...
1
vote
1answer
196 views

Remap lsp-mode prefix with use-package

How do I remap the lsp-mode prefix key to "s-k" using the use-package package? I tried the following (use-package lsp-mode :ensure t :init (setq lsp-keymap-prefix (kbd "s-k") ...
0
votes
0answers
50 views

How can I make emacs interpret tilde ~ as a literal tilde (never to modify letters like Ã, Ñ)

I want to always have tilde insert a literal tilde (~). How can I ensure this in emacs? This also happens when I start emacs with -q or -Q! Version info: GNU Emacs 27.1 Copyright (C) 2020 Free ...
0
votes
1answer
42 views

How to remap the search backwards evil-ex-search-previous command of evil?

I want to remap evil-ex-search-previous to some other key than ,. I tried (define-key evil-motion-state-map "," 'evil-avy-goto-char-in-line) (evil-define-key 'normal magit-mode-map ",&...
1
vote
1answer
64 views

How to disable remapping by a package

I recently used a package that overwrote C-x C-s to something other than save, causing me to lose a lot of work. Is there a way I can advise emacs to check for a blacklist of keybindings that it ...
1
vote
0answers
46 views

How to remap meta-arrow keys in org-mode

Say I want ctrl-shift-arrows to do what meta-arrows normally do in org-mode. How do I do this? I tried (define-key org-mode-map "C-S-<up>" 'org-meta-up)) (and so on for down, left, ...
1
vote
2answers
102 views

Is there a better way of writing this with use-package?

I feel like there is a better way of writing this with use-package but I just can't get the usual way to work. (use-package eshell :hook (eshell-mode . (lambda () (define-key ...
1
vote
3answers
65 views

Super-s: How to express it? Is some escaping needed in the syntax?

This code binds "Super-c" to lambda: (global-set-key (kbd "s-c") (lambda () (interactive) (jump-to-register 'q))) How can I bind Super-s? They are both denoted as "s&...
1
vote
1answer
19 views

Add separator to main toolbar

How is a separator added to the main toolbar? I have no trouble adding an icon/item with tool-bar-add-item but can't find a way to add a separator.
0
votes
2answers
101 views

How can I exit emacs without saving any changes

I would like to be able to exit emacs without saving changes. I might have started editing some configuration file, then decided that I don't want to save the changes. In vi I would issue the q! ...
0
votes
1answer
52 views

Recreate spacemacs' ivy/projectile 'SPC P SPC' binding for helm/projectile

I recently switched from ivy to helm in spacemacs as my project search/management package. In ivy, there is a keybinding for SPC p SPC that does a search for files in the project (by file name). There ...
0
votes
1answer
180 views

Break key as a shortcut — what am I doing wrong?

I would like to define a keyboard shortcut in my .emacs file so that the Break (a.k.a. Pause) key does a C-x C-s C-x C-c. As a warmup, I thought I would try something simpler, so as a test I did this, ...
0
votes
1answer
38 views

Hardline Wrap and Emacs Keybinding

The terminal interface to Emacs is marvelous and I like how it handles parentheses. I have two questions as I'm trying to move to Emacs as both a writing and coding environment. I installed a minimal ...

1
2 3 4 5
22