Skip to main content
24 votes
Accepted

Differences between evil-normal-state-map and evil-motion-state-map

Motion state is an Evil-specific thing, intended for modes where you don't edit text, but still want Vim-style movement available, with all other keys of that mode passing through. Help buffers are ...
wasamasa's user avatar
  • 22.3k
18 votes
Accepted

DOOM Emacs: Error running hook "global-git-commit-mode" because: (void-variable transient-base-map)

It seems that some magit dependencies break with Emacs 28, as the function defvar-keymap is only added in Emacs 29. The solution is to pin an older version of the packages, as Doom currently does not ...
Eric's user avatar
  • 306
17 votes

How to treat underscore as part of the word?

The spacemacs FAQ offers the following language-specific solution: ;; For python (add-hook 'python-mode-hook #'(lambda () (modify-syntax-entry ?_ "w"))) ;; For ruby (add-hook 'ruby-mode-hook #'(...
ejoubaud's user avatar
  • 279
17 votes
Accepted

How to remap : to ; in Evil Mode

First of all, in Emacs one thinks in keymaps and commands, not so much keys in their (original) context. Your first step would be figuring out how the commands are named in Evil's normal and visual ...
wasamasa's user avatar
  • 22.3k
16 votes

Strange behaviour on evil-delete

I noticed the d key deleting a line on a single press as well. I am using Spacemacs [email protected] on the develop branch. I do not know if this is your case, but I had an incomplete search in progress. ...
Lee Read's user avatar
  • 161
15 votes
Accepted

How to unhighlight after searching in evil mode?

You can achieve the same as entering :noh with the command evil-ex-nohighlight. But since you are using spacemacs, it can be even simpler: hit SPC s c to clear highlights.
EFLS's user avatar
  • 1,632
14 votes
Accepted

How can I disable evil in help-mode?

The reason this fails is because help-mode is in evil-motion-state-modes by default, adding it to evil-emacs-state-modes will therefore not have the desired effect as Evil looks it up in evil-motion-...
wasamasa's user avatar
  • 22.3k
14 votes
Accepted

Fold all methods in a Python class with Evil

It's not documented well enough, and possibly poorly named, but the hideshow function hs-hide-level will collapse all the blocks within the current block. That is, if your cursor is on the class ... ...
nega's user avatar
  • 3,346
13 votes

Have Ctrl-a increase a number just like in vim

The package evil-numbers does exactly what you need.
Panagiotis Koutsourakis's user avatar
12 votes
Accepted

How to disable evil-mode everywhere?

More explanations how to remove Evil are in .emacs.d/modules/editor/evil/README.org and to quote it: You must do two things to remove Evil: Remove :editor evil from ~/.doom.d/init.el, Run doom ...
Ian's user avatar
  • 1,713
11 votes

In Evil mode, how can I prevent adding to the kill ring when I yank text, visual mode over other text, then paste over?

The suggestion in @gongqj's answer changes the behavior of paste so that cut text (via d) no longer gets pasted. This does not seem like what you want given your comment: Ideally pasted over text ...
Kevin Ji's user avatar
  • 211
11 votes
Accepted

How to make <tab> work in org mode when combined with evil mode?

It's not 100% clear what you want the tab key to do when you're in org-mode. What you have done is to bind tab in evil's "global" normal-state keymap. If you're in normal state in an org buffer, tab ...
Dan's user avatar
  • 33.3k
11 votes
Accepted

How to check the current state in evil mode?

The state can be accessed via evil-state, eg: (cond ((eq evil-state 'visual) (do-something)) ((eq evil-state 'normal) (do-other-thing)) ((eq evil-state 'insert) (do-another-thing)))
ideasman42's user avatar
  • 9,027
11 votes
Accepted

How to do case sensitive searches using evil's evil-search?

What to do You can customize the variable evil-ex-search-case to tell it what you want evil to do when searching. Here's the docstring: evil-ex-search-case is a variable defined in evil-vars.el. ...
Dan's user avatar
  • 33.3k
11 votes

Is there a table of Evil keys for Dired?

Here are a few things you can try to see available keys: ? -- actually this is partly wrong because SPC ? dired F1 m (describe-mode) SPC h SPC dired -- this lets you jump to the code for the layer ...
Croad Langshan's user avatar
10 votes
Accepted

Difference between `evil-search-forward` and `evil-ex-search-forward`

evil has two search implementations, one is its own, the other one is a wrapper around emacs isearch. evil-search-forward wraps isearch-forward, evil-ex-search-forward invokes the internal search. ...
Yuri Steinschreiber's user avatar
10 votes

Using evil in the minibuffer

PR #1059 implemented this. Turn it on like this: (setq evil-want-minibuffer t) Watch out not to become too evil! :D
Alexander Shukaev's user avatar
10 votes

Have Ctrl-a increase a number just like in vim

I've stumbled upon the same issue of preference and as suggested before, evil-numbers is the package for that. But while trying to set it up, it was surprising that evil-numbers is already in ...
Alvin's user avatar
  • 101
9 votes
Accepted

How can I use multiple cursors in evil/spacemacs

As of Nov 2018, the spacemacs develop branch has a multiple-cursors layer available which notes that: Currently the only supported backend is evil-mc, but more backends will be available in the ...
aculich's user avatar
  • 336
8 votes

Pasting without auto-indent

You can disable indent on paste altogether with: (setq-default spacemacs-yank-indent-threshold 0) This variable is the size of paste region that is "too large" to auto-indent. We set it to 0 so ...
singpolyma's user avatar
8 votes
Accepted

Evil mode and regular expressions

evil uses the Emacs regexp facilities under the hood. Unfortunately, Emacs does not appear to have a separate syntax class for digits, and does not recognize the \d regexp class. So, to match your ...
Dan's user avatar
  • 33.3k
8 votes
Accepted

how do I do case sensitive searches using evil/spacemacs?

Short and narrow answer You need to set the variable case-fold-search to nil in order to have case sensitive search. So: put this somewhere in your init file: (setq case-fold-search nil) See the ...
Dan's user avatar
  • 33.3k
8 votes

Possible not to use undo-tree in evil mode?

The author of undo-tree.el, Toby Cubitt, is presently too busy to fix this particular bug. If he has time in the future, he may look into the issue further. The author has indicated that he has ...
lawlist's user avatar
  • 19.4k
7 votes

How can I get undo behavior in Evil similar to Vim's?

According to the variable description (see C-h v evil-want-fine-undo) the value fine is not supported any more due to inconsistent behaviour. As I use undo to undo typos or the mentioned setting ...
Jörn Reimerdes's user avatar
7 votes
Accepted

Enter regular command in evil insert state?

This might not be exactly what you want, but there is a way to execute one command and then return to insert state. Press C-o (evil-execute-in-normal-state) which puts you in a state where the next ...
Guildenstern's user avatar
7 votes

After-advice for disabling evil-mode in ansi-term has no effect

Disabling Evil is the wrong approach to this problem, customize the initial state for term instead: (evil-set-initial-state 'term-mode 'emacs)
wasamasa's user avatar
  • 22.3k
7 votes

How can I get RET to follow org-mode links when using evil-mode?

The easy way out is to unbind RET for Evil as it isn't bound to a useful command anyway. This will let Emacs look it up in keymaps with less priority. You can do the same with SPC and TAB (keep in ...
wasamasa's user avatar
  • 22.3k
6 votes
Accepted

How do I paste code without auto indentation

Because you're using Emacs inside of a terminal emulator, it can't generally tell the difference between something that was typed in and something that is pasted in. You do have some options, though. ...
db48x's user avatar
  • 18.8k
6 votes
Accepted

Get rid of evil's state info such as ` -- INSERT -- ` in the echo area

Here's the solution for insert state. You can apply the same idea to other states as you see fit. (setq evil-insert-state-message nil)
justbur's user avatar
  • 1,510
6 votes
Accepted

History of search terms for evil mode?

You will find things more Vim like with the Evil search module rather than isearch search module with Evil : (evil-select-search-module 'evil-search-module 'evil-search)
Jeeves's user avatar
  • 629

Only top scored, non community-wiki answers of a minimum length are eligible