Questions tagged [evil]

Evil Mode is a Vim emulation layer for Emacs.

Filter by
Sorted by
Tagged with
34
votes
5answers
8k views

How to treat underscore as part of the word?

I use Emacs + evil mode. When I position the cursor on e (in normal state) in a chunk of text such as abc_def_ghi, ciw (change inner word) changes only the def part of the string, while Vim would ...
20
votes
1answer
3k views

evil-mode visual selection copies text to clipboard automatically

Setup: GUI version GNU Emacs 25.0.50.1 (x86_64-w64-mingw32) of 2015-07-25 on KAEL Compiled from EmacsW64. Package Evil, using the latest version of Evil from MELPA Windows 7 x64 bit. Situation: ...
17
votes
2answers
3k views

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

The default undo behavior in Evil is too coarse-grained because it considers anything taking place between entering insert mode and leaving it as one edit operation. When you enter a whole paragraph ...
16
votes
2answers
3k views

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

I just installed Spacemacs, mainly for its nifty defaults. One default I'm not so pleased about is that it puts tildes on empty lines in the file. I've tried putting (setq vi-tilde-fringe nil) and (...
14
votes
3answers
3k views

Is there an equivalent to sed-style substitution commands from vim?

One of the things I miss from vim is being able to type in a substitution command that will work over multiple lines, for example: :/begin/,/end/s/foo/bar/g The above command substitutes "foo" for "...
14
votes
1answer
9k views

Instructions on how to work with Evil Mode

I am considering in giving Evil Mode a chance. I have searched extensively to find how do you use it and everyone is just sharing their customizations. What I can't understand is when you install and ...
13
votes
7answers
4k views

Evil: map keybindings the vim way?

I am trying to make the Evil function evil-jump-to-tag, C-] behave like the Emacs binding M-.. The normal behaviour is fine for browsing Tags files, but I want it to work also for Slime's slime-edit-...
12
votes
2answers
3k views

How do I jump out of enclosing parentheses?

I'm using spacemacs to edit Python code. When I type an opening parentheses, the closing parentheses is automatically inserted for me and the cursor is put in the middle for further typing. But: ...
12
votes
3answers
2k views

Possible not to use undo-tree in evil mode?

Every so often I run into bugs in undo-tree, where I can't redo, with the following known bug, another report & reddit thread. primitive-undo: Unrecognized entry in undo list undo-tree-canary ...
11
votes
2answers
6k views

hybrid line number mode in emacs?

Is it possible to show the absolute number of the current line, instead of "0", when in relative line number mode? This is sometimes referred to as "hybrid line number mode". Like this: 7 ...
10
votes
1answer
3k views

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

Documentation for evil-normal-state-map: Keymap for Normal state. Documentation for evil-motion-state-map: Keymap for Motion state. Does Vim have a so-called "motion mode"? In Vim, executing :...
10
votes
1answer
3k views

Evil cursor change by state

Until today, when I was in the normal state in evil, the cursor was a block, and it would switch to an I-beam when in insert state. Something changed, however, and the cursor is now always the I-beam....
10
votes
2answers
804 views

How to Persist Evil Markers?

