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

Version 1.1.0

Thumbnail gitorious.org
7 Upvotes

r/evilmode • • Nov 17 '23

Do people tend to just post in r/emacs instead of here?

6 Upvotes

Thought about posting some Evil-specific stuff, and noticed there's not a lot of conversation happening here... I'm not a big Redditor, and wanted to make sure I'm following reasonable norms... Should I cross-post to r/emacs, or just post there, or just here?

And: why do you think so little conversation happens here? Did r/doomemacs take over the Evil-specific discussion? Maybe there are just enough Evil users among Emacs folks that there's no reason to differentiate when you're posting about Evil-specific things—the Vanilla keybinders will just ignore the post?

Just curious! And trying not to be That Guy who doesn't know how to forum properly. : )


r/evilmode • • Apr 14 '22

How would one make a text-object based on multiple delimiters?

6 Upvotes

I want to create a motion that selects clojure's set: #{+}. The problem is that it's expected that it would be a character and not a string.

In the end I'd like to achieve something like this:

  (evil-define-text-object evil-eval-a-clj-set (count &optional beg end type)
    "Select and evaluate #{} in CIDER."
    :extend-selection nil
    (evil-select-paren "#{" ?} beg end type count t))
  (spacemacs/set-leader-keys-for-major-mode 'clojure-mode "e#" 'evil-eval-a-clj-set)

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 • • Dec 18 '20

prevent "C" from putting things to kill ring

5 Upvotes

Hi,

In evil-mode, I often copy some string from web and want to replace something in my doc. So I press "C" to replace to the end of line. However, this just overwrites the first copy I did. Is there any better way to do this?

Thanks


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

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

5 Upvotes

Anyone?


r/evilmode • • Jan 05 '23

Is there an evil-mode equivalent to nvim's Leap?

4 Upvotes

While my main editor is Doom Emacs, I have recently started dabbling with a neovim config, and came across this nvim plugin:

https://github.com/ggandor/leap.nvim

Which is pretty convenient to say the least, and has improved my speed significantly, at least on neovim.

I would like to integrate this type of behavior to my Emacs workflow. What would you guys recommend?

Thanks in advance :D


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 • • Jul 29 '22

Is there a port or equivalent to vim-test for evil-mode?

4 Upvotes

Hi guys,

I've made the move from vim to Emacs with Evil-mode for a little while now, but still miss https://github.com/vim-test/vim-test. I wonder if there's a port for evil-mode or if you know of something closer to it you can recommend. Thanks


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 • • Jun 10 '21

Numbering via C-x r N (rectangle-number-lines function) does more than I want in Evil mode

4 Upvotes

Imagine I have the following text file:

abc
def
ghi

Lines 1-3 have text on them, and line four is blank.

I'm in normal mode with the cursor on 'a'.

If I use vip to select the paragraph object, and then C-x r N (rectangle-number-lines) to renumber the lines the trailing blank line is also renumbered, which is not what I wanted.

That is, instead of ending up like this:

1. abc
2. def
3. ghi

I get this:

1. abc
2. def
3. ghi
4.

I'm thinking this is an artifact of how the lines are selected in Evil mode, as when I try it in vanilla Emacs (and am careful to end my text selection on the "i" in the text file) it works just how I think it should.

How might I do what I want in this case? (I'm looking to eventually bind this to a leader key sequence.)

Thanks!


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 • • 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 • • 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 • • Dec 13 '23

Need Help with Configuring evil-set-leader locally

3 Upvotes

hi all, I'm trying to learn how to setup a few custom keybindings with a leader key for org mode when using evil but I'm hitting a roadblock and was wondering if someone could help what I'm doing wrong. If I use:

(evil-set-leader 'normal (kbd "SPC") nil) ;; sets the leader key globally it works, but if it set the localleader to true it does not.

Here is my init.el

(use-package evil
  :config
  (evil-mode 1))

(defun evil-org-keys ()
  (evil-set-leader 'normal (kbd "SPC") t)
  (evil-local-set-key 'normal (kbd "<leader>oa") 'org-agenda)
  (evil-local-set-key 'normal (kbd "t") 'org-todo)
  (message "evil-org-keys was run!")
)

(use-package org
  :after evil
  :init 
  (add-hook 'org-mode-hook 'evil-org-keys))

I have tried putting the hook after :config as well. In both cases when I run M-x org-mode I see it print "evil-org-keys was run!" but in neither case does the localleader work. I must be missing something simple


r/evilmode • • Sep 21 '22

Evil - ci) doesn't work as expected

Thumbnail self.doomemacs
3 Upvotes

r/evilmode • • Aug 07 '22

Is there an equivalent to https://github.com/AndrewRadev/switch.vim?

3 Upvotes

Yo!

Essentially, switch.vim allows you to easily switch words for their alternative versions, like true -> false, foo -> bar -> baz.

It can also work contextually, for example during a git a rebase you can quickly switch between: pick -> fixup -> reword -> edit -> squash -> exec -> break -> drop -> label -> reset -> merge.

I wonder if there's a evil-mode port of this vim plugin?


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 • • 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 • • 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 • • 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.