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.

1
vote
0answers
27 views

Preserve Evil state when jumping between org-edit-special and org-mode

When executing C-' (org-edit-special) it always starts in normal evil state even if I am in insert state originally. Same when jumping back, if I am in normal state then it switches back to the ...
0
votes
1answer
28 views

Finding last word inside hashes in a document, using Emacs Evil Mode

I've a document I'm editing, were I want to search for the next occurrence of the last word that appears within a pair of hashes. Some examples would be: #word#, #x(anotherWord)#, #y(x(...
0
votes
0answers
17 views

Evil surround repeat varying on varying width text possible?

I use viws" (visual select word surround with double quote) quite a lot then move up and hit . to repeat is there a way to modify dot so it does the exact command again. currently if i do the above ...
2
votes
0answers
271 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
0answers
62 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
60 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
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.
0
votes
0answers
195 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
309 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
262 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
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 ...
0
votes
1answer
318 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
36 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
115 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.
2
votes
1answer
371 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
63 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
143 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
29 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
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 ...
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
71 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
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 ...
3
votes
1answer
2k 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
235 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
225 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
34 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
76 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
294 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
127 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
130 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
67 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 ...
0
votes
0answers
20 views

Evil search count behaviour

In vim its possible to get the count of a pattern using something like this. This does not modify the buffer but in emacs it does, any ideas why ?
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
67 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
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 ...
1
vote
1answer
89 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
62 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
58 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
46 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
0answers
33 views

Map “S” to “SHIFT” in Evil mode

How can I map s to shift in evil mode ? For example, if I hit s and then LEFT then that would be interpreted as SHIFT+LEFT. Why do I wanna do this ? Because I am using termux on android and my ...
0
votes
1answer
78 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
280 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 ...
0
votes
0answers
382 views

2 tab space with (evil mode) visual mode

When I hit return or try to indent a large block using visual mode with the evil mode package in Emacs it always uses 4 tab spaces. When I hit tab normally I get 2 tabs which is good, but I always ...
1
vote
2answers
338 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
226 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
178 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
650 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
239 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
530 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
308 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() { ...