Questions tagged [evil]

Evil Mode is a Vim emulation layer for Emacs.

Filter by
Sorted by
Tagged with
4
votes
2answers
374 views

Exiting insert mode in Evil mode and saving immediately (Ctrl + [, :w) causes errors

I've recently shifted to Emacs + Evil for my dev setup, and seem to be running into a rather strange issue with Emacs 24: when I exit Insert mode using Ctrl+[ and try to save the file with :w, Emacs ...
2
votes
1answer
247 views

Make evil paragraphs behave like vim paragraphs

I have moved from vim to emacs using evil-mode. I've found that I prefer emacs (as long as I can edit text vim style), but I have one small inconvenience. I've found, mainly while writing prose, but ...
0
votes
1answer
163 views

How to insert/dump all keyboard macros at once?

Is there a way to show all keyboard macros (similar to insert-kbd-macro) without having to first name each macro? Using macros with evil-mode in case this makes a difference.
0
votes
1answer
321 views

evil quit-window and evil-record-macro integration

I am trying to replicate emacs standard behavior when it comes to 'q', i.e. when in a buffer where insert mode does not make sense 'q' closes it. So I defined the following function (defun evil-new-...
1
vote
1answer
966 views

Unable to bind SPC as a prefix in general (evil mode)

My setup worked perfectly fine, however I recently reinstalled Emacs and therefore updated all packages as well when starting for the first time. Since then I cant get rid of the warning/error: ...
0
votes
0answers
30 views

How do you remove the last few characters from all lines in a txt file in spacemacs?

How do you remove the last few characters from all lines in a text file? Example: 23193 123252 1 1238 123 1 34356363 11238080123 1 Should become: 23193 123252 1238 123 34356363 11238080123 I'm ...
4
votes
1answer
920 views

evil (vi) keybindings for customize-mode

A recent convert to Spacemacs and I'm having trouble trying to change the keybindings in customize mode. From a customize buffer I can change the state with M-m SPC evil-evilified-state and then it ...
1
vote
2answers
397 views

Warning while installing evil in emacs

I'm new to emacs (3 days), learning the basics of the ecosystem. I brew installed emacs, and after that I'm wanting to enable evil mode. Here is my init.el (require 'package) (setq package-list '(...
2
votes
0answers
408 views

Interactive lambda functions [closed]

How do I create interactive lambda functions? (use-package general :ensure t :config (general-evil-setup t) ;;(setq general-default-keymaps 'evil-normal-state-map) (general-define-key :...
2
votes
2answers
405 views

Evil-mode: delete until end of parens/quotes/brackets/etc

Given the following (cursor at |), how can I delete the text , int b? foo(int a|, int b); I was hoping to find a motion similar to how "inner" works (eg d i b), but which only captures the right-...
0
votes
1answer
40 views

How can I constrain a predefined replacement-function to selected text?

When using replace-string from the M-x while having some text selected, it only operates on that selection (specifically, on an Evil visual selection, in my case). However, if I put the same ...
0
votes
1answer
155 views

Evil emacs use `dd` change buffer and paste with `p`?

I'm running evil emacs in terminal mode. I have two files open in buffers I'm switching between with c-x, left/right. I cut a line of text with dd then switch to another buffer and try to paste with ...
0
votes
1answer
200 views

Custom keybinding for jumping down 2 lines on spacemacs (evil-mode)

What I want is to have the option to scroll faster. Currently when in evil-mode normal state when I press j evil-next-visual-line is called. If I hold jthen the cursor moves down. What I want is ...
1
vote
1answer
390 views

How do i switch to evil-normal-state on save

I am new to spacemacs and currently save fils by s-s (aka: cmd-s). I would like to switch to evil-normal-state each time I save. How do I do this?
2
votes
1answer
401 views

Overriding a magit Keybinding using evil-mode and bind-map

I am using evil-mode, magit, evil-magit, and bind-map. I have defined a map with bind-map using SPC as my :evil-keys similarly to what spacemacs provides. Magit defines SPC as magit-diff-show-or-...
1
vote
2answers
1k views

How to paste into ansi-term (evil-mode)

I want to copy some text from my browser and paste it into ansi-term. I am a vim user and I want to give spacemacs a try once again. Naturally what I did was: Opening ansi-term by typing SPC SPC ...
3
votes
0answers
474 views

How to start a new line

I use Emacs with Evil mode, and I'm starting new line with key o. But I prefer to stay in Evil's normal mode, without going into Evil's insert mode, when starting a new line. When reading the called ...
0
votes
1answer
371 views

add-hook evil-insert-state-entry-hook is not calling the function

Update: It worked properly somehow after disabling and enabling nyan-mode. BUT there is no evidence indicating any relationship between them. Because I can't reproduce this problem after it was ...
0
votes
2answers
98 views

Evil mode interacting with python.el (invoking skeletons)

Skeletons such as python-skeleton-if in python.el has been giving me problems - I never use them but they get invoked unexpectedly. If they are invoked, it is a pain to get out of it and also it ...
3
votes
2answers
338 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 ...
0
votes
1answer
678 views

How do I bind keys using general.el alongside evil?

My goal is to bind SPC SPC to counsel-M-x. I've tried using this snippet from this post (use-package general :ensure t :config (general-evil-setup t) (general-define-key :states '(normal visual ...
2
votes
1answer
305 views

How to press RET to insert a newline while remaining in “normal” evil mode?

I want to insert a newline by pressing the return key, but keep the normal status in evil mode. In Vim, I can do this by nmap <CR> o<Esc>. What is its equivalent in evil-mode?
1
vote
2answers
114 views

How to make C-g cancel evil-replace rather than typing ^G?

In evil mode, the r command, evil-replace, waits for a replacement character to be typed and replaces the current character with it. Sometimes I hit r by mistake and wish to cancel, so I hit C-g. ...
1
vote
1answer
197 views

Use xcape-like Control_L=Escape only in Emacs evil insert-mode?

I like the idea of xcape for exiting insert-mode by just quickly tapping Control_L, but I don't like how it leaves "unconsumed" escapes around in other modes, or in other programs/terminals, which ...
1
vote
0answers
37 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
33 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
28 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 ...
3
votes
0answers
606 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 ...
2
votes
1answer
563 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
110 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 ...
7
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.
0
votes
0answers
382 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
883 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
423 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
621 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 ...
3
votes
1answer
747 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
44 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 ...
1
vote
0answers
261 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
831 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
176 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?
2
votes
1answer
248 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
48 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
929 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
479 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
193 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 ...
7
votes
1answer
928 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 ...
6
votes
1answer
6k 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
457 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. ...
3
votes
2answers
735 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
53 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 ...

1 2 3
4
5
9