2023-09-18 13:05:09 -07:00
|
|
|
;;; init.el --- Configuration entry point -*- lexical-binding: t -*-
|
|
|
|
;;; Commentary:
|
|
|
|
;;; Code:
|
|
|
|
|
|
|
|
;; Set package dir to follow no-littering conventions
|
|
|
|
(setq package-user-dir "~/.emacs.d/var/elpa")
|
|
|
|
|
|
|
|
;; Use melpa
|
|
|
|
(require 'package)
|
2023-09-20 00:50:34 -07:00
|
|
|
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
|
2023-09-18 13:05:09 -07:00
|
|
|
(package-initialize)
|
|
|
|
|
|
|
|
;; Ensure use-package is installed
|
|
|
|
(unless (package-installed-p 'use-package)
|
|
|
|
(package-refresh-contents)
|
|
|
|
(package-install 'use-package))
|
|
|
|
|
|
|
|
;; use-package
|
|
|
|
(eval-when-compile
|
2023-09-20 16:13:29 -07:00
|
|
|
(setq use-package-always-ensure t
|
|
|
|
package-user-dir "~/.emacs.d/var/elpa")
|
2023-09-18 13:05:09 -07:00
|
|
|
(require 'use-package))
|
|
|
|
|
|
|
|
;; no-littering
|
|
|
|
(use-package no-littering
|
|
|
|
:config
|
|
|
|
(no-littering-theme-backups)
|
|
|
|
(setq custom-file (no-littering-expand-etc-file-name "custom.el")))
|
|
|
|
|
|
|
|
;; diminish
|
|
|
|
(use-package diminish
|
|
|
|
:config
|
2023-09-21 03:20:43 -07:00
|
|
|
(diminish 'visual-line-mode)
|
2023-09-18 13:05:09 -07:00
|
|
|
(diminish 'abbrev-mode))
|
|
|
|
|
|
|
|
;; basic stuff
|
|
|
|
(use-package emacs
|
2023-09-20 00:50:34 -07:00
|
|
|
:hook ((emacs-lisp-mode . my/-emacs-lisp-mode-setup-evil-lookup)
|
|
|
|
(prog-mode . my/enable-electric-pair-mode))
|
2023-09-18 13:05:09 -07:00
|
|
|
:init
|
2023-09-20 00:50:34 -07:00
|
|
|
(defun my/-emacs-lisp-mode-setup-evil-lookup ()
|
|
|
|
(setq-local evil-lookup-func
|
|
|
|
#'my/describe-symbol-at-point))
|
|
|
|
(defun my/enable-electric-pair-mode ()
|
|
|
|
(electric-pair-local-mode 1))
|
2023-09-18 13:05:09 -07:00
|
|
|
(defun my/describe-symbol-at-point ()
|
|
|
|
"Calls `describe-symbol' on the return value of `form-at-point'."
|
|
|
|
(interactive)
|
2023-09-20 00:50:34 -07:00
|
|
|
(let ((form (form-at-point)))
|
|
|
|
(if (consp form)
|
|
|
|
(describe-symbol (cadr form))
|
|
|
|
(describe-symbol form))))
|
2023-09-18 13:05:09 -07:00
|
|
|
|
2023-09-20 03:57:16 -07:00
|
|
|
;; Terminal mouse support
|
|
|
|
(xterm-mouse-mode 1)
|
|
|
|
|
2023-09-22 02:50:19 -07:00
|
|
|
;; Better mouse scrolling
|
|
|
|
(setq mouse-scroll-delay 0)
|
|
|
|
|
2023-09-18 13:05:09 -07:00
|
|
|
;; Make show paren instant
|
|
|
|
(setq show-paren-delay 0)
|
|
|
|
(show-paren-mode 1)
|
|
|
|
|
|
|
|
;; Display line numbers
|
|
|
|
(global-display-line-numbers-mode 1)
|
|
|
|
|
|
|
|
;; Show some more context arround the point
|
|
|
|
(setq scroll-margin 2)
|
|
|
|
|
|
|
|
;; Allow the frame to be any size
|
|
|
|
(setq frame-resize-pixelwise t)
|
|
|
|
|
|
|
|
;; Disable startup screen
|
|
|
|
(setq inhibit-startup-screen t)
|
|
|
|
|
2023-09-20 00:50:34 -07:00
|
|
|
;; show column numbers
|
|
|
|
(column-number-mode 1)
|
2023-09-18 13:05:09 -07:00
|
|
|
|
|
|
|
;; Disable the menu and tool bars
|
|
|
|
(menu-bar-mode -1)
|
|
|
|
(tool-bar-mode -1)
|
|
|
|
|
|
|
|
;; No scroll bars
|
|
|
|
(scroll-bar-mode -1)
|
|
|
|
|
2023-09-21 03:20:43 -07:00
|
|
|
;; Some better scrolling
|
|
|
|
(pixel-scroll-mode 1)
|
|
|
|
|
2023-09-20 14:55:12 -07:00
|
|
|
;; Visual line mode
|
|
|
|
(global-visual-line-mode 1)
|
|
|
|
|
2023-09-18 13:05:09 -07:00
|
|
|
;; Set fonts
|
|
|
|
(add-to-list 'default-frame-alist '(font . "FiraCode Nerd Font Mono-12"))
|
|
|
|
|
2023-09-20 00:50:34 -07:00
|
|
|
;; Some settings for programming
|
|
|
|
(setq-default indent-tabs-mode nil
|
2023-09-21 03:20:43 -07:00
|
|
|
tab-width 4)
|
2023-09-20 00:50:34 -07:00
|
|
|
|
2023-09-18 13:05:09 -07:00
|
|
|
;; Tree sitter download locations
|
|
|
|
(setq treesit-language-source-alist
|
2023-09-20 00:50:34 -07:00
|
|
|
'((c "https://github.com/tree-sitter/tree-sitter-c")
|
|
|
|
(cpp "https://github.com/tree-sitter/tree-sitter-cpp")
|
|
|
|
(java "https://github.com/tree-sitter/tree-sitter-java")
|
|
|
|
(python "https://github.com/tree-sitter/tree-sitter-python")
|
2023-09-21 16:02:36 -07:00
|
|
|
(rust "https://github.com/tree-sitter/tree-sitter-rust")
|
|
|
|
(json "https://github.com/tree-sitter/tree-sitter-json")))
|
2023-09-20 00:50:34 -07:00
|
|
|
;; Tree sitter major mode conversions
|
|
|
|
(setq major-mode-remap-alist
|
|
|
|
'((c-mode . c-ts-mode)
|
2023-09-21 03:20:43 -07:00
|
|
|
(c++-mode . c++-ts-mode)
|
|
|
|
(c-or-c++-mode . c-or-c++-ts-mode)
|
|
|
|
(objc-mode . objc-ts-mode)
|
2023-09-20 00:50:34 -07:00
|
|
|
(java-mode . java-ts-mode)
|
2023-09-21 16:02:36 -07:00
|
|
|
(rust-mode . rust-ts-mode)
|
|
|
|
(json-mode . json-ts-mode))))
|
2023-09-18 13:05:09 -07:00
|
|
|
|
2023-09-21 03:20:43 -07:00
|
|
|
;; c-ts-mode
|
|
|
|
(use-package c-ts-mode
|
|
|
|
:init
|
|
|
|
(setq-default c-ts-mode-indent-offset 4))
|
|
|
|
|
|
|
|
;; recentf
|
2023-09-18 13:05:09 -07:00
|
|
|
(use-package recentf
|
|
|
|
:config
|
|
|
|
(recentf-mode 1))
|
|
|
|
|
|
|
|
;; evil
|
|
|
|
(use-package evil
|
|
|
|
:init
|
|
|
|
(setq evil-want-integration t
|
|
|
|
evil-want-keybinding nil
|
|
|
|
evil-undo-system 'undo-redo
|
2023-09-21 03:20:43 -07:00
|
|
|
evil-search-module 'isearch)
|
2023-09-18 13:05:09 -07:00
|
|
|
:config
|
|
|
|
(evil-mode 1)
|
|
|
|
(evil-define-key '(normal visual motion) proced-mode-map
|
2023-09-21 03:20:43 -07:00
|
|
|
"u" #'proced-unmark)
|
2023-09-18 13:05:09 -07:00
|
|
|
(evil-define-key '(normal visual motion) dired-mode-map
|
2023-09-21 03:20:43 -07:00
|
|
|
"u" #'dired-unmark))
|
2023-09-18 13:05:09 -07:00
|
|
|
(use-package evil-collection
|
2023-09-22 02:50:19 -07:00
|
|
|
:after evil
|
2023-09-18 13:05:09 -07:00
|
|
|
:diminish evil-collection-unimpaired-mode
|
|
|
|
:config
|
|
|
|
(evil-collection-init))
|
|
|
|
(use-package evil-surround
|
2023-09-22 02:50:19 -07:00
|
|
|
:after evil
|
2023-09-18 13:05:09 -07:00
|
|
|
:config
|
2023-09-21 03:20:43 -07:00
|
|
|
(evil-define-key 'operator evil-surround-mode-map
|
|
|
|
"z" #'evil-surround-edit
|
|
|
|
"Z" #'evil-Sunrround-edit)
|
|
|
|
(evil-define-key 'visual evil-surround-mode-map
|
|
|
|
"g z" #'evil-surround-region
|
|
|
|
"g Z" #'evil-Surround-region)
|
2023-09-18 13:05:09 -07:00
|
|
|
(global-evil-surround-mode 1))
|
2023-09-21 03:20:43 -07:00
|
|
|
(use-package evil-terminal-cursor-changer
|
2023-09-22 02:50:19 -07:00
|
|
|
:after evil
|
2023-09-20 03:57:16 -07:00
|
|
|
:config
|
|
|
|
(evil-terminal-cursor-changer-activate))
|
2023-09-18 13:05:09 -07:00
|
|
|
|
|
|
|
;; which-key
|
|
|
|
(use-package which-key
|
|
|
|
:diminish which-key-mode
|
|
|
|
:config
|
|
|
|
(which-key-mode 1))
|
|
|
|
|
|
|
|
;; avy
|
|
|
|
(use-package avy
|
2023-09-20 00:50:34 -07:00
|
|
|
:bind (("C-c C-j" . avy-resume)
|
|
|
|
("M-s s" . evil-avy-goto-char-2)
|
|
|
|
("M-s S" . evil-avy-goto-line))
|
2023-09-18 13:05:09 -07:00
|
|
|
:init
|
|
|
|
(define-minor-mode my/evil-avy-mode
|
2023-09-20 00:50:34 -07:00
|
|
|
"A minor mode for binding avy commands to s and S in evil's normal and
|
|
|
|
visual states."
|
2023-09-18 13:05:09 -07:00
|
|
|
:keymap (make-sparse-keymap))
|
|
|
|
(evil-define-key '(normal visual operator motion) my/evil-avy-mode-map
|
2023-09-21 03:20:43 -07:00
|
|
|
"s" #'evil-avy-goto-char-2
|
|
|
|
"S" #'evil-avy-goto-line)
|
2023-09-20 00:50:34 -07:00
|
|
|
(define-globalized-minor-mode my/evil-avy-global-mode my/evil-avy-mode
|
|
|
|
(lambda () (my/evil-avy-mode 1))
|
|
|
|
:predicate '((not magit-mode dired-mode proced-mode) t))
|
|
|
|
(my/evil-avy-global-mode 1)
|
2023-09-18 13:05:09 -07:00
|
|
|
:config
|
|
|
|
(avy-setup-default))
|
|
|
|
|
|
|
|
;; ace-window
|
|
|
|
(use-package ace-window
|
|
|
|
:diminish ace-window-mode
|
|
|
|
:bind ("M-o" . ace-window)
|
|
|
|
:init
|
|
|
|
(setq aw-scope 'frame
|
|
|
|
aw-minibuffer-flag t))
|
|
|
|
|
|
|
|
;; savehist
|
|
|
|
(use-package savehist
|
|
|
|
:config
|
|
|
|
(savehist-mode 1))
|
|
|
|
|
|
|
|
;; vertico
|
|
|
|
(use-package vertico
|
|
|
|
:bind (:map vertico-map
|
2023-09-20 00:50:34 -07:00
|
|
|
("C-S-k" . kill-line)
|
|
|
|
("C-k" . vertico-previous)
|
|
|
|
("C-j" . vertico-next)
|
|
|
|
("RET" . vertico-directory-enter)
|
|
|
|
("DEL" . vertico-directory-delete-char)
|
|
|
|
("M-DEL" . vertico-directory-delete-word))
|
2023-09-21 03:20:43 -07:00
|
|
|
:hook (minibuffer-setup . cursor-intangible-mode)
|
2023-09-18 13:05:09 -07:00
|
|
|
:init
|
|
|
|
(setq vertico-cycle t
|
|
|
|
enable-recursive-minibuffers t
|
|
|
|
read-extended-command-predicate #'command-completion-default-include-p
|
|
|
|
minibuffer-prompt-properties '(read-only t
|
2023-09-21 03:20:43 -07:00
|
|
|
cursor-intangible t
|
|
|
|
face minibuffer-prompt))
|
2023-09-18 13:05:09 -07:00
|
|
|
(vertico-mode 1))
|
|
|
|
|
|
|
|
;; orderless
|
|
|
|
(use-package orderless
|
|
|
|
:autoload orderless-define-completion-style
|
2023-09-20 00:50:34 -07:00
|
|
|
:hook (text-mode . my/-setup-text-mode-completion-styles)
|
2023-09-18 13:05:09 -07:00
|
|
|
:init
|
2023-09-20 00:50:34 -07:00
|
|
|
(defun my/-setup-text-mode-completion-styles ()
|
|
|
|
(setq-local completion-styles '(basic)))
|
2023-09-18 13:05:09 -07:00
|
|
|
(orderless-define-completion-style my/orderless-with-initialism
|
|
|
|
(orderless-matching-styles '(orderless-initialism
|
|
|
|
orderless-literal
|
|
|
|
orderless-regexp)))
|
|
|
|
(setq completion-styles '(orderless basic)
|
|
|
|
completion-category-defaults nil
|
|
|
|
completion-category-overrides '((file
|
2023-09-20 00:50:34 -07:00
|
|
|
(styles basic partial-completion))
|
2023-09-18 13:05:09 -07:00
|
|
|
(command
|
2023-09-20 00:50:34 -07:00
|
|
|
(my/orderless-with-initialism basic))
|
|
|
|
(eglot
|
|
|
|
(orderless basic)))))
|
2023-09-18 13:05:09 -07:00
|
|
|
|
|
|
|
;; marginalia
|
|
|
|
(use-package marginalia
|
|
|
|
:bind (:map minibuffer-local-map
|
2023-09-21 03:20:43 -07:00
|
|
|
("M-a" . marginalia-cycle))
|
2023-09-18 13:05:09 -07:00
|
|
|
:init
|
|
|
|
(marginalia-mode 1))
|
|
|
|
|
|
|
|
;; embark
|
|
|
|
(use-package embark
|
2023-09-20 00:50:34 -07:00
|
|
|
:bind (("C-." . embark-act)
|
2023-09-21 03:20:43 -07:00
|
|
|
("C-;" . embark-dwim))
|
2023-09-20 00:50:34 -07:00
|
|
|
:init
|
|
|
|
(setq embark-quit-after-action nil)
|
|
|
|
(add-to-list 'display-buffer-alist
|
2023-09-21 03:20:43 -07:00
|
|
|
'("\\`\\*Embark Collect \\(Live\\|Completions\\)\\*"
|
|
|
|
nil
|
|
|
|
(window-parameters (mode-line-format . none)))))
|
2023-09-18 13:05:09 -07:00
|
|
|
|
|
|
|
;; consult
|
|
|
|
(use-package consult
|
|
|
|
:bind (("C-s" . consult-line)
|
|
|
|
("C-x b" . consult-buffer)
|
|
|
|
("C-S-s" . consult-ripgrep)
|
|
|
|
("C-x C-S-f" . consult-fd)
|
|
|
|
("C-x C-m" . consult-man)
|
|
|
|
("C-h TAB" . consult-info)
|
|
|
|
("C-h C-m" . my/consult-emacs-info)
|
|
|
|
("C-x c k" . consult-keep-lines)
|
|
|
|
("C-x c f" . consult-focus-lines)
|
|
|
|
("C-x c r" . consult-recent-file)
|
|
|
|
("C-x c b" . consult-bookmark)
|
2023-09-22 02:50:19 -07:00
|
|
|
("C-x c d" . consult-fd)
|
|
|
|
("C-x c g" . consult-ripgrep)
|
2023-09-20 00:50:34 -07:00
|
|
|
("M-g i" . consult-imenu)
|
|
|
|
("M-g I" . consult-imenu-multi)
|
|
|
|
("M-g r" . consult-imenu-multi))
|
2023-09-21 03:20:43 -07:00
|
|
|
:hook (minibuffer-setup . my/consult-setup-minibuffer-completion)
|
2023-09-18 13:05:09 -07:00
|
|
|
:init
|
2023-09-21 03:20:43 -07:00
|
|
|
(defun my/consult-setup-minibuffer-completion ()
|
|
|
|
(setq-local completion-in-region-function #'consult-completion-in-region))
|
2023-09-18 13:05:09 -07:00
|
|
|
(defun my/consult-emacs-info ()
|
|
|
|
"`consult-info' for emacs specific pages."
|
|
|
|
(interactive)
|
|
|
|
(consult-info "emacs" "efaq" "cl" "compat" "elisp"))
|
|
|
|
(evil-declare-motion #'consult-line))
|
|
|
|
|
|
|
|
;; integration for embark and consult
|
|
|
|
(use-package embark-consult
|
|
|
|
:hook (embark-collect-mode . consult-preview-at-point-mode))
|
|
|
|
|
|
|
|
;; corfu (autocomplete)
|
|
|
|
(use-package corfu
|
2023-09-20 00:50:34 -07:00
|
|
|
:bind (("M-<tab>" . completion-at-point)
|
|
|
|
:map corfu-map
|
|
|
|
("M-SPC" . corfu-insert-separator)
|
|
|
|
("M-m" . my/corfu-move-to-minibuffer))
|
2023-09-18 13:05:09 -07:00
|
|
|
:init
|
2023-09-20 00:50:34 -07:00
|
|
|
(defun my/corfu-move-to-minibuffer ()
|
|
|
|
(interactive)
|
|
|
|
(when completion-in-region--data
|
|
|
|
(let ((completion-extra-properties corfu--extra)
|
|
|
|
completion-cycle-threshold completion-cycling)
|
|
|
|
(apply #'consult-completion-in-region completion-in-region--data))))
|
2023-09-18 13:05:09 -07:00
|
|
|
(setq corfu-cycle t
|
2023-09-20 00:50:34 -07:00
|
|
|
corfu-auto t
|
|
|
|
corfu-on-exact-match nil
|
|
|
|
completion-cycle-threshold 3)
|
|
|
|
(global-corfu-mode 1)
|
|
|
|
(corfu-popupinfo-mode 1)
|
|
|
|
:config
|
|
|
|
(add-to-list 'corfu-continue-commands #'corfu-move-to-minibuffer))
|
|
|
|
(use-package corfu-terminal
|
|
|
|
:init
|
|
|
|
(corfu-terminal-mode 1))
|
|
|
|
|
|
|
|
;; cape (a bunch of capfs!)
|
|
|
|
(use-package cape
|
|
|
|
:bind (("M-p" . cape-dabbrev)
|
|
|
|
("M-P" . cape-line))
|
|
|
|
:hook (text-mode . my/-cape-setup-text-mode)
|
|
|
|
:init
|
|
|
|
(defun my/-cape-setup-text-mode ()
|
|
|
|
(setq-local completion-at-point-functions
|
|
|
|
'(cape-dict cape-dabbrev)))
|
|
|
|
(add-to-list 'completion-at-point-functions #'cape-file))
|
2023-09-18 13:05:09 -07:00
|
|
|
|
|
|
|
;; xref
|
|
|
|
(use-package xref
|
|
|
|
:init
|
|
|
|
(evil-define-key '(normal motion) 'global
|
2023-09-21 03:20:43 -07:00
|
|
|
"gr" #'xref-find-references)
|
2023-09-18 13:05:09 -07:00
|
|
|
(setq xref-show-xrefs-function #'consult-xref
|
2023-09-21 03:20:43 -07:00
|
|
|
xref-show-definitions-function #'consult-xref))
|
2023-09-18 13:05:09 -07:00
|
|
|
|
2023-09-20 03:57:16 -07:00
|
|
|
;; popup.el
|
|
|
|
(use-package popup)
|
|
|
|
|
2023-09-18 13:05:09 -07:00
|
|
|
;; flymake
|
|
|
|
(use-package flymake
|
2023-09-20 00:50:34 -07:00
|
|
|
:bind (:map flymake-mode-map
|
|
|
|
("C-c e" . my/flymake-show-diagnostic-at-point)
|
2023-09-20 03:57:16 -07:00
|
|
|
("C-c C-e" . consult-flymake))
|
2023-09-20 00:50:34 -07:00
|
|
|
:hook (emacs-lisp-mode . my/enable-flymake-mode)
|
2023-09-18 13:05:09 -07:00
|
|
|
:init
|
2023-09-20 00:50:34 -07:00
|
|
|
(defun my/flymake-show-diagnostic-at-point ()
|
|
|
|
(interactive)
|
|
|
|
(if-let ((pos (point))
|
|
|
|
(diag (and flymake-mode
|
|
|
|
(get-char-property pos 'flymake-diagnostic)))
|
|
|
|
(message (flymake--diag-text diag)))
|
2023-09-20 03:57:16 -07:00
|
|
|
(popup-tip message)))
|
2023-09-20 00:50:34 -07:00
|
|
|
(defun my/enable-flymake-mode ()
|
|
|
|
(flymake-mode 1)))
|
2023-09-18 13:05:09 -07:00
|
|
|
|
|
|
|
;; eldoc
|
|
|
|
(use-package eldoc
|
|
|
|
:diminish eldoc-mode
|
|
|
|
:init
|
|
|
|
(set eldoc-echo-area-use-multiline-p nil))
|
|
|
|
|
2023-09-20 00:50:34 -07:00
|
|
|
;; eglot
|
|
|
|
(use-package eglot
|
|
|
|
:hook (((c-ts-mode c++-ts-mode java-ts-mode rust-ts-mode
|
2023-09-21 03:20:43 -07:00
|
|
|
python-ts-mode latex-mode) . eglot-ensure)
|
2023-09-20 14:55:12 -07:00
|
|
|
(eglot-managed-mode . my/-eglot-setup))
|
2023-09-20 00:50:34 -07:00
|
|
|
:init
|
2023-09-20 14:55:12 -07:00
|
|
|
(defun my/-eglot-setup ()
|
2023-09-20 00:50:34 -07:00
|
|
|
"Setup eldoc variables for `eglot-managed-mode-hook'."
|
|
|
|
(setq-local eldoc-echo-area-use-multiline-p
|
2023-09-20 14:55:12 -07:00
|
|
|
nil)
|
|
|
|
(eglot-inlay-hints-mode -1))
|
2023-09-20 00:50:34 -07:00
|
|
|
(advice-add 'eglot-completion-at-point :around #'cape-wrap-buster)
|
2023-09-20 14:55:12 -07:00
|
|
|
(setq eglot-autoshutdown t))
|
2023-09-20 00:50:34 -07:00
|
|
|
|
|
|
|
;; rust
|
|
|
|
(use-package rust-mode)
|
|
|
|
|
|
|
|
;; json
|
|
|
|
(use-package json-mode)
|
|
|
|
|
2023-09-21 16:02:36 -07:00
|
|
|
;; sly
|
|
|
|
(use-package sly
|
|
|
|
:hook (lisp-mode . my/common-lisp-autoconnect-sly)
|
|
|
|
:autoload sly-connected-p
|
|
|
|
:init
|
|
|
|
(defun my/common-lisp-autoconnect-sly ()
|
|
|
|
(unless (sly-connected-p)
|
|
|
|
(save-excursion (sly))))
|
|
|
|
(setq inferior-lisp-program "/usr/bin/sbcl"))
|
|
|
|
|
2023-09-18 15:06:41 -07:00
|
|
|
;; vterm
|
2023-09-18 13:05:09 -07:00
|
|
|
(use-package vterm
|
2023-09-20 00:50:34 -07:00
|
|
|
:bind ("C-x C-a" . vterm))
|
2023-09-18 15:06:41 -07:00
|
|
|
|
|
|
|
;; proced
|
|
|
|
(use-package proced
|
|
|
|
:bind ("C-x o" . proced)
|
|
|
|
:init
|
|
|
|
(setq proced-auto-update-flag t
|
2023-09-20 00:50:34 -07:00
|
|
|
proced-auto-update-interval 1))
|
2023-09-18 15:06:41 -07:00
|
|
|
|
|
|
|
;; dired
|
|
|
|
(use-package dired
|
|
|
|
:ensure nil
|
|
|
|
:init
|
|
|
|
(evil-define-key '(normal visual motion) dired-mode-map
|
2023-09-21 03:20:43 -07:00
|
|
|
"u" #'dired-unmark
|
|
|
|
"U" #'dired-unmark-all-marks)
|
2023-09-18 15:06:41 -07:00
|
|
|
(evil-define-key '(normal visual motion) wdired-mode-map
|
2023-09-21 03:20:43 -07:00
|
|
|
"u" #'dired-unmark
|
|
|
|
"U" #'dired-unmark-all-marks))
|
2023-09-18 15:06:41 -07:00
|
|
|
|
2023-09-22 02:53:16 -07:00
|
|
|
;; ibuffer
|
|
|
|
(use-package ibuffer
|
|
|
|
:bind ("C-x C-b" . ibuffer))
|
|
|
|
|
2023-09-18 15:06:41 -07:00
|
|
|
;; magit
|
2023-09-20 00:50:34 -07:00
|
|
|
(use-package magit
|
|
|
|
:bind ("C-x C-m" . magit)
|
|
|
|
:init
|
|
|
|
(evil-define-key '(normal visual motion) magit-mode-map
|
2023-09-21 03:20:43 -07:00
|
|
|
"s" #'magit-stage-file
|
|
|
|
"S" #'magit-stage-modified))
|
2023-09-20 00:50:34 -07:00
|
|
|
|
2023-09-22 02:50:19 -07:00
|
|
|
;; mu4e
|
|
|
|
(add-to-list 'load-path "/usr/share/emacs/site-lisp/mu4e/")
|
|
|
|
(require 'mu4e)
|
|
|
|
(add-hook 'mu4e-index-updated-hook #'my/-mu4e-enable-index-messages)
|
|
|
|
(defun my/-mu4e-enable-index-messages ()
|
|
|
|
(setq mu4e-hide-index-messages nil))
|
|
|
|
(defun my/mu4e-update-mail-and-index-silent ()
|
|
|
|
"Run `mu4e-update-mail-and-index' without any messages in the background."
|
|
|
|
(setq mu4e-hide-index-messages t)
|
|
|
|
(mu4e-update-mail-and-index t))
|
|
|
|
(setq mu4e-change-filenames-when-moving t
|
|
|
|
mu4e-context-policy 'pick-first
|
|
|
|
mu4e-index-update-error-warning nil
|
|
|
|
mu4e-get-mail-command "mbsync protonmail"
|
|
|
|
mu4e-completing-read-function #'completing-read-default
|
|
|
|
mu4e-contexts
|
|
|
|
`(,(make-mu4e-context
|
|
|
|
:name "Personal"
|
|
|
|
:enter-func (lambda () (mu4e-message "Entered personal context"))
|
|
|
|
:match-func (lambda (msg)
|
|
|
|
(when msg
|
|
|
|
(string-match-p "^/protonmail/"
|
|
|
|
(mu4e-message-field msg
|
|
|
|
:maildir))))
|
|
|
|
:vars `((user-mail-address . ,(auth-source-pass-get "email" "emacs/mu4e-protonmail"))
|
|
|
|
(user-full-name . ,(auth-source-pass-get "name" "emacs/mu4e-protonmail"))
|
|
|
|
(mu4e-compose-signature nil)
|
|
|
|
(mu4e-refile-folder . "/protonmail/Archive")
|
|
|
|
(mu4e-sent-folder . "/protonmail/Sent")
|
|
|
|
(mu4e-drafts-folder . "/protonmail/Drafts")
|
|
|
|
(mu4e-trash-folder . "/protonmail/Trash")
|
|
|
|
(mu4e-bookmarks . ((:name "Inbox"
|
|
|
|
:query "maildir:/protonmail/Inbox"
|
|
|
|
:key ?i)
|
|
|
|
(:name "Unread"
|
|
|
|
:query "flag:unread AND NOT flag:trashed AND NOT maildir:/protonmail/Spam"
|
|
|
|
:key ?u)))))))
|
|
|
|
(use-package mu4e-alert
|
|
|
|
:after mu4e
|
|
|
|
:hook (after-init . mu4e-alert-enable-notifications)
|
|
|
|
:config
|
|
|
|
(mu4e-alert-set-default-style 'libnotify))
|
|
|
|
|
2023-09-20 00:50:34 -07:00
|
|
|
;; rainbow-delimiters
|
|
|
|
(use-package rainbow-delimiters
|
|
|
|
:hook (prog-mode . rainbow-delimiters-mode))
|
2023-09-18 13:05:09 -07:00
|
|
|
|
|
|
|
;; Theme (doom-themes)
|
|
|
|
(use-package doom-themes
|
|
|
|
:config
|
|
|
|
(load-theme 'doom-molokai t)
|
|
|
|
(doom-themes-org-config))
|
|
|
|
|
|
|
|
;; solaire-mode
|
|
|
|
(use-package solaire-mode
|
|
|
|
:config
|
|
|
|
(solaire-global-mode 1))
|
2023-09-21 03:20:43 -07:00
|
|
|
|
|
|
|
;; icons
|
|
|
|
(use-package nerd-icons)
|
|
|
|
(use-package nerd-icons-completion
|
|
|
|
:config
|
|
|
|
(nerd-icons-completion-mode))
|
|
|
|
(use-package nerd-icons-dired
|
|
|
|
:hook (dired-mode . nerd-icons-dired-mode))
|
|
|
|
(use-package kind-icon
|
|
|
|
:after corfu
|
|
|
|
:init
|
|
|
|
(setq kind-icon-default-face 'corfu-default
|
|
|
|
kind-icon-default-style
|
|
|
|
'(:padding -1 :stroke 0 :margin 0 :radius 0 :height 0.5 :scale 1))
|
|
|
|
:config
|
|
|
|
(add-to-list 'corfu-margin-formatters #'kind-icon-margin-formatter))
|
|
|
|
|
|
|
|
|
|
|
|
;; modeline (doom-modeline)
|
|
|
|
(use-package doom-modeline
|
|
|
|
:init
|
|
|
|
(setq doom-modeline-support-imenu t)
|
|
|
|
(doom-modeline-mode 1))
|