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
1answer
32 views

next-line-add-newlines breaks history browsing by cursor arrow keys

I've always hated "end of buffer" errors, so my .emacs contains (setq next-line-add-newlines t) Recently, I've noticed that when browsing a history by cursor arrows (up/down for previous/next), e.g. ...
0
votes
1answer
187 views

Overriding a magit Keybinding using evil-mode and bind-map

I am using evil-mode, magit, evil-magit, and bind-map. I have defined a map with bind-map using SPC as my :evil-keys similarly to what spacemacs provides. Magit defines SPC as magit-diff-show-or-...
1
vote
1answer
58 views

Emacs triple click handler

What handler is called when I make triple click ? For me, it select whole line. I want this behavior to be binded to C-l, how to do it ? EDIT: I tried to bind this to key, but not works, how to fix ...
0
votes
1answer
58 views

Ignored keybinding

I have a problem with following key binding: (global-set-key (kbd "C-/") 'comment-or-uncomment-region) Actually, it is ignored by Emacs so undo is executed instead. I'm running Emacs in gui mode.
0
votes
1answer
298 views

How to remap shift-arrow in term-mode?

Is there a way to map Shift-left or other arrow keys to custom functions in term-char-mode? I tried, but without luck: (define-key term-mode-map [s-left] 'sandric/term-switch-line-mode) Entering ...
0
votes
2answers
64 views

Unable to supply macro name to edit-kbd-macro when M-x is bound to smex

When I M-x edit-kbd-macro, it prompts saying: Keyboard macro to edit (C-x e, M-x, C-h l, or keys): Here, I would hit M-x. It will then allow me to enter the name of the macro. I have several named ...
-1
votes
1answer
98 views

how bind `C-c g g` to `vc-git-grep`

How can I bind C-c g g to vc-git-grep ? So far I tried ;; in scratch buffer (global-set-key (kbd "C-c g g") 'vc-git-grep) ;; then M-x eval-region ;; then switch to another buffer ;; C-c g g
1
vote
1answer
119 views

key binding to invoke more than two commands

I'm in org-mode and would like to have C-c C-c ' run org-edit-special then mark-whole-buffer then indent-region then org-edit-special to get back out again. I've tried (defun my-run-org-babel-...
2
votes
2answers
81 views

Keybinding in Julia minor mode

I am unable to change keybinding in a minor mode. Initiaton of minor mode: (add-hook 'julia-mode-hook 'julia-repl-mode) I tried a view variatons for the keybinding: (add-hook 'julia-repl-mode ...
1
vote
0answers
85 views

how can i thoroughly change (key “C-x”) in ivy-minibuffer-map?

one thing very interesting, i tried to (define-key ivy-minibuffer-map (kbd "C-x") 'ivy-kill-line) ..well then i restart my emacs, the first time i use the ivy to complete something, i type C-x ...
0
votes
1answer
127 views

All arrow keys in dired+ buffer mapped to M-O

For some reason when I press Up, Down, Left or Right keys on keyboard in dired+ mode, emacs reads them all as M-O key, which I found out by describe-key command in dired+ buffer. I have no config ...
0
votes
0answers
21 views

C-d in java-mode not being overwritten by .emacs file

So I have a custom .emacs file that I have a series of key strokes bound to. The specific key stroke that I'm speaking of is C-d which I have bound to left-word via the line (global-set-key (kbd "C-d"...
2
votes
1answer
73 views

keybinding to switch to specific application

I'm running Emacs in a GUI, and I like having a keybinding that quickly switches me to a terminal. Yes, I know there's eshell, term, and shell in Emacs, but I still prefer a dedicated terminal ...
0
votes
1answer
36 views

Binding key to save in specific directory?

I want to bind a key to save a timestamped backup of the current buffer to a specific directory. For example C-§ will save my current buffer to ~/Org/Backups/2017-01-01-foo.org. Unfortunately every ...
1
vote
1answer
96 views

How to group key bindings in which-key?

I have binded Winum functions to SPC 0 - SPC 9. In which-key minibuffer I see each key by its own (10 labels), which occupies a lot of space. It would be great if I could group all winum keys labels ...
2
votes
1answer
51 views

`which-key` or similar, to show doc strings of commands bound to keys?

which-key package is very useful to show the list of command names. Could it (or any other package) also show the doc string of those commands?
1
vote
1answer
67 views

Binding a key to (MAP . CHAR)?

According to the define-key docstring, binding a key to a cons (MAP . CHAR) should cause that key to act as CHAR in MAP. However, I cannot get this to work. For example, evaling this and trying to use ...
2
votes
1answer
161 views

How to use M-O on Emacs in terminal?

I bind M-o to next-word, and want to use M-O to shift-select next word. M-O works well on Emacs GUI app on Mac, but not on Emacs in a terminal. The reason is: In the terminal, up-arrow is encoded as ...
1
vote
0answers
32 views

How to graphically represent Meta characters

Given that the variable x contains the numeric representation of the key "Control-Z", say (setq x ?\C-z), one may graphically represent its contents by issuing the command (char-to-string x), ...
1
vote
2answers
288 views

Returning to the parent hydra

I'm looking for a way to return to the parent hydra after using certain commands. In this example (defhydra hydra-a (:color teal) "a" ("b" (progn (hydra-b/body) (hydra-push '(...
0
votes
2answers
205 views

Dump list of current keybindings to standard out?

I like emacs, I like keybindings. I also like the command line and have a lot of keybindings. Is it possible to dump emacs keybindings to standard out so that I can search them with things like grep? ...
0
votes
1answer
342 views

How do I bind keys using general.el alongside evil?

My goal is to bind SPC SPC to counsel-M-x. I've tried using this snippet from this post (use-package general :ensure t :config (general-evil-setup t) (general-define-key :states '(normal visual ...
3
votes
1answer
203 views

More convenient auto-completion using ivy

I have the following lines in ~/.emacs: (require 'counsel) (with-eval-after-load 'org (define-key org-mode-map (kbd "C-c C-c") #'counsel-org-tag)) (with-eval-after-load 'org-agenda (define-key ...
1
vote
2answers
76 views

How can I define a key to cancel selection only when I selecting something?

How can I define a key to cancel selection only when I'm selecting something? Because I use this key to do other thing in global-mode-map.. Is there any specific mode for mark and selecting something?...
3
votes
2answers
190 views

How to use describe-key in Helm results buffer?

While in the results buffer of helm-projectile-grep, I know I can use C-<up> and C-<down> to visit the files with the matches, but I would like to rebind those keys. Normally I would use ...
2
votes
1answer
46 views

Determine whether a given keybinding is the default

I'm curious if there is a mechanism for determining whether a keybinding is a stock (default) keybinding within Emacs (or a particular package). Whenever I mention a command to someone I generally ...
5
votes
2answers
207 views

Keybinding for buffer word count

The following in my .emacs file does not produced the desired result of showing me the word count for the current buffer (it "does nothing"): (global-set-key (kbd "<f9>") (kbd "C-u M-=")) Is ...
1
vote
1answer
104 views

Use xcape-like Control_L=Escape only in Emacs evil insert-mode?

I like the idea of xcape for exiting insert-mode by just quickly tapping Control_L, but I don't like how it leaves "unconsumed" escapes around in other modes, or in other programs/terminals, which ...
1
vote
1answer
1k views

C-x C-f results in the error message: “Wrong type argument: commandp, counsel-find-file”

I opened Emacs, and executed C-x C-f. A beep sounded and the following message appeared in the status line: Wrong type argument: commandp, counsel-find-file All I wanted was to open an existing file....
3
votes
1answer
108 views

Change keybindings on buffer switch

I'm a new emacs user so its possible that I've misunderstood something. I'm looking for a function that automatically changes my current keybindings depending on the current major mode. My approach ...
4
votes
1answer
2k views

Wrong number of arguments on lambda key binding

I am not able to figure out what is wrong in this elisp form: (define-key ggtags-mode-map (kbd "M-.") (lambda () (interactive) (ggtags-find-tag-dwim) (recenter))) I keep getting this ...
3
votes
2answers
82 views

Convert bitmap vector keys into a human readable string

If you run (kbd "M-r") you'll get back the bit vector [134217842]. But what if I want to go the other way around: start with [134217842] and return M-r. How does one do that? I Have looked at the ...
1
vote
1answer
79 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 ...
1
vote
1answer
66 views

How to disable icicles integration with helm?

Long time ago I updated Helm and it replaced normal Icicles behaviour for choosing files. I had icicles bound to C-x C-f: C-x C-f runs the command icicle-file, which is an interactive Lisp function ...
6
votes
1answer
445 views

Using evil in the minibuffer

evil-mode does not seem to bind keys in the minibuffer. Is there a way to use evil in the minibuffer? It's hard to use Vim-style keybindings everywhere BUT the minibuffer.
0
votes
0answers
149 views

Spacemacs menu in mini-buffer displays Dired+ “C-x D A” command unreliably

Two weeks ago I installed Dired+. I successfully used Dired+ C-x D A (diredp-add-to-dired-buffer) command. But the Dired+ C-x D A command is not always available. Sometimes after C-x, the D appears ...
1
vote
3answers
440 views

Disabling arrow keys in Emacs EVIL Mode

I wanted to disable arrow keys in my Emacs to practice vim key bindings using EVIL mode. So instead of using global-unset-key as someone here on stackexchange suggested. I used the following code in ...
0
votes
1answer
96 views

Cannot define keybinding in markdown-mode

I'm trying to use the package checkbox together with markdown-mode. The checkbox documentation gives the following example on how to define a global keybinding for it's functionality: I'd recommend ...
4
votes
1answer
1k views

How to remap backward-delete and help command while using Emacs from a terminal emulator?

I was using Emacs on CentOS 7 from the MobaXterm terminal on Windows 7, but the backspace key instead of backward-deleting a character invokes the prefix command C-h. According to EmacsWiki, I tried ...
2
votes
1answer
75 views

Proper way to provide a default optional parameter

I like doing PR reviews with Magit's diff, thus calling magit-diff-visit-file pretty often, providing a universal argument for the optional other-window parameter. To optimize the process instead of ...
0
votes
2answers
1k views

In Spacemacs, how to customize keybindings that are condition on language file?

Here is what I would like to do. I would like to customize key bindings that point to a different command depending on the file type on which the user is operating. For instance, if one presses f5 in ...
1
vote
0answers
138 views

How can I disable the M-h keybinding in org-mode with evil-mode?

The problem seems to be that evil-mode translates the key chord M-<left> into M-h. Unsetting M-h by binding it to nil in the local, global or org-mode map in a org-mode hook does not help.
0
votes
1answer
528 views

spacemacs: how to unset the keybinding of undo with 'u'

I don't want to have key 'u' bound to undo-tree-undo, as it's too conveniently dangerous to confuse with u for universal argument prefix. I tried (global-unset-key "u") But it didn't have any ...
1
vote
2answers
149 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
227 views

Mapping AltGr+t key as a Ctrl+x (How to use AltGr key effectively in Emacs)

I am using international keyboard and extensively use AltGr key. There are many unused keys with AltGr so I would like to map AltGr+t = Crtl+x. I don't want to remap AltGr to Crtl; I just want to use ...
1
vote
1answer
247 views

How to set the keybinding for addind the hash symbol (#) in spacemacs with MacOS and an UK keyboard

I'm using spacemacs on a Mac OS X laptop with a UK keyboard and I want to be able to use Alt-3 (M-3) to insert the hash symbol #. I tried to add this function that I found on this SO answer without ...
0
votes
1answer
254 views

Auctex key-bindings for easy saving, compilation and viewing.

I am new to Auctex and Emacs. Previously I have been using vim-latex in which the key bindings are easy. For example, I was using Ctrl-Space in Vim to to save the tex file, compile the document and ...
2
votes
2answers
634 views

Spacemacs: How do I set a key in anaconda-mode?

I'm using the python-layer and am trying to set M-r to run replace-string while editing Python files. I've tried all of the options below from inside the function dotspacemacs/user-config. Help? ;; ...
2
votes
0answers
17 views

How to reliably redefine scroll wheel in isearch? [I'm using Mitsuharu Yamamoto's Mac port]

I decided to define <wheel-up> and <wheel-down> to isearch-repeat-forward and isearch-repeat-backward in the isearch-mode-map. This works, but if you scroll quickly, it reverts to ...
1
vote
1answer
121 views

Bind keys differently when in any minibuffer

I normally use my keypad numbers to perform various navigation commands, but one of those commands is goto-line, and when I'm in the minibuffer entering the line number, I want my keypad to run self-...