Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [evil]

Evil Mode is a Vim emulation layer for Emacs.

28
votes
5answers
5k 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 ...
19
votes
1answer
3k views

Emacs doesn't paste in Evil's Visual mode with every OS clipboard

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
2k 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 ...
15
votes
2answers
2k 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
1answer
8k 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
3answers
2k 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 "...
12
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-...
11
votes
1answer
2k 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: ...
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
2answers
4k 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 ...
9
votes
1answer
1k 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 ...
9
votes
2answers
1k 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 ...
9
votes
2answers
554 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/...
8
votes
2answers
621 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 ...
8
votes
1answer
542 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
2k 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
1answer
2k 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 :...
7
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 ...
6
votes
1answer
343 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 ...
6
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....
6
votes
1answer
473 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-...
6
votes
2answers
465 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
1answer
363 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
2answers
404 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
2answers
631 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
1answer
372 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
2answers
477 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 ...
5
votes
3answers
289 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
428 views

evil mode: switch back to normal mode automatically after inaction

I was wondering if anyone has ever looked at a way to switch back to normal mode automatically after inaction? In Vim, there are several methods to do that, such as: http://vim.wikia.com/wiki/...
5
votes
1answer
1k 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. ...
5
votes
4answers
194 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
246 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
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) ~/...
5
votes
1answer
489 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 ...
5
votes
3answers
305 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
1answer
208 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
469 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
114 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
3answers
245 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
2answers
352 views

Moving cursor to the middle of the line where it currently is

Is there a way to define a function that, when called, would move the cursor to the middle (or close to the middle) of the current line, similarly to how we can move it to the beginning and end of the ...
4
votes
2answers
2k 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 ...
4
votes
2answers
745 views

Always enter emacs mode with ansi-term

I have a freshly installed spacemacs installation and I want to make it so that I ansi-term is in emacs mode. However, I try to add (add-to-list 'evil-emacs-state-modes 'term-mode) to my .spacemacs ...
4
votes
3answers
1k 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?
4
votes
1answer
2k 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 (...
4
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 ...
4
votes
1answer
371 views

Simulate vim splash screen

I've been trying evil mode in emacs. Unfortunately, it does not remind me to "Help poor children in Uganda!" when I start emacs. Is there a simple way to simulate this? Hopefully there's just a ...
4
votes
2answers
214 views

Making `dj` delete two lines in evil mode

dj in vim deletes the current line as well as the next. It's a bit idiosyncratic (in that it doesn't really make sense as a motion) but I've come to rely on it. In evil, however, dj deletes only the ...
4
votes
2answers
108 views

Help! Emacs empty my 1 year org file

I have used Emacs Org mode for my notes for several years, and I use Prelude configured with evil. Everything works fine. Until a few minutes ago, I found the note file is empty of content. and the ...
4
votes
1answer
832 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 ...
4
votes
1answer
229 views

evil-surround: change and delete not working with all surroundings

I'm using GNU Emacs 24.5.1 (GUI version) on Mac OS X 10.11.1 with Evil mode and installed evil-surround through the built-in package manager of Emacs. Now, I can add all surroundings, for example, ...