I want to be able to save my buffer local evil markers (m to mark a location and then ' or ` to jump to it) across emacs sessions/instances. I'm not really sure how to do this. I tried installing/...
9
votes
2answers
830 views

Default Magit commit state in Evil

I use evil. Normally, when I commit, I'd like to immediately start typing, but evil starts the buffer in evil-normal-state. I used to set (evil-set-initial-state #'git-commit-mode 'insert) But that ...
9
votes
1answer
3k views

How do I set up key bindings for modes in a specific Evil state?

I have a set of key bindings that I use for both web-mode and php-mode in insert mode (of Evil). So I cannot use set-local-map or something. Because in normal mode, the same keys will then call other ...
9
votes
1answer
2k views

Evil mode and regular expressions

In Vim, if I want search for all variable names LX where X is a number, I can simply type /L\d. However, this doesn't seem to work with evil. Is there another syntax for regular expressions in Evil ...
8
votes
1answer
1k views

How can I add a new colon-command to Evil?

evil-mode introduces vim-style colon commands (such as :wq to save and close). I have a few commands (such as kill-buffer, org-babel-tangle) that I'd like to be able to run through this instead of ...
8
votes
1answer
736 views

Cursor moves one position left after exiting insert mode?

I'm using evil via spacemacs. When I exit insert state, the cursor moves to the left one character. Why is that? Is it a bug, or is it a feature? Can I turn it off?
8
votes
2answers
3k views

How to access os clipboard using Emacs + Evil

How can i yank to/from windows clipboard when using: Windows 7 (x64) GNU Emacs 24.4.1 (x64) Evil 1.0.9 and having (setq x-select-enable-clipboard nil) in my .emacs? (I put this line there because i ...
7
votes
4answers
958 views

Have Ctrl-a increase a number just like in vim

In spacemacs Ctrl-a is being used to move to the beginning of the line. I'm more used to 0 to move to the beginning of the line and $ to the end, which works in spacemacs. Ctrl-a increases numbers in ...
7
votes
1answer
486 views

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

After creating an org-capture with the %? to place the cursor, the cursor will be in command mode. Is there a variable for putting it into insert mode or does org-capture elisp code need to be ...
7
votes
1answer
716 views

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

It's in the title: What's the difference between evil-search-forward and evil-ex-search-forward? When would I want to use one instead of the other? evil-search-forward Search forward for user-...
7
votes
2answers
564 views

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

How do I visually select the last pasted text with evil-emacs? gv reselects the last visual selection. I'd like a function/snippet that does the same for my last pasted text.
6
votes
2answers
721 views

How might I define (or fake) a mode-local ex command with evil?

It is possible to define ex commands using evil-ex-define-cmd. For example, :quit is defined as: (evil-ex-define-cmd "q[uit]" 'evil-quit) I'd like to override this behaviour in particular modes; in ...
6
votes
1answer
5k views

How to learn Dired in Evil mode?

I am learning Dired in Evil mode. h j k l / are Evil keys that obviously work in Dired. Are there others? Is there a table of Evil keys for Dired? I am using Emacs 25.2.1 with Evil, Spacemacs, and ...
6
votes
1answer
2k views

How can I translate my .vimrc into evil-mode

I have heard of the power of Emacs, but I have a ton more experience with vim and an extensive amount of shortcuts in my .vimrc file. I would like to transfer these mappings over to Emacs evil-mode. ...
6
votes
1answer
1k views

Using cask for package management

I am new to emacs. I'm trying to use cask to manage emacs packages. This is my ~/.emacs.d/init.el: (require 'cask "~/etsi/cask/cask.el") (cask-initialize "~/etsi") (require 'evil) (evil-mode 1) ~/...
6
votes
1answer
808 views

What is “Symbol Highlight Transient State”?

Pressing * (spacemacs/enter-ahs-forward) works like visual star in Vim, except for the mini buffer: What is "Symbol Highlight Transient State" in the mini buffer about? Where is the documentation ...
6
votes
3answers
379 views

How can I implement Vim's `undo line` command in Emacs' evil-mode?

From the Vim User Manual: 02.5: There's a special version of the undo command, the "U" (undo line) command. The undo line command undoes all the changes made on the last line that was edited. ...
5
votes
2answers
3k views

How to quit evil mode?

My vim-using co-worker came by, and since he wanted to do something with files on my PC, I installed evil-mode to allow him to do this more efficiently (vim user trying to accomplish anything in emacs ...
5
votes
2answers
866 views

Helm bind “C-j” and “C-k” to list navigation (cursor position)

Is it possible to change binding to navigate throw Helm list via C-j and C-k bindings? I came to Emacs from Vi(m) world and I really want to keep this mapping in my emacs + evil setup.
5
votes
2answers
3k views

Evil: Is there a default register that does not get overwritten by later yanks to explicit registers?

I often use registers in evil, but I have a common use case that I cannot seem to resolve. I would like to have all copied text stored somewhere that does not get overwritten when I explicitly make ...
5
votes
3answers
2k views

Disable evil-mode when git-timemachine mode is activated

How do I disable evil-mode in a buffer in which git-timemachine is activated?
5
votes
2answers
429 views

Using evil-mode with a function that does not work well with evil-mode

The great org-mode has a fast way to jump between headings in an org file; M-x org-goto or C-c C-j. This doesn't work with evil mode that well. If I am on evil normal mode in an org file, C-c C-j ...
5
votes
1answer
2k views

Remove key-mapping from org-mode

I'm transitioning from VIM (using GNU Emacs 24.5.1). I want to move between "windows" using familiar keys i.e. (global-set-key (kbd "C-k") 'windmove-up) (global-set-key (kbd "C-j") 'windmove-down) (...
5
votes
1answer
3k views

How to set evil-mode to use evil-emacs-state-mode in new buffers?

So far, I've tried this, but it doesn't see to be working - new buffers still start in normal mode. I'd prefer to default to evils emacs mode, and be able to switch into evil with C-z when I'm ready (...
5
votes
1answer
779 views

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

Unlike isearch, evil-search mode ignores case-fold-search option. Using evil-search like this for eg: (setq-default evil-search-module 'evil-search) Is it possible to make evil-search case ...
5
votes
1answer
466 views

How do I jump to the next sentence in evil?

When i press ) in Vim it jumps to the next sentence. In evil, however, ) (evil-forward-sentence) at the beginning of the following paragraph takes you to the paragraph's end, while in Vim it jumps to ...
5
votes
3answers
398 views

Org-mode: closing the nearest parent

I often find I want to close the nearest parent subtree, but don't know of a better way of doing this than navigating to the header first and then pressing tab. I use evil-mode, so properly this ...
5
votes
1answer
1k views

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

I'm trying to perform a search and replace in spacemacs but I need it to be case sensitive when by default it appears to be case insensitive. So I try to do :set noignorecase but then I have this ...
5
votes
4answers
309 views

Globally replace C- with SPC

I want to globally replace C- with SPC in emacs. This should make almost all emacs bindings not awful chords, and should completely avoid colliding emacs with evil/vim. It should also be able to be ...
5
votes
1answer
286 views

How can I get VolatileHighlights to work with evil-yank, evil-delete, etc?

With the guide on extending Emacs, I discovered the volatile highlights package. But it only works on Emacs operations like kill and yank. I would like to use it with Evil operations like evil-yank ...
5
votes
1answer
517 views

spacemacs key bindings in plain vanilla evil emacs

As the title suggests, I would like to use spacemacs like keybindings in plain vanilla evil emacs. The spacemacs key bindings are very intuitive. But the package is too heavy for my low-end laptop. ...
5
votes
1answer
793 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.
5
votes
1answer
257 views

Pasting text doesn't work properly in evil-/web-mode

In certain situations Emacs doesn't properly paste text. Apparently this only happens if the current buffer isn't saved and both web-mode and evil-mode are loaded. I was able to reproduce this ...
5
votes
2answers
696 views

Map keys in all modes?

Is there a way to bind keys across all modes? For example I have one binding: (define-key evil-normal-state-map (kbd "gt") 'persp-next) This works fine in some modes, but not in others, like org-...
5
votes
1answer
151 views

Emacs evil-mode: how to make visual selection to include diacritics?

For a text "naïve", for example, and the cursor is at "n", if I press vll, "naï" is highlighted, but if I press y, the yanked text is "nai", not "naï". How to make visual selection to include all ...
4
votes
1answer
2k views

How to remap : to ; in Evil Mode

What's the Evil Mode equivalent of these Vim commands? nnoremap : ; nnoremap ; : vnoremap : ; vnoremap ; :
4
votes
3answers
275 views

Any idea how turn quotes into double quotes?

One of the things that I love in Vim, was the faster way of insert double quotes (saves me hitting the shift key" inoremap '' ""<Left> So when I press the single quote, and type further, I ...
4
votes
1answer
825 views

How to check the current state in evil mode?

When writing elisp for evil mode, how can you check the currently active evil state?(normal, visual, insert... etc)

1 2 3 4 5 9