527 lines
23 KiB
EmacsLisp
527 lines
23 KiB
EmacsLisp
(setq gc-cons-threshold 100000000)
|
|
(setq read-process-output-max (* 1024 1024 4))
|
|
|
|
(defvar bootstrap-version)
|
|
(let ((bootstrap-file
|
|
(expand-file-name
|
|
"straight/repos/straight.el/bootstrap.el"
|
|
(or (bound-and-true-p straight-base-dir)
|
|
user-emacs-directory)))
|
|
(bootstrap-version 7))
|
|
(unless (file-exists-p bootstrap-file)
|
|
(with-current-buffer
|
|
(url-retrieve-synchronously
|
|
"https://raw.githubusercontent.com/radian-software/straight.el/develop/install.el"
|
|
'silent 'inhibit-cookies)
|
|
(goto-char (point-max))
|
|
(eval-print-last-sexp)))
|
|
(load bootstrap-file nil 'nomessage))
|
|
|
|
(straight-use-package 'use-package)
|
|
(setq straight-use-package-by-default t)
|
|
|
|
(use-package emacs
|
|
:straight (:type built-in)
|
|
:custom ;; Set custom variables to configure Emacs behavior.
|
|
(auto-save-default nil) ;; Disable automatic saving of buffers.
|
|
(column-number-mode t) ;; Display the column number in the mode line.
|
|
(create-lockfiles nil) ;; Prevent the creation of lock files when editing.
|
|
(delete-by-moving-to-trash t) ;; Move deleted files to the trash instead of permanently deleting them.
|
|
(delete-selection-mode 1) ;; Enable replacing selected text with typed text.
|
|
(display-line-numbers-type 'relative) ;; Use relative line numbering in programming modes.
|
|
(global-auto-revert-non-file-bUffers t) ;; Automatically refresh non-file buffers.
|
|
(history-length 25) ;; Set the length of the command history.
|
|
(indent-tabs-mode nil) ;; Disable the use of tabs for indentation (use spaces instead).
|
|
(inhibit-startup-message t) ;; Disable the startup message when Emacs launches.
|
|
(initial-scratch-message "") ;; Clear the initial message in the *scratch* buffer.
|
|
(ispell-dictionary "en_US") ;; Set the default dictionary for spell checking.
|
|
(make-backup-files nil) ;; Disable creation of backup files.
|
|
(pixel-scroll-precision-mode t) ;; Enable precise pixel scrolling.
|
|
(pixel-scroll-precision-use-momentum nil) ;; Disable momentum scrolling for pixel precision.
|
|
(ring-bell-function 'ignore) ;; Disable the audible bell.
|
|
(split-width-threshold 300) ;; Prevent automatic window splitting if the window width exceeds 300 pixels.
|
|
(switch-to-buffer-obey-display-actions t) ;; Make buffer switching respect display actions.
|
|
(tab-always-indent 'complete) ;; Make the TAB key complete text instead of just indenting.
|
|
(tab-width 4) ;; Set the tab width to 4 spaces.
|
|
(treesit-font-lock-level 4) ;; Use advanced font locking for Treesit mode.
|
|
(truncate-lines t) ;; Enable line truncation to avoid wrapping long lines.
|
|
(use-dialog-box nil) ;; Disable dialog boxes in favor of minibuffer prompts.
|
|
(use-short-answers t) ;; Use short answers in prompts for quicker responses (y instead of yes)
|
|
(warning-minimum-level :emergency) ;; Set the minimum level of warnings to display.
|
|
|
|
:hook ;; Add hooks to enable specific features in certain modes.
|
|
(prog-mode . display-line-numbers-mode) ;; Enable line numbers in programming modes.
|
|
|
|
:config
|
|
(set-face-attribute 'default nil :family "JetBrainsMono Nerd Font" :height 100)
|
|
(when (eq system-type 'darwin) ;; Check if the system is macOS.
|
|
(setq mac-command-modifier 'meta) ;; Set the Command key to act as the Meta key.
|
|
(set-face-attribute 'default nil :family "JetBrainsMono Nerd Font" :height 130))
|
|
|
|
;; Save manual customizations to a separate file instead of cluttering `init.el'.
|
|
(setq custom-file (locate-user-emacs-file "custom-vars.el")) ;; Specify the custom file path.
|
|
(load custom-file 'noerror 'nomessage) ;; Load the custom file quietly, ignoring errors.
|
|
|
|
:init ;; Initialization settings that apply before the package is loaded.
|
|
(tool-bar-mode -1) ;; Disable the tool bar for a cleaner interface.
|
|
(menu-bar-mode -1) ;; Disable the menu bar for a more streamlined look.
|
|
(when scroll-bar-mode
|
|
(scroll-bar-mode -1)) ;; Disable the scroll bar if it is active.
|
|
(global-hl-line-mode -1) ;; Disable highlight of the current line
|
|
(global-auto-revert-mode 1) ;; Enable global auto-revert mode to keep buffers up to date with their corresponding files.
|
|
(recentf-mode 1) ;; Enable tracking of recently opened files.
|
|
(savehist-mode 1) ;; Enable saving of command history.
|
|
(save-place-mode 1) ;; Enable saving the place in files for easier return.
|
|
(winner-mode 1) ;; Enable winner mode to easily undo window configuration changes.
|
|
(xterm-mouse-mode 1) ;; Enable mouse support in terminal mode.
|
|
(file-name-shadow-mode 1) ;; Enable shadowing of filenames for clarity.
|
|
(modify-coding-system-alist 'file "" 'utf-8))
|
|
|
|
(use-package dired
|
|
:straight (:type built-in) ;; This is built-in, no need to fetch it.
|
|
:custom
|
|
(dired-listing-switches "-lah --group-directories-first") ;; Display files in a human-readable format and group directories first.
|
|
(dired-dwim-target t) ;; Enable "do what I mean" for target directories.
|
|
(dired-kill-when-opening-new-dired-buffer t)) ;; Close the previous buffer when opening a new `dired' instance.
|
|
|
|
(use-package eldoc
|
|
:straight (:type built-in) ;; This is built-in, no need to fetch it.
|
|
:config
|
|
(setq eldoc-idle-delay 0) ;; Automatically fetch doc help
|
|
(setq eldoc-echo-area-use-multiline-p nil) ;; We use the "K" floating help instead
|
|
;; set to t if you want docs on the echo area
|
|
(setq eldoc-echo-area-display-truncation-message nil)
|
|
:init
|
|
(global-eldoc-mode))
|
|
|
|
(use-package flymake
|
|
:straight (:type built-in) ;; This is built-in, no need to fetch it.
|
|
:defer t
|
|
:hook (prog-mode . flymake-mode)
|
|
:custom
|
|
(flymake-margin-indicators-string
|
|
'((error "!»" compilation-error) (warning "»" compilation-warning) (note "»" compilation-info))))
|
|
|
|
(use-package which-key
|
|
:straight (:type built-in) ;; This is built-in, no need to fetch it.
|
|
:defer t ;; Defer loading Which-Key until after init.
|
|
:hook
|
|
(after-init . which-key-mode)) ;; Enable which-key mode after initialization.
|
|
|
|
(use-package vertico
|
|
:hook
|
|
(after-init . vertico-mode) ;; Enable vertico after Emacs has initialized.
|
|
:custom
|
|
(vertico-count 10) ;; Number of candidates to display in the completion list.
|
|
(vertico-resize nil) ;; Disable resizing of the vertico minibuffer.
|
|
(vertico-cycle nil)) ;; Do not cycle through candidates when reaching the end of the list.
|
|
|
|
(use-package orderless
|
|
:defer t ;; Load Orderless on demand.
|
|
:after vertico ;; Ensure Vertico is loaded before Orderless.
|
|
:init
|
|
(setq completion-styles '(orderless basic) ;; Set the completion styles.
|
|
completion-category-defaults nil ;; Clear default category settings.
|
|
completion-category-overrides '((file (styles partial-completion))))) ;; Customize file completion styles.
|
|
|
|
(use-package marginalia
|
|
:hook
|
|
(after-init . marginalia-mode))
|
|
|
|
(use-package consult
|
|
:defer t
|
|
:init
|
|
;; Enhance register preview with thin lines and no mode line.
|
|
(advice-add #'register-preview :override #'consult-register-window)
|
|
|
|
;; Use Consult for xref locations with a preview feature.
|
|
(setq xref-show-xrefs-function #'consult-xref
|
|
xref-show-definitions-function #'consult-xref))
|
|
|
|
(use-package embark
|
|
:defer t)
|
|
|
|
(use-package embark-consult
|
|
:hook
|
|
(embark-collect-mode . consult-preview-at-point-mode)) ;; Enable preview in Embark collect mode.
|
|
|
|
(use-package treesit-auto
|
|
:after emacs
|
|
:config
|
|
(treesit-auto-add-to-auto-mode-alist 'all)
|
|
(global-treesit-auto-mode t))
|
|
|
|
(use-package corfu
|
|
:defer t
|
|
:custom
|
|
(corfu-auto t) ;; Only completes when hitting TAB
|
|
(corfu-auto-delay 0) ;; Delay before popup (enable if corfu-auto is t)
|
|
(corfu-auto-prefix 1) ;; Trigger completion after typing 1 character
|
|
(corfu-quit-no-match t) ;; Quit popup if no match
|
|
(corfu-scroll-margin 5) ;; Margin when scrolling completions
|
|
(corfu-max-width 50) ;; Maximum width of completion popup
|
|
(corfu-min-width 50) ;; Minimum width of completion popup
|
|
(corfu-popupinfo-delay 0.5) ;; Delay before showing documentation popup
|
|
:config
|
|
(add-to-list 'corfu-margin-formatters #'nerd-icons-corfu-formatter)
|
|
(global-corfu-mode)
|
|
(corfu-popupinfo-mode t))
|
|
|
|
|
|
(use-package nerd-icons-corfu
|
|
:defer t
|
|
:after (:all corfu))
|
|
|
|
;; LSP BOOSTER
|
|
(defun lsp-booster--advice-json-parse (old-fn &rest args)
|
|
"Try to parse bytecode instead of json."
|
|
(or
|
|
(when (equal (following-char) ?#)
|
|
(let ((bytecode (read (current-buffer))))
|
|
(when (byte-code-function-p bytecode)
|
|
(funcall bytecode))))
|
|
(apply old-fn args)))
|
|
(advice-add (if (progn (require 'json)
|
|
(fboundp 'json-parse-buffer))
|
|
'json-parse-buffer
|
|
'json-read)
|
|
:around
|
|
#'lsp-booster--advice-json-parse)
|
|
|
|
(defun lsp-booster--advice-final-command (old-fn cmd &optional test?)
|
|
"Prepend emacs-lsp-booster command to lsp CMD."
|
|
(let ((orig-result (funcall old-fn cmd test?)))
|
|
(if (and (not test?) ;; for check lsp-server-present?
|
|
(not (file-remote-p default-directory)) ;; see lsp-resolve-final-command, it would add extra shell wrapper
|
|
lsp-use-plists
|
|
(not (functionp 'json-rpc-connection)) ;; native json-rpc
|
|
(executable-find "emacs-lsp-booster"))
|
|
(progn
|
|
(when-let ((command-from-exec-path (executable-find (car orig-result)))) ;; resolve command from exec-path (in case not found in $PATH)
|
|
(setcar orig-result command-from-exec-path))
|
|
(message "Using emacs-lsp-booster for %s!" orig-result)
|
|
(cons "emacs-lsp-booster" orig-result))
|
|
orig-result)))
|
|
(advice-add 'lsp-resolve-final-command :around #'lsp-booster--advice-final-command)
|
|
|
|
(use-package lsp-mode
|
|
:defer t
|
|
:hook (;; Replace XXX-mode with concrete major mode (e.g. python-mode)
|
|
(lsp-mode . lsp-enable-which-key-integration) ;; Integrate with Which Key
|
|
((js-mode ;; Enable LSP for JavaScript
|
|
tsx-ts-mode ;; Enable LSP for TSX
|
|
typescript-ts-mode ;; Enable LSP for TypeScript
|
|
css-ts-mode ;; Enable LSP for CSS
|
|
go-ts-mode ;; Enable LSP for Go
|
|
js-ts-mode ;; Enable LSP for JavaScript (TS mode)
|
|
nix-ts-mode
|
|
web-mode) . lsp-deferred)) ;; Enable LSP for Web (HTML)
|
|
:commands lsp
|
|
:custom
|
|
(lsp-keymap-prefix "C-c l") ;; Set the prefix for LSP commands.
|
|
(lsp-inlay-hint-enable nil) ;; Usage of inlay hints.
|
|
(lsp-completion-provider :none) ;; Disable the default completion provider.
|
|
(lsp-session-file (locate-user-emacs-file ".lsp-session")) ;; Specify session file location.
|
|
(lsp-log-io nil) ;; Disable IO logging for speed.
|
|
(lsp-idle-delay 0.5) ;; Set the delay for LSP to 0 (debouncing).
|
|
(lsp-keep-workspace-alive nil) ;; Disable keeping the workspace alive.
|
|
;; Core settings
|
|
(lsp-enable-xref t) ;; Enable cross-references.
|
|
(lsp-auto-configure t) ;; Automatically configure LSP.
|
|
(lsp-enable-links nil) ;; Disable links.
|
|
(lsp-eldoc-enable-hover t) ;; Enable ElDoc hover.
|
|
(lsp-enable-file-watchers nil) ;; Disable file watchers.
|
|
(lsp-enable-folding nil) ;; Disable folding.
|
|
(lsp-enable-imenu t) ;; Enable Imenu support.
|
|
(lsp-enable-indentation nil) ;; Disable indentation.
|
|
(lsp-enable-on-type-formatting nil) ;; Disable on-type formatting.
|
|
(lsp-enable-suggest-server-download t) ;; Enable server download suggestion.
|
|
(lsp-enable-symbol-highlighting t) ;; Enable symbol highlighting.
|
|
(lsp-enable-text-document-color t) ;; Enable text document color.
|
|
;; Modeline settings
|
|
(lsp-modeline-code-actions-enable nil) ;; Keep modeline clean.
|
|
(lsp-modeline-diagnostics-enable nil) ;; Use `flymake' instead.
|
|
(lsp-modeline-workspace-status-enable t) ;; Display "LSP" in the modeline when enabled.
|
|
(lsp-signature-doc-lines 1) ;; Limit echo area to one line.
|
|
(lsp-eldoc-render-all t) ;; Render all ElDoc messages.
|
|
;; Completion settings
|
|
(lsp-completion-enable t) ;; Enable completion.
|
|
(lsp-completion-enable-additional-text-edit t) ;; Enable additional text edits for completions.
|
|
(lsp-enable-snippet nil) ;; Disable snippets
|
|
(lsp-completion-show-kind t) ;; Show kind in completions.
|
|
;; Lens settings
|
|
(lsp-lens-enable t) ;; Enable lens support.
|
|
;; Headerline settings
|
|
(lsp-headerline-breadcrumb-enable-symbol-numbers t) ;; Enable symbol numbers in the headerline.
|
|
(lsp-headerline-arrow "▶") ;; Set arrow for headerline.
|
|
(lsp-headerline-breadcrumb-enable-diagnostics nil) ;; Disable diagnostics in headerline.
|
|
(lsp-headerline-breadcrumb-icons-enable nil) ;; Disable icons in breadcrumb.
|
|
;; Semantic settings
|
|
(lsp-semantic-tokens-enable nil)
|
|
:config
|
|
(add-to-list 'lsp-file-watch-ignored-directories "[/\\\\]\\node_modules\\'"))
|
|
|
|
(use-package nix-ts-mode
|
|
:mode "\\.nix\\'")
|
|
|
|
(use-package eldoc-box
|
|
:defer t)
|
|
|
|
(use-package diff-hl
|
|
:defer t
|
|
:hook
|
|
(find-file . (lambda ()
|
|
(global-diff-hl-mode) ;; Enable Diff-HL mode for all files.
|
|
(diff-hl-flydiff-mode) ;; Automatically refresh diffs.
|
|
(diff-hl-margin-mode))) ;; Show diff indicators in the margin.
|
|
:custom
|
|
(diff-hl-side 'left))
|
|
|
|
(use-package magit
|
|
:config
|
|
(setopt magit-format-file-function #'magit-format-file-nerd-icons) ;; Turns on magit nerd-icons
|
|
:defer t)
|
|
|
|
(use-package evil
|
|
:defer t
|
|
:hook
|
|
(after-init . evil-mode)
|
|
:init
|
|
(setq evil-want-integration t) ;; Integrate `evil' with other Emacs features (optional as it's true by default).
|
|
(setq evil-want-keybinding nil) ;; Disable default keybinding to set custom ones.
|
|
(setq evil-want-C-u-scroll t) ;; Makes C-u scroll
|
|
(setq evil-want-C-u-delete t) ;; Makes C-u delete on insert mode
|
|
:config
|
|
(evil-set-undo-system 'undo-tree) ;; Uses the undo-tree package as the default undo system
|
|
(evil-set-leader 'normal (kbd "SPC"))
|
|
(evil-set-leader 'visual (kbd "SPC"))
|
|
(setq evil-want-fine-undo t))
|
|
|
|
|
|
(use-package evil-collection
|
|
:defer t
|
|
:custom
|
|
(evil-collection-want-find-usages-bindings t)
|
|
:hook
|
|
(evil-mode . evil-collection-init))
|
|
|
|
|
|
(use-package evil-surround
|
|
:after evil-collection
|
|
:config
|
|
(global-evil-surround-mode 1))
|
|
|
|
|
|
(use-package evil-matchit
|
|
:after evil-collection
|
|
:config
|
|
(global-evil-matchit-mode 1))
|
|
|
|
(use-package general
|
|
:after (evil evil-collection)
|
|
:init
|
|
(setq general-override-states '(insert
|
|
emacs
|
|
hybrid
|
|
normal
|
|
visual
|
|
motion
|
|
operator
|
|
replace))
|
|
:config
|
|
(general-evil-setup t)
|
|
(general-define-key
|
|
:states 'normal
|
|
"] d" '(flymake-goto-next-error :wk "Goto next error")
|
|
"[ d" '(flymake-goto-prev-error :wk "Goto prev error")
|
|
"] c" '(diff-hl-next-hunk :wk "Goto next hunk")
|
|
"[ c" '(diff-hl-previous-hunk :wk "Goto prev hunk")
|
|
"g r" '(lsp-find-references :wk "Goto references")
|
|
"K" '(eldoc-box-help-at-point :wk "Describe"))
|
|
|
|
(general-create-definer my-leader-def
|
|
:states '(normal insert visual motion emacs)
|
|
:keymaps 'override
|
|
:prefix "SPC"
|
|
:global-prefix "C-SPC")
|
|
|
|
(my-leader-def
|
|
"f" '(:ignore t :wk "Find")
|
|
"f c" '((lambda () (interactive) (find-file "~/.config/emacs/init.el")) :wk "Edit emacs config")
|
|
"f r" '(consult-recent-file :wk "Recent files")
|
|
"f f" '(consult-find :wk "Find Files")
|
|
"f g" '(consult-ripgrep :wk "Ripgrep search in files")
|
|
"f G" '(consult-git-grep :wk "Ripgrep search in files")
|
|
"f l" '(consult-line :wk "Find line")
|
|
"f i" '(consult-imenu :wk "Imenu buffer locations"))
|
|
|
|
(my-leader-def
|
|
"c" '(:ignore t :wk "Code")
|
|
"c a" '(lsp-execute-code-action :wk "Code actions"))
|
|
|
|
(my-leader-def
|
|
"h" '(:ignore t :wk "Help")
|
|
"h v" '(describe-variable :wk "Describe variable")
|
|
"h f" '(describe-function :wk "Describe function")
|
|
"h k" '(describe-key :wk "Describe key"))
|
|
|
|
(my-leader-def
|
|
"p" '(:ignore t :wk "Project")
|
|
"p b" '(consult-project-buffer :wk "Project buffers")
|
|
"p p" '(project-switch-project :wk "Project switch")
|
|
"p f" '(project-find-file :wk "Project find file")
|
|
"p g" '(project-find-regexp :wk "Project grep file")
|
|
"p k" '(project-kill-buffers :wk "Project kill buffers")
|
|
"p d" '(project-dired :wk "Project dired"))
|
|
|
|
(my-leader-def
|
|
"x" '(:ignore t :wk "Flymake")
|
|
"x x" '(consult-flymake :wk "Show diagnostics"))
|
|
|
|
(my-leader-def
|
|
"g" '(:ignore t :wk "Git")
|
|
"g g" '(magit-status :wk "Magit status")
|
|
"g l" '(magit-log-current :wk "Magit log"))
|
|
|
|
(my-leader-def
|
|
"r n" '(lsp-rename :wk "Rename"))
|
|
|
|
(my-leader-def
|
|
"u" '(undo-tree-visualize :wk "Undo-tree")))
|
|
|
|
(use-package undo-tree
|
|
:defer t
|
|
:hook
|
|
(after-init . global-undo-tree-mode)
|
|
:init
|
|
(setq undo-tree-visualizer-timestamps t
|
|
undo-tree-visualizer-diff t
|
|
undo-limit 800000 ;; Limit for undo entries.
|
|
undo-strong-limit 12000000 ;; Strong limit for undo entries.
|
|
undo-outer-limit 120000000) ;; Outer limit for undo entries.
|
|
:config
|
|
(setq undo-tree-history-directory-alist '(("." . "~/.config/emacs/.cache/undo"))))
|
|
|
|
(use-package dotenv-mode
|
|
:defer t)
|
|
|
|
(use-package doom-modeline
|
|
:defer t
|
|
:custom
|
|
(doom-modeline-buffer-file-name-style 'buffer-name) ;; Set the buffer file name style to just the buffer name (without path).
|
|
(doom-modeline-project-detection 'project) ;; Enable project detection for displaying the project name.
|
|
(doom-modeline-buffer-name t) ;; Show the buffer name in the mode line.
|
|
(doom-modeline-vcs-max-length 25) ;; Limit the version control system (VCS) branch name length to 25 characters.
|
|
:config
|
|
(setq doom-modeline-icon t) ;; Enable icons in the mode line if nerd fonts are used.
|
|
:hook
|
|
(after-init . doom-modeline-mode))
|
|
|
|
(use-package nerd-icons
|
|
:defer t)
|
|
|
|
(use-package nerd-icons-dired
|
|
:defer t ;; Load the package only when needed to improve startup time.
|
|
:hook
|
|
(dired-mode . nerd-icons-dired-mode))
|
|
|
|
(use-package nerd-icons-completion
|
|
:after (:all nerd-icons marginalia) ;; Load after `nerd-icons' and `marginalia' to ensure proper integration.
|
|
:config
|
|
(nerd-icons-completion-mode) ;; Activate nerd icons for completion interfaces.
|
|
(add-hook 'marginalia-mode-hook #'nerd-icons-completion-marginalia-setup)) ;; Setup icons in the marginalia mode for enhanced completion display.
|
|
|
|
(use-package exec-path-from-shell
|
|
:config
|
|
(exec-path-from-shell-initialize))
|
|
|
|
(use-package envrc
|
|
:init
|
|
(setq envrc-show-summary-in-minibuffer nil)
|
|
:hook
|
|
(after-init . envrc-global-mode))
|
|
|
|
(use-package modus-themes
|
|
:config
|
|
(load-theme 'modus-vivendi t))
|
|
|
|
(use-package org
|
|
:straight (:type built-in)
|
|
:defer t
|
|
:custom
|
|
(org-tags-column 0)
|
|
(org-return-follows-link t)
|
|
(org-hide-emphasis-markers t)
|
|
(org-log-into-drawer t)
|
|
(org-log-done 'time)
|
|
(org-todo-keywords
|
|
'((sequence "TODO(t)" "NEXT(n)" "PROG(p)" "WAIT(w)" "SOMEDAY(s)" "|" "DONE(d)" "CANCELLED(c)")))
|
|
(org-capture-templates
|
|
`(("i" "Inbox" entry (file+headline "todo.org" "Inbox")
|
|
"* TODO %?")
|
|
("j" "Journal" entry (file denote-journal-path-to-new-or-existing-entry)
|
|
"* %U %?\n%i\n%a"
|
|
:kill-buffer t
|
|
:empty-lines 1)
|
|
("@" "Inbox [email]" entry (file+headline "todo.org" "Inbox")
|
|
,(concat "* TODO Process \"%a\" %?\n"
|
|
"%U"))))
|
|
(org-refile-use-outline-path 'file)
|
|
(org-outline-path-complete-in-steps nil)
|
|
(org-refile-targets '((nil :maxlevel . 9)
|
|
(org-agenda-files :maxlevel . 9)))
|
|
(org-agenda-skip-scheduled-if-done t)
|
|
(org-agenda-skip-deadline-if-done t)
|
|
(org-agenda-include-deadlines t)
|
|
(org-agenda-include-diary t)
|
|
(org-agenda-block-separator nil)
|
|
(org-agenda-compact-blocks t)
|
|
(org-agenda-start-with-log-mode t)
|
|
:config
|
|
(setq org-directory "~/org")
|
|
(setq org-agenda-files (list "todo.org"))
|
|
:hook
|
|
(org-mode . org-indent-mode)
|
|
:init
|
|
(require 'org-tempo))
|
|
|
|
(use-package org-roam
|
|
:custom
|
|
(org-roam-directory "~/org")
|
|
:bind (("C-c n l" . org-roam-buffer-toggle)
|
|
("C-c n f" . org-roam-node-find)
|
|
("C-c n i" . org-roam-node-insert))
|
|
:config
|
|
(org-roam-setup))
|
|
|
|
(use-package mu4e
|
|
:config
|
|
(setq mu4e-get-mail-command (concat (executable-find "mbsync") " -a"))
|
|
(setq mu4e-update-interval 300)
|
|
(setq mu4e-change-filenames-when-moving t)
|
|
(setq mu4e-attachment-dir "~/Downloads")
|
|
|
|
;;smtp
|
|
(setq send-mail-function 'sendmail-send-it)
|
|
(setq sendmail-program (executable-find "msmtp"))
|
|
(setq message-sendmail-envelop-from 'header)
|
|
|
|
;; contexts
|
|
(setq mu4e-contexts
|
|
`(,(make-mu4e-context
|
|
:name "personal"
|
|
:enter-func
|
|
(lambda () (mu4e-message "Opening personal"))
|
|
:leave-func
|
|
(lambda () (mu4e-message "Closing personal"))
|
|
:match-func
|
|
(lambda (msg)
|
|
(when msg
|
|
(string-match-p "^/personal" (mu4e-message-field msg :maildir))))
|
|
:vars '((user-mail-address . "me@michaelthomson.dev" )
|
|
(user-full-name . "Michael Thomson")
|
|
(mu4e-drafts-folder . "/personal/Drafts")
|
|
(mu4e-refile-folder . "/personal/Archive")
|
|
(mu4e-sent-folder . "/personal/Sent")
|
|
(mu4e-trash-folder . "/personal/Trash"))))))
|