Hot answers tagged

45 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,059
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
  • 22k
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
  • 22k
16 votes
Accepted

How do I turn off Spacemacs’s tildes on empty lines?

Toggle You can toggle it off with (spacemacs/toggle-vi-tilde-fringe-off), you can get the list of all toggles in helm-spacemacs accessible via SPC f e h or SPC h SPC in more recent versions. Every ...
syl20bnr's user avatar
  • 2,095
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
14 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,562
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,166
13 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
  • 22k
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,535
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

hybrid line number mode in emacs?

You can make the current line number show instead of "0" by customizing the linum-relative-current-symbol variable. You can change that variable by one of multiple ways. M-x customize-group RET ...
Kaushal Modi's user avatar
  • 25.4k
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
  • 982
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,546
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
  • 32.7k
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

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
10 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,401
9 votes
Accepted

Cursor moves one position left after exiting insert mode?

"Moving one space left after leaving insert" is the default behavior in Vim, which evil (on top of which spacemacs is built) emulates by default. If you don't like that behavior, you can set (setq ...
Dan's user avatar
  • 32.7k
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
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
  • 32.7k
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
8 votes
Accepted

Evil-emacs: how to make search/replace (:s/) global by default?

There is a variable named: evil-ex-substitute-global If you check it with C-h v, it will give you the explanation: If non-nil substitute patterns a global by default. Hide Usually (if this ...
RainSia's user avatar
  • 96
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
  • 32.7k
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
  • 32.7k
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
  • 18.9k
8 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
  • 326

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