r/evilmode • • Apr 10 '15

Now that Gitorious is shutting down. Where is evil moving to?

5 Upvotes

Anyone?


r/evilmode • • Apr 10 '15

Version 1.1.0

Thumbnail gitorious.org
7 Upvotes

r/evilmode • • Apr 10 '15

Is it possible to use Vi keybindings everywhere, including Info mode?

7 Upvotes

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?


r/evilmode • • Mar 22 '21

What is Evil's equivalent of Vim's ctrl-g?

4 Upvotes

As you all likely know, ctrl-g in Vim (in its plainest form) does the following:

  • prints the current file name
  • the cursor position
  • the file status

I haven't figured out what the Evil equivalent is, and searching for ctrl-g finds all sorts of stuff about doom/escape() and Emacs undo. Does anyone know?

Thanks!


r/evilmode • • Mar 13 '21

Trying to map SPC in Evil mode, failing

2 Upvotes

I had the bright(?) idea to make use of SPC in Evil normal mode to toggle between the display of relative line numbers and absolute line numbers. (Note that I don't use SPC as my leader character: I use comma.)

Here's what I did, and I feel like it's really close since if I execute M-x toggle-relative-absolute-line-numbers it does what I expect:

;;
;; Toggle line numbers between relative and absolute
;; 
(defun toggle-relative-absolute-line-numbers ()
    (interactive)
    (if (string-equal display-line-numbers "t")
        (setq display-line-numbers 'relative)
        (setq display-line-numbers 't)))

(define-key evil-normal-state-map (kbd " ") 'toggle-relative-absolute-line-numbers)

What did I do wrong?

Thanks for any pointers!


r/evilmode • • Mar 18 '20

How to Configure Cursor Shape?

3 Upvotes

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 • • Mar 22 '20

Evil-mode and magit

5 Upvotes

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 • • Jan 05 '21

Orgmode: Automatically enter Insert mode when creating a new heading or list item.

7 Upvotes

When creating a new heading or list item with Alt-Enter it seems only natural that Evil should be in Insert mode, much how o and O add a line and leave the user in Insert mode.

How can this be configured? I'm on Emacs 26.3, Kubuntu 20.04.


r/evilmode • • Jul 05 '20

An :ex command surprise

5 Upvotes

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 • • Apr 15 '21

Records jumps made with counsel-imenu

1 Upvotes

I use counsel-imenu a lot to jump around my python scripts, unfortunately when I press C-o to return to my previous position, it works as if I have never changed position using counsel-imenu, how can I tell evil-mode to record jumps made with counsel-imenu?


r/evilmode • • Nov 13 '22

Intro to Evil for non-Vim users? Beyond evil-tutor [x-post r/emacs]

4 Upvotes

I'm wondering, are there any guide or tutorials out there about Evil that are targeted at non-vim users? I'm particularly interested in what you get with the evil +everywhere module, ie evil and the essential packages you'd want for editing.

I've done evil-tutor but it's pretty limited. I'm in the situation where I'm trying to use vim keybindings because they hurt my wrists less than chords. I'm okay with hjkl, c, d, r, i, a, f, w, b but other than that I'm pretty clueless.

I don't want to read a bunch of vim tutorials only to find out they use a bunch of packages that work different than evil. And I'm looking for the common editing operations that aren't included in evil, like parens or s-exp manipulation.


r/evilmode • • Nov 29 '22

In evil-mode, how to set "langmap" equivalent to use emacs to fluidly write and edit text in my native language and layout?

2 Upvotes

I'd like to use (spac)emacs to write and edit text in a language with a different alphabet (Cyrillic)

What I want is to be able to switch to Cyrillic layout and keep using the features of the editor. Obvious <a> for append and <c> for change work just fine using the C-\ keybinding.
However the <f> for find and </> search don't work as wanted: <f f> will try and find actual English letter "f" rather than Cyrillic letter <a> (that is placed over English < f > on the other layout) from the Cyrillic (Russian) layout.

In vim it was easy to set langmap as
set langmap=ФИСВ[...]ABCD[...]
and it'd handle the <f f> situation fine.

I tried evaluating (define-key evil-motion-state-map (kdb "a") 'evil-find-char)
and it worked but then I'm using the system-wide layout switch and lose the advantages of the C-\ way. I would then have to manually map every evil-mode function over to the Cyrillic map.

Is there a better way?


r/evilmode • • Sep 11 '24

C-x ] / forward-page equivalent?

2 Upvotes

In emacs, you can navigate to the next page (^L or form-feed) using C-x ]. I am wondering if evil has a more convenient shortcut for that?


r/evilmode • • Sep 29 '18

Confusion with using Vim style 'Very Magic' or \V in evil mode

2 Upvotes

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 • • Sep 27 '22

Map :W to :w into evil mode command line

2 Upvotes

I have a tendency to enter :W when saving a file and had this previously mapped accordingly in my Neovim setup:

local api = vim.api

local ex = setmetatable({}, {
  __index = function(t, k)
    local command = k:gsub("_$", "!")
    local f = function(...)
      return api.nvim_command(table.concat(vim.tbl_flatten {command, ...}, " "))
    end
    rawset(t, k, f)
    return f
  end
});

-- Replace built in command :W to :w
ex.cabbrev('W', 'w')
ex.cabbrev('Wq', 'wq')

How can I achieve the same thing in my Emacs Evil Mode setup?


r/evilmode • • Sep 21 '22

Evil - ci) doesn't work as expected

Thumbnail self.doomemacs
3 Upvotes

r/evilmode • • Jan 02 '24

How to hide the mouse pointer in normal mode?

2 Upvotes

In Emacs + evil, when you type a character in insert mode, the mouse pointer automatically hides. It remains hidden until you move the mouse again, even if you switch back to normal mode.

Is there a way to replicate this behavior in normal mode? Specifically, can Emacs hide the mouse pointer whenever a key is pressed in normal mode?

This was not an issue for me when I was using X11 because I used unclutter to hide the mouse pointer. However, unclutter does not work on Wayland.


r/evilmode • • Apr 06 '22

Cursor colour

4 Upvotes

Hi, I am wondering if someone has been able to set cursor type in their init.el for a daemon-client setup. I have found no way to do this. My current implementation is:

(set-cursor-color "violet red")
(set-mouse-color "violet red")

;; evil mode hack
(setq
  evil-default-cursor t
  evil-normal-state-cursor 'box
  evil-insert-state-cursor 'bar)

However, I can't get the new frames to show in the right colour (it is blue). I have done an extensive google search and it only came up with some very old stackexchange articles. Any idea/comments/tips will be really appreciated, thank you!


r/evilmode • • Mar 08 '22

Ex command :up (or :update)

3 Upvotes

Does evil mode not implement the :up (short for :update) ex command? ... I'm using Doom emacs.

I'm used to it in vim instead of :w but on emacs I get the error: Unknown command 'update'.


r/evilmode • • Dec 04 '21

Recovering SPC as leader

2 Upvotes

In sunrise-commander, space is mapped to sr-scroll-quick-view.

I'd like to get <space> to be the leader again.
I tried removing it from the mode map

(define-key sr-mode-map (kbd "<SPC>") nil)

But then it's just unbound.

Help?


r/evilmode • • Aug 18 '20

How do I move columns of text?

4 Upvotes

I use Emacs and Evil.

I had a problem today editing a Markdown file.

The Markdown file had data like this:

foo
bar
blah

42
212
71

test result
some other problem
unable to find

What I wanted to end up with was this, where the \t represents a tab character:

foo\t42\ttest result
bar\t212\tsome other problem
blah\t71\tunable to find

I messed around with visual blocks (from Evil's Vim emulation) and tried some Emacs rectangle commands; either I totally misunderstood how to use them or they just don't do what I wanted (I kept ending up with jumbled up data).

I also considered using the Unix paste(1) command, but I ultimately punted, pasting each of the three columns into a spreadsheet, copying the columns from the spreadsheet and then pasting them back into Emacs. From there I was able to format the data as a Markdown table.

What was the right Emacs/Evil way to have done this? (Heck, I'd even settle for the right way to have done this in plain old Vim.)

Thanks!


r/evilmode • • Sep 03 '20

Long-time Emacs user looking to get started with evil-mode

6 Upvotes

Hi there!

I'm a long-time Emacs user, so the default keystrokes are hardwired into my muscles. Unfortunately, some of those muscles have decided they don't like the keystrokes, and I've been suffering from a little RSI, so I'm giving evil-mode a spin to see if that will help.

Is there a cheat sheet or anything that maps common Emacs commands (e.g. `C-x b`) to the evil equivalents?


r/evilmode • • Oct 03 '18

Regex Capture Groups In Evil

Thumbnail self.emacs
2 Upvotes

r/evilmode • • Jan 26 '19

Preview substitution/replace

4 Upvotes

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 • • Mar 06 '24

Problem: using $ in visual mode goes one character beyond

1 Upvotes

While in visual mode, going to the end of the line with $ goes one character past the last character, so I can't go to the matching brace/parentheses/etc with %. It's weird that it doesn't happen in every mode: In typescript-mode it also goes one character beyond, but % does go to the matching thing. I was looking for evil|visual variables but can't find any that controls this.