Questions tagged [evil]

Evil Mode is a Vim emulation layer for Emacs.

Filter by
Sorted by
Tagged with
0 votes
0 answers
16 views

Evil mode "o" auto indent in text mode - how to turn it off?

When I press o in evil mode (which moves the cursor to the line under, and goes into insert mode), the cursor is indented by two spaces. When I press o, the cursor goes here This happens in text ...
Vinn's user avatar
  • 283
0 votes
1 answer
50 views

How add Evil keybindings to Magit, without removing all Magit prefix-keys

In magit status of a Git repository, you usually press f u to fetch from upstream (these keybindings in Magit will call magit-fetch-from-upstream). With Magit keybindings I have noticed the letters ...
ReneFroger's user avatar
  • 3,808
0 votes
1 answer
56 views

How to use evil-next-line in a function when being in a visually selected mode?

Good day, I wanted to use evil to move a few lines down or up at once, less than with evil-scroll-down/up, but more than one line. I made a brief function: defun go-up-few-lines () "Insert a ...
Rareform's user avatar
  • 311
0 votes
0 answers
15 views

Emacs Evil: Invalid function: evil-ensure-column

I am using evil in Emacs, and I get an error when I use the motions G or gg: Invalid function: evil-ensure-column. My Emacs version is 29.1, and the evil version is 20230919.2206. The motion G calls ...
TakeMuon's user avatar
1 vote
2 answers
48 views

How to set "nojoinspaces" in evil mode

In vim, you can :set nojoinspaces to prevent J from adding a space when joining lines that end in a period. How do I set this in evil mode? I'm using Doom emacs, if that is relevant.
Otto Kaaij's user avatar
0 votes
0 answers
48 views

How to enable evil-mode in Portacle?

I want to start learning Common Lisp and I want to use portacle for an IDE-like experience. As I understand, portacle doesn't provide a normal init.el configuration file. Instead, it uses a file in ...
MySQLInjection's user avatar
0 votes
1 answer
28 views

moving cursor forward-sexp goes one char further in evil mode

When I want to highlight the following region (a ( b ( c ) ) ) ) I get (a ( b ( c ) ) ) ) I mark the beginning and do forward-sexp (or sp-forward-sexp, which results in the same outcome) In, insert ...
eugene's user avatar
  • 489
0 votes
1 answer
37 views

keybinding which will respect minor mode override

I am trying evil mode and want to keep emacs's C-k when in insert mode. C-k is kill-line but when smartparens-mode is on, it's sp-kill-hybrid-sexp So I can't just bind C-k to kill-line in evil-insert-...
eugene's user avatar
  • 489
1 vote
0 answers
57 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
  • 489
0 votes
0 answers
23 views

Mixed display-line-numbers-type for evil users?

