]> Stephen's Gitweb - dotfiles.git/commitdiff
Update Emacs init.el
authorStephen Jianu <stephen@stephenjianu.com>
Mon, 15 Jan 2024 08:30:34 +0000 (02:30 -0600)
committerStephen Jianu <stephen@stephenjianu.com>
Mon, 15 Jan 2024 08:30:34 +0000 (02:30 -0600)
* Better comments
* Use melpa-stable instead of melpa
* evil-collection setup
* Use built-in line numbers functionality

emacs/.emacs.d/init.el

index 7af10bfb5ea5a1dcd64e39cacae89ff89275b557..0bac69bd45a26287d0e97c1ae8efdbb681b4e2d3 100755 (executable)
@@ -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)