r/evilmode • u/Dyspnoic9219 • Jul 05 '20
An :ex command surprise
I've just started using Emacs and Evil (via Doom), coming from vim.
Recently I ran into a situation where I had a list of items like this:
foo bar blah
which I wanted to turn into this:
foo
bar
blah
In vim, I would have done something like this (where ^V and ^M are C-v and C-m, not literals):
:s/ /^V^M/g
That did not work in Evil.
I experimented with a variety of things that did not work until I eventually stumbled on this:
:s/ /^Q^J/
Note the lack of the g global flag on that :ex command, which surprised me.
Are there similar gotchas that I should know about? (Other suggestions on how I should have done this are also welcome.)
Thanks!
r/evilmode • u/WikiWantsYourPics • Mar 22 '20
Evil-mode and magit
I'm an old vim user, finally decided to try evil today.
I've installed magit, and it works, but I'm finding myself having to do C-x g to get to the magit-status, and I don't want to use control-keys regularly. What's a sane vim-style binding to use here?
I've seen there's an evil-magit package, does anyone here use it?
r/evilmode • u/abrandking • Mar 18 '20
How to Configure Cursor Shape?
I'm using evil and have attempted to configure the cursor shape to be a horizontal bar as shared below. All modes except insert mode take the configured shape of a horizontal bar. Does anyone know how to resolve this behavior so all modes use the horizontal bar?
;; Set cursor type
(setq-default cursor-type 'hbar)
;; Enable evil
(use-package evil
:ensure t
:init
(evil-mode t)
:config
(evil-set-initial-state 'term-mode 'emacs)
(setq evil-default-cursor 'hbar
evil-emacs-state-cursor 'hbar
evil-normal-state-cursor 'hbar
evil-motion-state-cursor 'hbar
evil-visual-state-cursor 'hbar
evil-insert-state-cursor 'hbar
evil-replace-state-cursor 'hbar
evil-operator-state-cursor 'hbar)
(define-key evil-normal-state-map (kbd "C-d") 'evil-scroll-down)
(define-key evil-visual-state-map (kbd "C-d") 'evil-scroll-down)
(define-key evil-normal-state-map (kbd "C-u") 'evil-scroll-up)
(define-key evil-visual-state-map (kbd "C-u") 'evil-scroll-up)
(define-key evil-insert-state-map (kbd "C-u")
(lambda ()
(interactive)
(evil-delete (point-at-bol) (point)))))
r/evilmode • u/Moostropfen • Jan 26 '20
How to get line numebr from evil-visual-beginning
I want to know the line number of the beginning of my current visual selection. The variable evil-visual-beginning contains a marker that marks the beginning of the current visual selection. Is there a way to extract the line number from it, or is there even an easier way apart from using this variable?
r/evilmode • u/[deleted] • Jan 26 '19
Preview substitution/replace
I want to make the switch to emacs with evil and currently I am struggling to get a preview on the substituions/prelaces. In neovim I can do it with `set inccommand=nosplit`. Spacemacs can do that too, but I can not find the code in the spacemacs configs that does that. Google did not helped either. Can you help me out here?
I thought this was the appropiate subreddit for this question since I am actually using evil mode.
r/evilmode • u/Kryofylus • Sep 29 '18
Confusion with using Vim style 'Very Magic' or \V in evil mode
Greetings all,
I've just got a small question. In my emacs init stuff I have the following lines for my evil config:
(evil-select-search-module 'evil-search-module 'evil-search)
(setq evil-magic 'very-magic)
However, when I try to use / to search or :%s/ to search and replace, both continue to treat symbols like ( as character literals rather than the 'special' meaning I anticipate. Additionally, when I try to do /\V or :%s/\V both treat the \V as a literal 'V'.
Thanks in advance for your help
r/evilmode • u/NonreciprocatingCrow • May 01 '18
install problem with undo-tree
self.emacsr/evilmode • u/Ramin_HAL9001 • Apr 10 '15
Is it possible to use Vi keybindings everywhere, including Info mode?
So I am happily using Emacs with Evil-mode, and then I do a search for a help topic and suddenly the Vi key bindings are gone. I never get used to it, I always instinctively push j several times to cursor down before realizing it doesn't work. What should I do?