Skip to main content

Questions tagged [evil]

Evil Mode is a Vim emulation layer for Emacs.

121 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
6 votes
0 answers
337 views

Evil: how to execute multiple commands at command line?

I want to execute a list of commands all at once in the evil's command line. In vim, you can use the pipe to execute multiple commands, like this: %s/ó/o/g|%s/ç/c/g How can I do this in evil?
Jesse's user avatar
  • 1,994
5 votes
1 answer
1k views

Use hydra with evil motions

I'm trying to use a hydra to dispatch among a selection of motions. See this minimal example: (defhydra hydra/test (:color blue) "This is a test hydra" ("n" evil-next-line)) (evil-define-motion ...
PythonNut's user avatar
  • 10.4k
3 votes
0 answers
61 views

Letting evil >> increment org level

In evil mode, >> increments the indentation level of the current line. It does so at an org heading too, even though it would be more appropriate there if it would increase the org level (the ...
Toothrot's user avatar
  • 3,274
3 votes
0 answers
72 views

xref gets confused by similar class names

If I use evil-jump-to-tag or xref-find-defintions on an inherited class module whose name is the same as a class in my current project, I am taken to the definition in the current project. I would ...
Lorem Ipsum's user avatar
  • 4,517
3 votes
0 answers
198 views

Evil: How do I see the partial command I've been typing?

Suppose I am in command mode, and I am in the process of typing 3dd to delete three lines. How can I make evil mode show the (partial) command I have typed so far? In other words, is there an evil ...
Flux's user avatar
  • 603
3 votes
1 answer
267 views

change evil operators to be non-greedy

I notice that some of the evil around operators are greedy. As in they grab space around the surrounding delimiters. One such operator is the a". Assuming that my cursor is | when I use va" the ...
Aquaactress's user avatar
  • 1,453
3 votes
0 answers
1k 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 ...
ReneFroger's user avatar
  • 3,880
3 votes
0 answers
512 views

Turning relative numbering on (with linum-relative) in Spacemacs only when in normal mode

In Vim I have relative numbering which is turned on most of the time but it's turned off when in insert mode or when the window losses focus (both when changing to another Vim window or when changing ...
jbssm's user avatar
  • 233
3 votes
0 answers
452 views

Quickly navigate path with evil-mode's ex commands?

I am new to Emacs. I like how I can easily navigate to a file via helm-mode-find-file in helm. Is there any way to combine any variant of this (helm or otherwise) with evil's ex commands (eg, :e, :sp,...
ettlich's user avatar
  • 31
3 votes
0 answers
736 views

disabling evil auto copying of selection to clipboard on frame focus

I'm seeing interesting behavior when I try to copy text between other applications and emacs on arch linux, when using evil-mode. Whenever I have a region selected in emacs, and then click to focus ...
Mike McFarland's user avatar
3 votes
0 answers
1k views

How to disable the map from esc to meta?

I installed the oh-my-emacs configuration and try to use emacs in the terminal. oh-my-emacs configuration enables evil-mode in default, and my problem is that, I found esc is mapped to meta, while ...
lllllllllllll's user avatar
2 votes
0 answers
185 views

What is the relationship between Evil registers and ordinary Emacs registers/kill-ring?

I use evil and have gotten used to accessing the registers via :registers (in normal-mode). This works fine for me except when I attempt to yank a URL or filename into a minibuffer prompt. In trying ...
nonreligious's user avatar
2 votes
0 answers
463 views

(evil-normal-state) seems to have no effect as part of org-agenda-mode-hook

I'm attempting to move from Doom Emacs to vanilla Emacs. I've gotten quite used to the keybindings of Doom, so would like to replicate my most used ones in Emacs. I've used evil, evil collection, and ...
Dargscisyhp's user avatar
2 votes
0 answers
44 views

How to get the "number prefix" to be used in a function? (evil mode)

With emacs evil-mode, you can use number prefixes before commands (like in vim). For example 10j goes 10 lines down. I am trying to define a custom function which can make use of these "number ...
George's user avatar
  • 919
2 votes
0 answers
40 views

Evil text objects on kebab-case behave differently on dw and cw

I would like my evil text objects to work on kebab-case words, so that dw or cw act on the "whole-kebab-word" and not just on "whole". Therefor I have put (modify-syntax-entry ?- "w" clojure-mode-...
Witek's user avatar
  • 355
2 votes
1 answer
120 views

How can I make terms searched with `*` or `#` populate the search history?

In my attempt to have * and # work in Spacemacs as they do in Vim, I've followed the solution posted at this question. Those keys now work, but there's one hurdle more to overcome: the searched term ...
Jir's user avatar
  • 71
2 votes
0 answers
287 views

How to make Lisp state a default instead of normal?

I'm learning Clojure and Emacs at the same time 🤕 I use Spacemacs with Evil. Recently I've learned about Lisp state and I find it very handy. The only problem is that whenever I switch to insert ...
Tad Lispy's user avatar
  • 133
2 votes
0 answers
71 views

Evil text object for innermost paired delimiter?

Q: how can I create a text object for innermost paired delimiters? evil has text objects to allow us to operate on the standard paired delimiters like parentheses, braces, brackets, quote marks, and ...
Dan's user avatar
  • 33.1k
2 votes
0 answers
663 views

Distraction free writing mode and vertically centered?

One feature, that I really adored in Ulysses is it's typewriting scroll center lock mode (for the lack of a better description). It would keep the line centered, no matter if the cursor is at the ...
nocksock's user avatar
  • 131
2 votes
0 answers
332 views

org-cycle behaves differently for src blocks when evil-mode is enabled

I'm trying to indent my code in org src blocks, but it only works when evil-mode is disabled. I have set this variables for org-mode: (setq org-src-preserve-indentation t org-src-tab-acts-...
Jesse's user avatar
  • 1,994
2 votes
0 answers
114 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 ...
Mingwei Zhang's user avatar
2 votes
0 answers
283 views

Trace Evil-mode commands

At the moment, I only know one way to determine which Emacs functions are called by any given Evil command (e.g. a sequence of key bindings in the Normal state): read the Evil source code. Is there a ...
user avatar
1 vote
0 answers
34 views

delete and start insert

Coming from vim, I use evil, and I am used typing s to replace (substitute) text and continue in insert mode. In normal mode, s is a synonym for cl. In visual mode, s is a synonym for c. Both (cl and ...
Alois Pichler's user avatar
1 vote
0 answers
88 views

evil, end of line in elisp mode, is hard to execute eval-last-sexp

(setq a "3") If I want to evaluate the line, I'd go to the end of line and do (eval-last-sexp) But in evil mode, the last sexp is "3" not the expression. I can go to the next line ...
eugene's user avatar
  • 499
1 vote
0 answers
128 views

Prefix key in general package does not work with emacs start up page (fundamental mode)

I am trying to define key bindings with general.el following emacs from scratch. However, the leader-prefix key (SPC) does not seem to work from the Emacs start-up page (Fundamental mode). It works ...
sm10's user avatar
  • 31
1 vote
1 answer
70 views

How do I select the nearest `evil-text-object` enclosed in one of () [] {} <> without having to provide the paren char explicitly

I have problems when using the suggestion from here Code faster by extending Emacs EVIL text object (require 'dash) (defun jds~evil-paren-range (count beg end type inclusive) (->> '((?\( . ?\))...
jds's user avatar
  • 177
1 vote
1 answer
70 views

Is there a library to make `'evil-goto-mark` restore the screen position of the marker?

I use emacs and evil. If I set a marker using 'evil-set-marker, scroll elsewhere in the file, and then execute 'evil-goto-mark or 'evil-goto-mark-line, the window will scroll back until the position I’...
emdash's user avatar
  • 86
1 vote
2 answers
141 views

How to ask for confirmation before killing any new modified buffer?

What's the best way to prompt for confirmation before killing any modified buffer, including new buffers created by evil-buffer-new, which creates a buffer without an associated filename. Modified ...
Gavin's user avatar
  • 298
1 vote
1 answer
344 views

How to disable evil insert key in read only mode

I want to disable evil insert key such as a, i, o in read-only mode (keep navigation key such as j and k), my idea is to disable these keys in local buffer when enabling read-only mode and enable ...
Ynjxsjmh's user avatar
  • 313
1 vote
0 answers
157 views

org-mode has no syntax highlighting unless I start with evil

When I start emacs with evil-mode in my rc ((evil-mode 1)) I get syntax highlighting for .org files. However, when I do not, I do not get any syntax highlighting, even when trying M-x font-lock-mode a ...
kkeey's user avatar
  • 113
1 vote
0 answers
83 views

Dvorak input mode wrong letters when typing fast, correct, when typing slow

I have dvorak keyboard layout set as input when I am in evil-input mode. However, when I type relatively fast when typing the I get thd. This is just an example, some other "typos" occur as ...
denis631's user avatar
1 vote
0 answers
31 views

show which package repo was used to obtain a package

I'm trying to submit a bug report to emacs-evil, and they ask me from which repo evil was installed. I'm just using the version that came bundled with doom-emacs. How can I know which source was used ...
honestSalami's user avatar
1 vote
0 answers
1k views

I broke Spacemacs

After editing my .spacemacs file, spacemacs is saying that there is an unmatched parenthesis and I need to go into startup recovery mode. After looking at the file, I have not found any problems. ...
destroyer449's user avatar
1 vote
0 answers
604 views

Disable evil-mode in eshell

I have disabled evil-mode in eshell by (evil-set-initial-state 'eshell-mode 'emacs) but when I switch windows(accidentally) using C-w k from eshell, evil-mode gets enabled. How do I prevent this ...
Veera Sivarajan's user avatar
1 vote
0 answers
147 views

Replace normal state keymap in Evil with another

I don't like Evil collections or the Evil keybindings in the dired-mode. I would like to re-map only few keys in the normal state like j, k, and a few more keys with g prefix and I would like to keep ...
Arktik's user avatar
  • 972
1 vote
0 answers
169 views

Rebind a key in insert mode for a major mode?

I'm trying to rebind a key in insert mode for a major mode and I just can't seem to get it - I have in my .spacemacs (evil-define-key '(normal insert) rjsx-mode-map (kbd "C-d") 'rjsx-delete-...
gone's user avatar
  • 111
1 vote
0 answers
186 views

scroll-preserve-screen-position screws up evil-scroll-down (C-d) in evil

centered-cursor-mode has been extremely sluggish so I found that this setup achieves the same without the slowness: (setq scroll-preserve-screen-position t scroll-conservatively 0 maximum-...
SFbay007's user avatar
  • 584
1 vote
0 answers
751 views

What does evil-define-key do?

evil-define-key's docs say it "create[s] a STATE binding from KEY to DEF for KEYMAP." What is a "state"? What is a "state binding"? Emacs doesn't have "states" as far as I know? My current ...
Buttons840's user avatar
1 vote
0 answers
35 views

Evil commands reset margin

I'm using evil-mode and olivetti-mode, which adjusts the margins so that the text is centered in the window. My screen usually looks like this: Voluptatem tempore unde eveniet cumque ...
Moira Jones's user avatar
1 vote
0 answers
38 views

Add recent files to .viminfo

Is there a package or code snippet that can make Emacs add recent files to .viminfo? I want this to use with v. (Basically to open recent files using fzf) I’m using Spacemacs (so evil, too), if that ...
HappyFace's user avatar
  • 830
1 vote
0 answers
243 views

How to navigate SPC commands with Vim cursor?

I am very used to Vim keys BUT I love to use Emacs. That's why Spacemacs in Evil mode is perfect for me. There is one thing I still cannot figure out how to do. I don't know how to use h,j,k,l for ...
xetra11's user avatar
  • 167
1 vote
0 answers
43 views

Evil substitue with a counter

I was wondering if it is possible to run a substitue command in evil with a counter? For example, with query-replace-regexp you can use replace-count: (format "word-%d" (1+ replace-count)).
Arktik's user avatar
  • 972
1 vote
0 answers
16 views

Keeping that evil cursor from running off

In Evil, as in Vim, combining an operation with a movement moves the cursor to the beginning of the text operated on. For example, if I'm in the middle of a line and type gU^, then everything from ...
Toothrot's user avatar
  • 3,274
1 vote
0 answers
110 views

How to avoid entering visual mode when clicking a link while using evil?

Emacs newbie here using spacemacs. How to avoid entering visual mode when clicking a link while using evil? This is particularly problematic in org-mode.
How Si Wei's user avatar
1 vote
0 answers
210 views

Re-map evil-commentary key in dired mode

I am trying to re-map a key in evil-mode/evil-commentary-mode when in dired-mode. I tried to add a hook to dired-mode to disable the minor commentary mode, but it disables it for other major modes as ...
Arktik's user avatar
  • 972
1 vote
1 answer
577 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 ...
Yuan Fu's user avatar
  • 259
1 vote
0 answers
54 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 ...
SFbay007's user avatar
  • 584
1 vote
0 answers
600 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/...
user1832047's user avatar
1 vote
0 answers
931 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, ...
Rob Kramer's user avatar
1 vote
0 answers
137 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 ...
Rob Kramer's user avatar