From 56828fc18182118c469975cfd1609fc82995d5d3 Mon Sep 17 00:00:00 2001 From: Stephen Jianu Date: Mon, 15 Jan 2024 02:30:34 -0600 Subject: [PATCH] Update Emacs init.el * Better comments * Use melpa-stable instead of melpa * evil-collection setup * Use built-in line numbers functionality --- emacs/.emacs.d/init.el | 44 +++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/emacs/.emacs.d/init.el b/emacs/.emacs.d/init.el index 7af10bf..0bac69b 100755 --- a/emacs/.emacs.d/init.el +++ b/emacs/.emacs.d/init.el @@ -1,42 +1,42 @@ +;; hide the startup message, menu bar, and tool bar (setq inhibit-startup-message t) (menu-bar-mode -1) (tool-bar-mode -1) + +;; set font size (only affects GUI) (set-face-attribute 'default nil :height 200) -;; Evil mode stuff -;; Set up package.el to work with MELPA +;; line numbers +(global-display-line-numbers-mode) +(setq display-line-numbers-type 'relative) + +;; set up melpa (require 'package) (add-to-list 'package-archives - '("melpa" . "https://melpa.org/packages/")) -(package-initialize) -(package-refresh-contents) + '("melpa-stable" . "https://stable.melpa.org/packages/") t) -;; Download Evil -(unless (package-installed-p 'evil) - (package-install 'evil)) +;; set up evil mode and evil collection +(setq evil-want-integration t) ;; This is optional since it's already set to t by default. +(setq evil-want-keybinding nil) +(use-package evil-collection + :after evil + :ensure t + :config + (evil-collection-init)) +(use-package evil + :ensure t + :config + (evil-mode 1)) -;; Enable Evil -(require 'evil) -(evil-mode 1) (custom-set-variables ;; custom-set-variables was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. - '(package-selected-packages '(linum-relative evil))) + '(package-selected-packages '(evil-collection))) (custom-set-faces ;; custom-set-faces was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. ) - -;; line numbers -(add-hook 'text-mode-hook 'display-line-numbers-mode) -(add-hook 'prog-mode-hook 'display-line-numbers-mode) -(unless (package-installed-p 'linum-relative) - (package-install 'linum-relative)) -(require 'linum-relative) -(setq linum-relative-backend 'display-line-numbers-mode) -(setq linum-relative-current-symbol "") -(linum-relative-on) -- 2.39.5