48 votes

How to treat underscore as part of the word?

The following snippet will make Evil treat an Emacs symbol as a word. (with-eval-after-load 'evil (defalias #'forward-evil-word #'forward-evil-symbol) ;; make evil-search-word look for symbol ...
Nova's user avatar
  • 1,119
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.2k
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.2k
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,582
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.2k
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,221
12 votes

How to quit evil mode?

You should also be able to C-z to enter normal emacs mode, and then another C-z to go back to evil.
mclear's user avatar
  • 1,555
12 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
11 votes
Accepted

Evil mode - How to go into Insert mode after Org-capture with %? cursor placement

Credits to awalker4 from reddit! (add-hook 'org-capture-mode-hook 'evil-insert-state)
irregular's user avatar
  • 1,012
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 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
  • 8,806
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
  • 33k
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
11 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,463
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
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
  • 33k
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

Remove key-mapping from org-mode

Org-mode is built-in to Emacs 24.5.1, so there's no need to eval-after-load. with-eval-after-load is also preferred over eval-after-load. Instead of trying to remap org-kill-line, why not just ...
Tianxiang Xiong's user avatar
9 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
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
  • 33k
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
  • 33k
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.1k
7 votes
Accepted

Evil-emacs: how to select last pasted text (like gv)?

In my .vimrc I have nnoremap <leader>v '[V'] to do exactly this. Amazingly, the sequence '[V'] works in evil just fine. To have a shortcut in Emacs, I wrote the following function: (defun ...
Andreas's user avatar
  • 86
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

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