Stack Exchange Network

Stack Exchange network consists of 175 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.

2
votes
0answers
302 views

How do I make evil-search-forward / evil-search-backward use fuzzy search?

I'd like to search in buffer with the same fuzzy style that turns the search string into a regexp that splits characters and joins them with .*, like in Helm command search. Is there a way to do this ...
1
vote
1answer
78 views

Strange behaviour on evil-delete

When I use Emacs with Evil mode for some time, I sometimes get to a point, where I have no choice to what I want to delete when pressing d (or calling evil-delete). The current line gets deleted ...
0
votes
1answer
65 views

evil-org defun to `O` or insert heading causing Wrong type argument

I'm trying to write a command that behaves like evil's O unless I'm on a line that is an org-mode heading, in which case I want the command to insert a new heading and enter insert mode with the ...
6
votes
1answer
431 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.
0
votes
0answers
222 views

Wanted: vim-like paste behavior from browse-kill-ring

When using the browse-kill-ring package to insert some text from the kill ring, the text always gets inserted before point. This is not intuitive to vim users who are used to pasted text being ...
3
votes
3answers
348 views

Jump to location in org-mode while properly unfolding headings

I'd like to find a way to jump to a location in an org-mode file while automatically unfolding only the heading at the location I'm jumping to and all its parent headings (but not any sibling headings)...
1
vote
0answers
289 views

How to automatically set default-directory to projectile-project-root?

emacs beginner here. I would like for the default-directory of any buffer that's part of a projectile project to be the project root. For example if I'm editing include/my_file.hpp and I do: :e src/...
4
votes
2answers
379 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 ...
1
vote
1answer
349 views

how to get correct indentation after pressing 'o' in haskell-mode using evil-mode in spacemacs

When using haskell-mode (the Haskell layer) with evil-mode keybindings in spacemacs, the indentation created by pressing the o key is often incorrect. For instance, imagine I want to write the ...
1
vote
1answer
38 views

Creating a new function based off exisiting one

I apologize if this is a duplicate, but the essence of the question is whether it is possible to create "around" advice for an existing function and bind that to a new one. In my case, I'm trying to ...
0
votes
0answers
132 views

How can I disable the M-h keybinding in org-mode with evil-mode?

The problem seems to be that evil-mode translates the key chord M-<left> into M-h. Unsetting M-h by binding it to nil in the local, global or org-mode map in a org-mode hook does not help.
3
votes
1answer
426 views

Open vertical splits to the right

Using spacemacs with Evil. :vsp opens a new split vertical, but it always does it to the left. How can one configure it to open them to the right?
0
votes
0answers
75 views

How to change the command for comment toggling

spacemacs with Evil uses gcc to toggle whether a line is commented or not. I'd like to change it to ,cc. How should I go about this in my .spacemacs file?
0
votes
1answer
150 views

Equivalent to vim's `:set paste`

Sometimes when I use paste in emacs the indentation gets messed up. In vim I would use :set paste before pasting. I'm in evil mode but it says: State paste cannot be set as initial Evil state. Is ...
0
votes
1answer
30 views

customize evil ex prompt

I'm wondering if there's any way, even if via advice or re-definition, to customize the evil ex prompt. Sometimes I invoke it instead of M-: to evaluate an expression, so I was thinking of showing a ...
1
vote
1answer
505 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 ...
0
votes
1answer
251 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
79 views

Close found file but not emacs?

I'm using emacs in terminal mode. I open it up and then use c-x c-f to edit a file. I'm using evil mode so I then use :x to save and exit. I end up leaving emacs all together. Is there something else ...
5
votes
1answer
563 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 ...
3
votes
1answer
3k 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 ...
0
votes
1answer
261 views

Key-chord mode and Evil

Is there a problem combining key-chord-mode with evil? After some puzzlement I discovered that key-chord mode only works (this may have changed recently) when activated (by M-x) in insert mode. ...
2
votes
1answer
262 views

Evil and org-mode keybinding 't' conflict

