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: ...
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
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 ...
3
votes
2answers
2k views

Re-creating .vimrc key mappings in Emacs

I've been using vim for a while (though I'm only a basic user) and I've been trying out Emacs (specifically spacemacs). I have remapped H and L to go to the start / end of the line by adding the ...
3
votes
1answer
1k views

How to remap : to ; in Evil Mode

What's the Evil Mode equivalent of these Vim commands? nnoremap : ; nnoremap ; : vnoremap : ; vnoremap ; :
3
votes
1answer
235 views

Map a Key to an Evil Operator and to Other Things?

For example, in in lisp-mode, I want to be able to use d as normal but also remap something like "dh" to something like "sp-splice-sexp-killing-backward". In vim you can remap keys like this without a ...
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: ...
4
votes
1answer
579 views

Evil package/alternative for motion through CamelCase words?

Most programming languages use CamelCase ("anIdentifier") naming conventions for identifiers. With Evil, you could navigate inside those identifiers using Evil built-in motions is the [count]f{char}...
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.
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 (...
3
votes
1answer
632 views

Pasting in evil-mode when there's an active selection copies the selection

Currently when I select a bit of text replacing another bit of text (eg "viwp" to paste over the current word) it copies the thing I just replaced into kill ring. So if I try to paste over another bit ...
2
votes
2answers
182 views

make * in Spacemacs work like it does in vim

In Spacemacs, is there an easy way to make * (which calls the function spacemacs/enter-ahs-forward) work like it does in Vim? That is, I want * to perform forward searching like in Vim, without ...
2
votes
1answer
527 views

How to add a key-chord escape in Evil for input in other languages?

How do I get key-chords to work with evil and alternate input-methods? I enabled Korean input by M-x set-input-method and chose korean-hangul, which I found from following the first few instructions ...
1
vote
1answer
196 views

How to toggle whitespace mode in evil insert state?

I'd like to disable whitespace-mode while in evil insert state. The following hooks work, but require refreshing all font colors with (font-lock-fontify-buffer), and even then- sometimes it fails to ...
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 ...
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?
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.
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 ...
3
votes
1answer
275 views

How does comint-mode override beginning of line behavior? I want same functionality to eshell

My Emacs version is 24.5.1. Comint-mode protects the prompt by somehow defining the beginning of line to start directly after the prompt regex. This works for normal motion commands like move-...
3
votes
2answers
587 views

How can I disable “q” in normal state in evil for some modes?

I'm using Spacemacs. I noticed that in help-mode, q quits, which is exactly what I want. However, in certain other modes, customize-mode, for example, q is bound to evil-record-macro. (I set it to ...
3
votes
1answer
358 views

How can I temporarily disable Spacemacs key bindings to work with org mode?

I am trying to learn an orgmode tutorial in Spacemacs (terminal mode) and it seems tha the Spacemacs key bindings are getting in the way. How can I revert the Spacemacs bindings temporarily for that ...
3
votes
1answer
376 views

How to jump up or down to first non-whitespace character in same column

I use evil-mode with Emacs and would like to accomplish this via evil-mode, but would be fine with doing it in an Emacs centric way too. The subject line explains it well, but here is a post in which ...
3
votes
3answers
1k views

Using 'jk' to exit insert mode with key-chord or anything else

I'm trying to transfer over from vim to Emacs. I'm using evil to emulate vim modal editing. In vim, I've remapped jk to get me out of insert mode and back into normal mode using inoremap jk <esc>...
3
votes
1answer
2k views

evil mode - make helm quit with the escape key

I followed this guide to make escape quit from various modes... ;; esc quits (defun minibuffer-keyboard-quit () "Abort recursive edit. In Delete Selection mode, if the mark is active, just ...
2
votes
1answer
253 views

How to rebind evil key mappings for delete and friends?

I am looking to rebind some evil mode keys used in navigation and text selection. For example, I am able to successfully map the following evil-mode keys to the following functions: (define-key evil-...
2
votes
1answer
461 views

Cant bind <SPC> in evil mode?

for some reason i cant bind space in evil mode and get an error. all other keys work well. any clue? this is the bind that dosent seem to work (define-key evil-normal-state-map "<SPC>" 'hydra-...
2
votes
1answer
533 views

Why is my “repeat last action” (dot) operator is not working?

I'm a vim user moving to emacs evil. I just added this line to my .init.el file and it broke my dot functionality. (define-key evil-insert-state-map (kbd "TAB") 'evil-force-normal-state) Why? I'm ...
1
vote
1answer
468 views

How to execute a command on the selection (shell-command-on-region) in evil mode, without losing the selection?

I'd like to use shell-command-on-region on the region, in a way that keeps the selection, even in the case the length of the output changes, and works in regular emacs and in evil mode? Note, I've ...
1
vote
2answers
662 views

Enable evil in specific modes

I want Emacs to default to Emacs bindings, but to be able to define a list of modes in init.el that enable evil-mode. I want something similar to this: http://wikemacs.org/wiki/Evil#...
0
votes
1answer
391 views

How do I set cursor colours per evil-state in the (non-GUI) text terminal?

In the terminal, (set-cursor-color "red") has no effect, so the only way I can distinguish insert from normal mode under evil-mode is through the <N> or <I> on the modeline. Is there a way ...
0
votes
1answer
224 views

How to set the evil-visual-line region (selection) programmatically in Emacs Lisp using indices?

Given 2 absolute numbers (compatible with region-beginning, region-end). How can these numbers be used to set the evil-mode line visual selection? (note, I originally asked this question, but found ...
0
votes
1answer
311 views

Leave evil insert mode with control key

Is it possible to use the control key to exit Evil's insert mode? I'm currently using the following code to do it with TAB, but since control only seems to work as a modifier key, I'm not having any ...