I want something like: (setq display-line-numbers-type 'mixed) Which count wrapped line as "relative", and count folded line as "visual" Is there any way to achieve this? Say I ...
AidanUnhappy's user avatar
0 votes
1 answer
26 views

How to make my own evil(?) mode? view mode while debugging?

I'd like to switch between two modes source editing mode debug mode (where source is read-only, and you can use all other regular emacs commands + some debug related hot keys (such as n for next) ...
eugene's user avatar
  • 489
0 votes
0 answers
12 views

hydra, let all keys work but not allow insert (self-insert-command)

I am setting up hydra + dap. Although dap-hydra is provided, it messes up keybinding often times. Often, I forget the hydra window is open and type something and messes up typing. Furthermore, when ...
eugene's user avatar
  • 489
0 votes
0 answers
22 views

Copying nvmap-defined keybindings to emacs-state using a different prefix key

I use general.el to define keybindings. For evil-mode, I've use nvmap, using something like the following: (nvmap :keymaps 'override :prefix "SPC" :global-prefix "M-SPC" &...
Dargscisyhp's user avatar
0 votes
1 answer
32 views

Keybinding breaks undo-tree with evil

A few months ago I noticed undo-tree was not working properly for me, though it had never been a problem in the past. Whenever I opened an existing file on my computer and edited it, trying to undo ...
Dargscisyhp's user avatar
0 votes
0 answers
37 views

Keypress is not registered sometimes

I'm using evil mode and I've bound C-g to switch to normal state: :bind (:map evil-insert-state-map ("C-g" . evil-normal-state)) (:map evil-visual-state-map ("C-g" . ...
tap349's user avatar
  • 101
0 votes
1 answer
60 views

define a new evil command

I'm trying to reverse some words, and I have it set up where I can visually select them and hit ,rw to reverse them. How do I set it up so ,rw also works with a motion. E.g. ,rw3w to reverse 3 words? ...
Zaz's user avatar
  • 123
1 vote
0 answers
78 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
0 votes
0 answers
35 views

How do I properly use evil-set-jump? Doesn't seem to work if I pass a point position

I have my own function that essentially wraps outline-up-heading in Org-mode. It doesn't seem to take into account Evil's jump points, so Evil's C-o takes me to elsewhere. I'm trying to add support ...
aaa's user avatar
  • 426
0 votes
1 answer
67 views

How to get a minibuffer state indicator for Evil's `evil-want-minibuffer`?

For regular buffers, Evil has a state indicator in the mode line. But when using Evil in the minibuffer (by setting evil-want-minibuffer to t), there's no state indicator besides the cursor. Viper had ...
mtraceur's user avatar
  • 256
0 votes
1 answer
61 views

How do I use a while loop with a macro?

This works when I remove the loop but with the loop it does not work. (defmacro my/def-key (state map) (let ((x '( (kbd "<leader>z z") (lambda nil (interactive)(message ...
ritchie's user avatar
  • 151
1 vote
0 answers
92 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
0 votes
1 answer
96 views

Removing a binding from evil-collection

evil-collection is mostly quite useful - but occasionally the default settings shadow my global bindings and I seem to need to restart emacs to remove the binding. I bit up against this problem with ...
Att Righ's user avatar
  • 745
0 votes
0 answers
32 views

Apply a hook only when in Evil's insert state

Is there a builtin mechanism that would allow activating a hook only when in the insert state in Evil. I want to add a hook to org-tab-first-hook but only run the hooked function in the insert state. ...
Arktik's user avatar
  • 962
0 votes
1 answer
85 views

How do I unbind the SPC key from a pdf-viewer window and use evil leader key instead?

How can I unbind the SPC keybinding from a pdf-view-mode window and use the evil leader key instead? This is what I have currently: (use-package pdf-tools :ensure t :config (pdf-tools-...
HitoriJanai's user avatar
0 votes
0 answers
17 views

evil-mc binding shadowing my binding?

I use the binding grr for my own command in evil (along with lots of bindings started with gr standing for refactor). I recently enabled evil-mc and which stopped grr from working like it did before. ...
Att Righ's user avatar
  • 745
0 votes
1 answer
28 views

Capital M is behaving weirdly in insert-state of evil-mode

I am observing a strange behavior in evil-mode that I'm unable to figure out what is causing it: In insert-state, pressing "M" does not insert a capital m as expected, but instead gives me ...
NewToEmacs's user avatar
7 votes
1 answer
2k views

DOOM Emacs: Error running hook "global-git-commit-mode" because: (void-variable transient-base-map)

Full error (on the bottom line): Error (doom-first-file-hook): Error running hook "global-git-commit-mode" because: (void-variable transient-base-map) Hello! I'm running this on an M1 chip ...
Krys's user avatar
  • 95
0 votes
1 answer
23 views

Spacemacs keybinding not behaving as expected

The following keybindings work when simply moving. However, when pressing d and then one of these keys, the behavior is not as expected. When pressing dL it will delete until the end of the page. When ...
Veggeata's user avatar
0 votes
1 answer
72 views

change environment in evil-tex

I'm discovering evil-tex, it seems great : I already like the possibility to switch from equation* to equation and vice-versa. There is a manipulation I do very often which is to change \begin{...
Laurent D.'s user avatar
1 vote
1 answer
82 views

In Dired, How to disable (or unmap) SPC from executing dired-next-line?

What I want: While in dired, want to disable/unbind <SPC> from dired-next-line Reason: I use j or <C-n> to dired-next-line in dired, I never use <SPC> as to go next line. I use &...
Garid's user avatar
  • 589
0 votes
1 answer
116 views

Change cursor blinking status upon state change of evil-mode

I'm using evil-mode. My goal is to have a blinking cursor upon entering evil-insert-state, and to have a non-blinking cursor in evil-normal-state. I tried the following but it doesn't work: (add-...
NewToEmacs's user avatar
0 votes
0 answers
14 views

how to get correct indentation in haskell-mode in spacemacs

When in haskell mode indentation is not working quite how I expect it to. When pressing enter in an "else" statement the cursor goes to the beginning of the line instead of the correct one ...
dewijones92's user avatar
0 votes
0 answers
187 views

Evil Mode: How to get 'q' to kill Occur buffer + window

I recently started using Doom Emacs. I'd like to use Occur mode more frequently (via occur, multi-occur, etc.), but every time I open an Occur mode buffer in a split window, the only way to kill the ...
j-gopal's user avatar
  • 11
0 votes
1 answer
71 views

How to add prefix to suggestions in evil-mode?

Spacemacs has a way to add prefix descriptions with (spacemacs/declare-prefix ...). However, some evil-mode keybindings are lacking prefix descriptions. For example, in evil-mc g r is the prefix for ...
HRSE's user avatar
  • 113
0 votes
1 answer
27 views

How to create an evil-delete-previous-line command?

I am trying to create a command which deletes preceding whole lines, just like evil-delete-whole-line, but backwards. So far I have the following (evil-define-operator delete-previous-line (beg end ...
Rareform's user avatar
  • 311
1 vote
1 answer
96 views

evil-insert-state disables the active input method

A recent update must have slipped my testing afterwords and now this hook mu4e-compose-mode-hook does not work anymore. On every new email I must set the input-method manually again. Any ideas about ...
jjk's user avatar
  • 721
1 vote
1 answer
485 views

use vertico completion also in evil's ex-prompt

I am using evil-mode and now want to use vertico for completion. I've got it setup so it works when I hit M-x, C-x C-f, C-x C-b, etc. However, it doesn't work in evil's ex-prompt (the command prompt ...
laalsaas's user avatar
1 vote
3 answers
97 views

Seamlessly replace a keyboard input key sequence

I need something like abbrev, just without any extra spaces, including spaces which trigger the replacement. I experimented with keyboard shortcuts, like this: ;;(general-auto-unbind-keys) (global-set-...
Alexey Orlov's user avatar
0 votes
1 answer
180 views

How to configure initial evil-state for major mode

When calling M-x bm-show-all Emacs is in normal state. I've to push the "i" key to switch to insert then hitting Enter on a bookmark goto that bookmark. I tried this : (use-package evil :...
mcp's user avatar
  • 67
2 votes
1 answer
128 views

evil text objects for code object at point?

I use text objects with evil like "i(" for the contents of the brackets. I would quite like "magic code aware text objects"? This textobject would: return the entire function if I ...
Att Righ's user avatar
  • 745
1 vote
1 answer
58 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
216 views

Is there any way of making evil mode work inside list-packages?

I've installed the evil package to make emacs keybindings more like vim. After installing it I put the following lines on my .emacs file: (require 'evil) (evil-mode 1) It works fine when I'm editing ...
raylight's user avatar
  • 217
0 votes
1 answer
64 views

Evil-mode's delete inner-sentence command deletes a paragraph

Evil's evil-inner-sentence seems to select an entire paragraph. For instance, if I do dis somewhere in a paragraph it deletes the entire paragraph instead of just the sentence. This is also the case ...
Dargscisyhp's user avatar
2 votes
1 answer
40 views

Evil keyboard movement extends mouse selection

My Setup Emacs 28.1 Evil version 1.15.0 Gnome 42.4 wayland Observed Behavior In default emacs (GUI), with no init file, if you highlight a region with mouse 1 and then use a keyboard movement, the ...
farnsy's user avatar
  • 161
0 votes
1 answer
89 views

Make evil-ex-search-word-forward to respect region

I'm dealing with a tiny, yet annoying (to me) feature of Evil. My evil-search-module is set to evil-search. Why that is relevant explained in this post When I invoke evil-search (bound to * in normal ...
iLemming's user avatar
  • 1,233
1 vote
1 answer
54 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
0 votes
1 answer
376 views

org mode tables slowed down by evil mode

I am trying to create a table in org-mode like that (/ is where my cursor is) | this is a test | foo | bar | | ---------/---- | --- | --- | If I now press enter, emacs hangs and I have to interrupt ...
Christoph's user avatar
  • 101
0 votes
1 answer
41 views

(evil-scroll-up COUNT) not working in Spacemacs

I am trying to make this shortcut work: (global-set-key (kbd "<s-C-M-S-return>") '(evil-scroll-up 8)) But it is not working. If I remove the COUNT: (global-set-key (kbd "<s-C-...
fegax's user avatar
  • 35
0 votes
1 answer
175 views

How to turn from command to insert mode at the end of my elisp interactive script?

I am using Evil (Vi keybindings) in Spacemacs. Let's say I have something like that: (defun myfunc-org-insert-custom-stuff () (interactive) (insert "This is custom stuff ")) but I would ...
fegax's user avatar
  • 35
0 votes
0 answers
22 views

How to delete a function on which a cursor is in Spacemacs?

Let's say I have this: (defn -main [& args] (my-func|tion 5) (my-function-2 "hello") (third-function-of-mine nil)) where | is my cursor. And I want to delete (my-function 5). So in ...
fegax's user avatar
  • 35

1
2 3 4 5
11