In Spacemacs with evil and org-mode, the letter 't' is assigned to two functions: org-todo (don't need this because I use shift-arrow to cycle through todo states) evil-find-char-to (I need this) ...
0
votes
1answer
39 views

How to restore Emacs after testing the bug on clean Emacs?

I want to submit an evil bug report as described in https://github.com/emacs-evil/evil/blob/master/CONTRIBUTING.md#bug-reports Test the bug in a clean Emacs environment without any additional ...
0
votes
1answer
85 views

Spacemacs - disable last ex command repeat on empty input

On vim, an empty ex command (:) leads to a noop upon pressing enter. On Spacemacs (or Evil in general maybe), it re-runs the last command. Is there a variable I can tweak in my configuration to make ...
1
vote
1answer
323 views

What does 'State xxx cannot be set as an initial Evil state' mean?

When I try to enter a command such as set number in Spacemacs, I get the error State number cannot be set as initial Evil state. What is an initial evil state and what does the error message actually ...
0
votes
1answer
140 views

Change modeline background when in normal evil mode?

how do I change the background of current line when in (evil) normal mode? I used it in Vim to be able to tell when I am in normal mode or not. (I am using the terminal app and I prefer to keep the ...
1
vote
0answers
149 views

Evil paste behaviour

I'm noticing odd behaviour when I select some text with control-space and use p to paste -- in that the paste is done after the cursor character, rather than on the next line. Is that intentional, ...
2
votes
0answers
76 views

Automatic close evil-make buffer

I'm using evil mode (Spacemacs to be specific) and working with LaTeX projects. I use evil-make or :make command to compile the current LaTeX project to PDF file. I find it quite annoying that ...
2
votes
2answers
2k views

How to bind a key in Evil Spacemacs when the leader key is comma?

I have rebound "SPC m c" so it opens a file (from How to a create keybinding to open a particular file?): (spacemacs/set-leader-keys "mc" (lambda () (interactive) (find-file "~/capture.org"))) And ...
1
vote
0answers
69 views

Evil mode dot key and numeric commands

I've been using Viper for countless years, and I'm trying to switch to Evil. One of the first things I noticed is that the dot 'do-again' key doesn't take any numeric arguments to the last command ...
3
votes
1answer
382 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 ...
1
vote
1answer
94 views

Evil-surround: How can I make `ves(` act like `ves)`?

Same question for surrounding with bracket and braces as well. I'd like visually highlighted text to be surrounded without any added whitespace. Currently ves( on text will result in ( text ) whereas ...
0
votes
1answer
69 views

evil “exchange-with-kill-ring”-operator?

I often find myself wanting to exchange some text object with whatever's currently in CLIPBOARD (not necessarily in Emacs' kill-ring, when I copy from other programs). But of course when I do ...
0
votes
1answer
60 views

How to prevent a key-binding from registering as an evil-mode operator?

When wrapping save in a function so it always writes, (used so I can trigger compilation which I have set to watch my files). (defun save-buffer-always () "Save the buffer even if it is not ...
0
votes
0answers
48 views

Setting the input-method for read-string minibuffer

This function prompts for a string and stores it in a variable. (defun get-greek-word () "Get a Greek word from the user and put it into a variable." (interactive) (set-input-method '...
0
votes
1answer
85 views

Evil Org-Mode set L and H to tabbar movements

I can toggle org-mode TODO status with L and H when the pointer rests at a org heading. I wish I could bind those keys to tabbar-"movements" to mimic the behaviour I get in all othem mode with this ...
1
vote
1answer
303 views

In spacemacs org-mode, is there a way to select a region, and surround it with #+begin_quote and #+end_quote?

I'm tired of typing #+begin_quote and the other one manually (couldn't type it, too tired). Is there a way to surround a region with this? I can't help but feel like there must already be a function ...
1
vote
2answers
375 views

After-advice for disabling evil-mode in ansi-term has no effect

I'm using evil-mode and trying to make sure that it gets disabled after invoking an ansi-term. I've tried using before and after advice to advise the ansi-term function, as well as adding a hook to ...
0
votes
1answer
261 views

(Evil) Binding “q” to “View-quit” in view mode (instead of “evil-record-macro”)

I'd like to be able to exit view mode by pressing "q". However, in evil "q" is bound to evil-record-macro, even in view mode. I wasn't able to find a solution using evil-define-key. I was excited to ...
0
votes
1answer
206 views

How to set `evil-insert-state-cursor` to a function?

In evil-mode, the cursor shape and colour for each state is controlled by the series of variables evil-*-state-cursor. The documentation for these variables states: May be a cursor type as per ...
1
vote
1answer
712 views

(Evil) “General” leader key (SPC) not working in some modes (dired, *Messages*)

I use Evil, and I'm using the General package to set my custom keybindings. I'm using SPC as a leader key. The trouble is, I find that SPC is not interpreted as my leader key in some modes, namely ...
0
votes
1answer
256 views

Passing in arguments for evil-ex-command

I understand that evil-ex-define-cmd allow me create my own ex commands. Although in Vim, you were able to narrow down the search by doing something like :h <term> I'm not sure how to ...
1
vote
2answers
577 views

How to make end-of-buffer move to the last line not beyond it?

I'm playing with evil-mode and this is one of the things where evil differs from vim. In vim G takes you to the last line, but evil uses Emacs end-of-buffer which for some reason takes me beyond last ...
3
votes
3answers
332 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() { ...
11
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 ...
0
votes
1answer
818 views

How to define mode-specific keys in evil-mode? [duplicate]

I want keybinding X to do one thing in c-mode and another thing in other modes. I'm trying to figure out how to do this in evil, specifically evil's insert-state. I tried setting the keybinding in a ...
2
votes
1answer
563 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 ...
1
vote
2answers
461 views

History of search terms for evil mode?

When searching for text in evil mode using / key, then entering text. The value searched for isn't saved as it is in vim, where the up/down arrow keys can cycle search history. Is it possible for ...
1
vote
1answer
1k views

How can I disable evil in help-mode?

I have the following in my init.el, and it does a great job of automatically disabling evil in certain emacs modes: (dolist (mode '(git-rebase-mode flycheck-error-list-mode inf-ruby-...
0
votes
2answers
151 views

Disabling reusage of evil scroll count

If evil-scroll-line-down is not given a count argument, the last count is used. This is not the behaviour of vim, which scrolls one line if no count is specified. How can I get vim behaviour?