Update init.el

This commit is contained in:
Alexander Rosenberg 2023-09-27 04:07:01 -07:00
parent 19043ee1bb
commit 24837ac1de
Signed by: Zander671
GPG Key ID: 5FD0394ADBD72730

69
init.el
View File

@ -3,7 +3,7 @@
;;; Code:
;; Some other config files
(add-to-list 'load-path (expand-file-name "elisp"))
(add-to-list 'load-path "~/.emacs.d/elisp")
;; Set package dir to follow no-littering conventions
(setq package-user-dir "~/.emacs.d/var/elpa")
@ -57,8 +57,11 @@
;; Terminal mouse support
(xterm-mouse-mode 1)
;; Better mouse scrolling
(setq mouse-scroll-delay 0)
;; Better scrolling
(setq mouse-scroll-delay 0
scroll-conservatively 10
scroll-margin 2
scroll-preserve-screen-position t)
;; Make show paren instant
(setq show-paren-delay 0)
@ -67,9 +70,6 @@
;; 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)
@ -86,9 +86,6 @@
;; No scroll bars
(scroll-bar-mode -1)
;; Some better scrolling
(pixel-scroll-mode 1)
;; Visual line mode
(global-visual-line-mode 1)
@ -124,6 +121,9 @@
;; recentf
(use-package recentf
:init
(setq recentf-exclude '("^/tmp/.*"
"^~/.mail/[^/]/Drafts/.+"))
:config
(recentf-mode 1))
@ -210,6 +210,14 @@ visual states."
("M-DEL" . vertico-directory-delete-word))
:hook (minibuffer-setup . cursor-intangible-mode)
:init
(defun my/crm-indicator (args)
(cons (format "[CRM%s] %s"
(replace-regexp-in-string
"\\`\\[.*?]\\*\\|\\[.*?]\\*\\'" ""
crm-separator)
(car args))
(cdr args)))
(advice-add #'completing-read-multiple :filter-args #'my/crm-indicator)
(setq vertico-cycle t
enable-recursive-minibuffers t
read-extended-command-predicate #'command-completion-default-include-p
@ -321,7 +329,8 @@ visual states."
:init
(defun my/-cape-setup-text-mode ()
(setq-local completion-at-point-functions
'(cape-dict cape-dabbrev)))
'(cape-dict cape-dabbrev)
corfu-auto nil))
(add-to-list 'completion-at-point-functions #'cape-file))
;; xref
@ -393,11 +402,12 @@ visual states."
;; vterm
(use-package vterm
:hook (vterm-mode . with-editor-export-editor)
:bind ("C-x C-a" . vterm))
;; proced
(use-package proced
:bind ("C-x o" . proced)
:bind ("C-x j" . proced)
:init
(setq proced-auto-update-flag t
proced-auto-update-interval 1))
@ -419,18 +429,47 @@ visual states."
;; magit
(use-package magit
:bind ("C-x C-m" . magit)
:bind ("C-x C-y" . magit)
:init
(evil-define-key '(normal visual motion) magit-mode-map
"s" #'magit-stage-file
"S" #'magit-stage-modified))
;; org-mode
(use-package org
:bind (("C-c c" . org-capture)
("C-c a" . org-agenda)
("C-c l" . org-store-link)
:map org-mode-map
("C-c t" . org-table-create))
:init
(setq org-directory "~/org"
org-agenda-files '("~/org/")
org-log-into-drawer t
org-log-done 'time
org-log-redeadline 'time
org-log-reschedule 'time))
(use-package evil-org
:after org
:hook (org-mode . my/evil-org-mode-enable)
:init
(defun my/evil-org-mode-enable ()
(evil-org-mode 1))
(require 'evil-org-agenda)
(evil-org-agenda-set-keys))
;; khard contacts
(require 'khard)
;; mu4e
(require 'auth-source-pass)
(auth-source-pass-enable)
(add-to-list 'load-path "/usr/share/emacs/site-lisp/mu4e/")
(require 'mu4e)
(add-hook 'mu4e-index-updated-hook #'my/-mu4e-enable-index-messages)
(global-set-key (kbd "C-x C-m") #'mu4e)
(global-set-key (kbd "C-x m") #'mu4e-compose-new)
(define-key message-mode-map (kbd "C-c k") #'khard-insert-email-contact)
(evil-define-key '(normal motion) mu4e-main-mode-map "q" #'bury-buffer)
(defun my/-mu4e-enable-index-messages ()
(setq mu4e-hide-index-messages nil))
@ -456,7 +495,7 @@ visual states."
: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)
(message-signature nil)
(mu4e-refile-folder . "/protonmail/Archive")
(mu4e-sent-folder . "/protonmail/Sent")
(mu4e-drafts-folder . "/protonmail/Drafts")
@ -474,6 +513,8 @@ visual states."
(setq mu4e-alert-set-window-urgency nil)
:config
(mu4e-alert-set-default-style 'libnotify))
(mu4e t)
(mu4e-context-switch nil "Personal")
;; rainbow-delimiters
(use-package rainbow-delimiters
@ -512,3 +553,5 @@ visual states."
:init
(setq doom-modeline-support-imenu t)
(doom-modeline-mode 1))
;;; init.el ends here