4

First time emacs user trying to install "evil mode". I'm attempting to follow the instructions at https://blog.aaronbieber.com/2015/05/24/from-vim-to-emacs-in-fourteen-days.html.

I installed emacs on Ubuntu 18.04 with sudo apt install emacs. In ~/.emacs.d/.emacs I have:

(require 'package)
(add-to-list 'package-archives '("org" . "http://orgmode.org/elpa/"))
(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/"))
(add-to-list 'package-archives '("melpa-stable" . "http://stable.melpa.org/packages/"))
(setq package-enable-at-startup nil)
(package-initialize) 
(require 'evil)
(evil-mode t)

After running M-x package-list-packages I see Package refresh done but neither evil nor evil-mode are in the list and M-x package-install RET evil returns [No match]

What am I missing?

1

2 Answers 2

3

Solved it. The problem was that I had .emacs in ~/.emacs.d rather than in ~/.

2
  • what does this answer mean? can you clarify? write the full commands you ran and the state of your file please. Apr 14, 2022 at 21:08
  • Emacs will either load ~/.emacs or ~/.emacs.d/init.el, but not ~/.emacs.d/.emacs as OP mentioned in the post. For more information, check out the Emacs Manual on the topic of "Init File"s.
    – Philip K.
    Dec 27, 2022 at 17:47
0

This worked for me:

Evil Manual installation worked for me: https://evil.readthedocs.io/en/latest/overview.html#installation-via-package-el clone evil repo somewhere you know the path, I recommend ~, so run:

    git clone --depth 1 https://github.com/emacs-evil/evil.git

then add these line to your .emacs file in ~:

    vim .emacs

add:

(add-to-list 'load-path "path/to/evil")
(require 'evil)
(evil-mode 1)

likely:

(add-to-list 'load-path "~/evil")
(require 'evil)
(evil-mode 1)
1
  • The question specifically mentions using the package system: providing an answer for a manual installation is at the very least an answer to a different question. Even if one installs manually, a more systematic method than installing in the home directory should be recommended. If everything gets installed in the home directory, it (the home directory) soon becomes a garbage dump.
    – NickD
    Dec 27, 2022 at 15:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.