From b61d6545b201f633a24e5c5edcdde24c1d170e1c Mon Sep 17 00:00:00 2001 From: Jeremy Baxter Date: Mon, 4 Mar 2024 13:18:57 +1300 Subject: [PATCH] emacs: debloat --- .emacs.d/init.el | 44 +++++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 2bb8106..2f41390 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -1,9 +1,9 @@ (setq gc-cons-threshold 100000000) +(add-to-list 'load-path "~/.emacs.d/lisp/") (require 'package) (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t) (package-initialize) -(add-to-list 'load-path "~/.emacs.d/lisp/") ;; disable menu bar, tool bar, scroll bar and savehist (menu-bar-mode -1) @@ -11,10 +11,12 @@ (scroll-bar-mode -1) (savehist-mode -1) -;; evil + undo-tree +;; evil-mode (package-install 'evil) +(add-hook 'prog-mode 'evil-local-mode) +(add-hook 'text-mode 'evil-local-mode) +;; undo-tree (package-install 'undo-tree) -(evil-mode) (global-undo-tree-mode) (evil-set-undo-system 'undo-tree) @@ -35,21 +37,18 @@ (package-install 'lua-mode) (package-install 'markdown-mode) (package-install 'nix-mode) -(package-install 'rainbow-mode) (package-install 'yaml-mode) -(package-install 'org-modern) -(package-install 'toc-org) ;; hooks (defun indent-common-hook () + ;; turn off smart indent + (electric-indent-mode -1) ;; set indent width to 4 spaces (setq tab-width 4 c-basic-offset 4 c-syntactic-indentation nil c-ts-mode-indent-offset 4 - lua-indent-level 4) - ;; turn off smart indent - (electric-indent-mode -1)) + lua-indent-level 4)) (defun indent-tab-hook () (indent-common-hook) (setq indent-tabs-mode t)) @@ -73,14 +72,21 @@ '(("\\<\\(bool\\|byte\\|ubyte\\|char\\|delegate\\|double\\|float\\|function\\|int\\|long\\|short\\|uint\\|ulong\\|ushort\\|cent\\|ucent\\|real\\|ireal\\|idouble\\|ifloat\\|creal\\|cfloat\\|cdouble\\|wchar\\|dchar\\|void\\|string\\|wstring\\|dstring\\|__vector\\|Thread\\)\\>" . 'font-lock-type-face))) ;; highlight colours +(package-install 'rainbow-mode) (add-hook 'prog-mode-hook 'rainbow-mode) +;; rainbow parens in lisp-mode +(package-install 'rainbow-delimiters) +(add-hook 'lisp-mode 'rainbow-delimiters) + ;; modernize org-mode +(package-install 'org-modern) (add-hook 'org-mode-hook 'org-modern-mode) ;; create a TOC on saving an org document +(package-install 'toc-org) (add-hook 'org-mode-hook 'toc-org-mode) ;; enable spell checking in org mode -(add-hook 'org-mode-hook '(lambda () (flyspell-mode))) +(add-hook 'org-mode-hook #'(lambda () (flyspell-mode))) ;; minibuffer completion (package-install 'marginalia) @@ -88,7 +94,7 @@ (marginalia-mode) (vertico-mode) -;; company completion with eglot +;; company completion + eglot (package-install 'company) (require 'company) (require 'eglot) @@ -150,7 +156,7 @@ ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. '(package-selected-packages - '(forge elcord nix-mode vterm breadcrumb nyan-mode simple-modeline catppuccin-theme which-key treesit-auto editorconfig diff-hl company vertico marginalia toc-org org-modern yaml-mode rainbow-mode markdown-mode lua-mode json-mode git-modes d-mode sudo-edit nerd-icons magit undo-tree evil))) + '(rainbow-delimiters forge elcord nix-mode vterm breadcrumb nyan-mode simple-modeline catppuccin-theme which-key treesit-auto editorconfig diff-hl company vertico marginalia toc-org org-modern yaml-mode rainbow-mode markdown-mode lua-mode json-mode git-modes d-mode sudo-edit nerd-icons magit undo-tree evil))) (custom-set-faces ;; custom-set-faces was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. @@ -168,13 +174,15 @@ (setq catppuccin-flavor 'mocha) (load-theme 'catppuccin :no-confirm) +;; simple-modeline (package-install 'simple-modeline) -(package-install 'nyan-mode) (simple-modeline-mode) (column-number-mode) + ;; nyan-mode -(nyan-mode) +(package-install 'nyan-mode) (setq nyan-animate-nyancat t) +(nyan-mode) ;; modeline segments (setq simple-modeline-segments @@ -199,17 +207,11 @@ (package-install 'breadcrumb) (setq breadcrumb-project-crumb-separator "  " breadcrumb-imenu-crumb-separator "  ") -(add-hook 'prog-mode-hook '(lambda () +(add-hook 'prog-mode-hook #'(lambda () (setq header-line-format '( " " (:eval (breadcrumb-project-crumbs)) " : " (:eval (breadcrumb-imenu-crumbs)))))) -;; vterm, a terminal emulator -(package-install 'vterm) -(add-hook 'vterm-mode-hook (lambda () - (evil-local-mode -1) - (hl-line-mode -1))) - ;; misc ;; guess the major mode from file name