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 ...
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 ...
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 #'(...
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 ...
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.
...
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.
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-...
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 ... ...
13
votes
Have Ctrl-a increase a number just like in vim
The package evil-numbers does exactly what you need.
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 ...
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 ...
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♦
- 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)))
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♦
- 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 ...
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.
...
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
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 ...
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 ...
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 ...
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♦
- 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♦
- 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 ...
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 ...
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
...
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)
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 ...
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.
...
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)
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)
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
evil × 562key-bindings × 140
spacemacs × 83
org-mode × 44
doom × 25
motion × 17
vim-emulation × 16
keymap × 15
indentation × 14
copy-paste × 12
init-file × 10
magit × 10
hooks × 10
search × 10
text-editing × 10
dired × 8
cursor × 8
scrolling × 7
advice × 7
code-folding × 7
yank × 7
regular-expressions × 6
replace × 6
commands × 6
undo-tree-mode × 6