Questions tagged [evil]

Evil Mode is a Vim emulation layer for Emacs.

Filter by
Sorted by
Tagged with
39
votes
7answers
10k 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
4k 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: ...
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 ...
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 ...
4
votes
1answer
3k 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
2k views

How do I paste code without auto indentation

I just setup the latest Spacemacs. I'm pasting python code from here https://raw.githubusercontent.com/jpmens/mosquitto-auth-plug/master/examples/http-auth-be.py into a new buffer. When I do this it ...
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 ...
7
votes
2answers
5k 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 ...
3
votes
1answer
280 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 ...
1
vote
1answer
210 views

Evil key bindings with evil-define-key do opposite of what I want?

Below is the entirety of my Evil key bindings in init.el: (evil-define-key 'normal 'global (kbd "SPC") (make-sparse-keymap)) (evil-define-key 'normal 'global (kbd "SPC TAB") #'ivy-switch-buffer) (...
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: ...
2
votes
2answers
5k views

How can I use multiple cursors in evil/spacemacs

There are multiple multiple-cursors implementations for emacs. I have the impression that extra work has been required to make them work well in evil and spacemacs in particular. I imagine the ...
12
votes
4answers
3k 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 ...
5
votes
2answers
901 views

Fold all methods in a Python class with Evil

How can I fold all the methods in a Python class? I use Evil and would prefer a pure Evil solution, if possible. I'm looking for a quick way to take something like this: class LongClassIDidNotWrite(...
5
votes
1answer
3k views

How to disable evil-mode everywhere?

I have recently installed emacs doom, and I tried to customise it with some custom keybindings. I have found that Evil is just not something I want. I can disable it on a per-buffer basis with M-x ...
5
votes
1answer
982 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}...
8
votes
1answer
1k 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.
6
votes
2answers
4k 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 ...
6
votes
1answer
2k 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
1answer
4k 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
3answers
578 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 ...
4
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 ...
3
votes
2answers
349 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 ...
3
votes
1answer
910 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 ...
3
votes
1answer
671 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 ...
3
votes
1answer
887 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 ...
3
votes
3answers
942 views

Evil mode: How to run evil-indent on the text I've just pasted

When I copy line three below in evil-mode function foo() { } var bar; #copy and paste it at line two, I get function foo() { var bar; #paste } instead of the correctly indented function foo() { ...
1
vote
1answer
334 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 ...
1
vote
1answer
970 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 ...
8
votes
1answer
901 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?
7
votes
2answers
638 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.
3
votes
1answer
407 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
867 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
470 views

Integrate cua-mode with evil-insert-state

I'm starting to think that using the regular C-x C-c C-v keys for kill-ring operations make sense, as they're used that way in every other program I use regularly. (And I'm starting to develop ...
3
votes
1answer
598 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-...
3
votes
3answers
2k 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
579 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
696 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 ...
2
votes
2answers
514 views

Evil - don't yank with only whitespace to register

How can I configure Emacs in Evil mode to delete an empty line (d d) without copying it but still copy it when deleting a non-empty line?
2
votes
2answers
1k 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#...
2
votes
1answer
844 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-...
1
vote
1answer
67 views

Making Emacs show the last part of bash-command output

I use the Evil mode inside Emacs for doing a lot of my work. If I need to run a shell-command and see its output all I need to do is type in normal mode :!<bash command>. The window splits into ...
1
vote
1answer
561 views

How to use input methods in minibuffer?

I am writing some xelatex code with both English and Farsi (right to left direction) characters in it. Also I am using Emacs' input method (changing with key Ctrl + \) for changing between English and ...
0
votes
1answer
550 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
622 views

Emacs evil-mode C-c/C-x to “cc”/“cx”. ( key translation)

I read in evil wiki that I can change prefix keys such as C-c or C-x and so on to cc, cx, but I'm not experienced in Elisp and I tried a lot of variants but I can only define c as C-c but not a cc to ...
0
votes
1answer
510 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
132 views

evil-mode unwanted abbrev expand (setq evil-want-abbrev-expand-on-insert-exit nil)

Upon escaping evil-insert-state, if the cursor is next to a letter/phrase in my abbrev list, it expands despite having (setq evil-want-abbrev-expand-on-insert-exit nil) called before evil-mode. ...
0
votes
1answer
294 views

evil & org-time-stamp-inactive at end of line in normal mode

I use evil (via spacemacs) and I want to insert a time stamp at the end of the current line in org-mode. Alas the end-of-line in evil normal mode is not the same as in vanilla emacs, so that pressing $...
0
votes
1answer
843 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 ...