Xegrimoth Agnus
Xegrimoth Agnus

Reputation: 21

How to turn on evil mode on emacs startup

I've been using nvim for a while and recently thought about checking emacs out after learning about evil mode. I made init.el in .config/emacs, installed evil mode and figured i would try to enable it whenever i start up emacs.

So i wrote this bit of code in init.el:

(defun evil-mode-on ()
  (require evil)
  (evil-mode 1))

(add-hook 'after-init-hook 'evil-mode-on)

But unfortunately it doesn't seem to work and i'm not sure what i'm doing wrong. Any help would be very much appreciated and thanks in advance.

Upvotes: 2

Views: 1289

Answers (1)

Vijay
Vijay

Reputation: 888

You seems to be missing apostrophe(') in require. It should be (require 'evil)

Enabling evil mode at startup could be as simple as specifying

(require 'evil)
(evil-mode 1) 

in your init.el file as long as package is already installed and/loaded.

Github page has in detailed instruction to install it automatically with the help of use-package.

Upvotes: 4

Related Questions