Update experimental emacs config

This commit is contained in:
Andrew Scott 2023-08-28 13:02:51 -04:00
parent e2e94bd302
commit 264a5bc37f
Signed by: a
GPG key ID: 7CD5A5977E4931C1
2 changed files with 274 additions and 157 deletions

View file

@ -46,7 +46,7 @@
native-comp-async-report-warnings-errors nil)) native-comp-async-report-warnings-errors nil))
;; Raise garbage collection threshold ;; Raise garbage collection threshold
(setq gc-cons-threshold 100000000 (setq gc-cons-threshold 500000000
gc-cons-percentage 0.1) gc-cons-percentage 0.1)
;; Don't advertise instructions for frame exit ;; Don't advertise instructions for frame exit
@ -67,7 +67,7 @@
(set-face-font 'fixed-pitch "Hack-24") (set-face-font 'fixed-pitch "Hack-24")
(set-face-font 'variable-pitch "DejaVu Sans-24") (set-face-font 'variable-pitch "DejaVu Sans-24")
;; Disable some GUI options ;; Some GUI options
(push '(tool-bar-lines . 0) default-frame-alist) (push '(tool-bar-lines . 0) default-frame-alist)
(push '(menu-bar-lines . 0) default-frame-alist) (push '(menu-bar-lines . 0) default-frame-alist)
(push '(vertical-scroll-bars) default-frame-alist) (push '(vertical-scroll-bars) default-frame-alist)
@ -77,15 +77,16 @@
(expand-file-name "emacs/" (or (getenv "XDG_DATA_HOME") "~/.local/share/"))) (expand-file-name "emacs/" (or (getenv "XDG_DATA_HOME") "~/.local/share/")))
;; Set cache directory ;; Set cache directory
(setq xdg-cache-home (expand-file-name "emacs/" (or (getenv "XDG_CACHE_HOME") "~/.cache/"))) (setq xdg_cache_home
(unless (file-directory-p xdg-cache-home) (expand-file-name "emacs/" (or (getenv "XDG_CACHE_HOME") "~/.cache/")))
(make-directory xdg-cache-home)) (unless (file-directory-p xdg_cache_home)
(make-directory xdg_cache_home))
;; Move eln-cache to XDG_CACHE_HOME ;; Move eln-cache to XDG_CACHE_HOME
(when (fboundp 'startup-redirect-eln-cache) (when (fboundp 'startup-redirect-eln-cache)
(if (< emacs-major-version 29) (if (< emacs-major-version 29)
(push (expand-file-name "eln-cache/" xdg-cache-home) native-comp-eln-load-path) (push (expand-file-name "eln-cache/" xdg_cache_home) native-comp-eln-load-path)
(startup-redirect-eln-cache (expand-file-name "eln-cache/" xdg-cache-home)))) (startup-redirect-eln-cache (expand-file-name "eln-cache/" xdg_cache_home))))
(provide 'early-init) (provide 'early-init)
;;; early-init.el ends here ;;; early-init.el ends here

View file

@ -32,7 +32,7 @@
;;; Code: ;;; Code:
;; Profile emacs startup ;; Profile emacs startup
(add-hook 'emacs-startup-hook (add-hook 'elpaca-after-init-hook
(lambda () (lambda ()
(message "Emacs loaded in %s with %d garbage collections." (message "Emacs loaded in %s with %d garbage collections."
(format "%.2f seconds" (format "%.2f seconds"
@ -88,43 +88,43 @@
;;; Built-in features ;;; Built-in features
(use-package emacs (use-package emacs
:elpaca nil :elpaca nil
:bind
(:map global-map
;; Disable suspend-frame shortcut
("C-z" . nil)
;; Escape behaves like C-g
("<escape>" . keyboard-escape-quit)
;; Resizing buffers
("S-C-<left>" . shrink-window-horizontally)
("S-C-<right>" . enlarge-window-horizontally)
("S-C-<down>" . shrink-window)
("S-C-<up>" . enlarge-window))
:init :init
;;; General Options ;;; General Options
;; Discard external customizations
(setq-default custom-file null-device)
;; Don't ask about running processes on exit
(setq confirm-kill-processes nil)
;; Better scrolling ;; Better scrolling
(setq scroll-step 1 (setq scroll-step 1
scroll-conservatively 1000 scroll-conservatively 1000
scroll-preserve-screen-position t scroll-preserve-screen-position t
mouse-wheel-follow-mouse 't mouse-wheel-follow-mouse t
mouse-wheel-progressive-speed nil mouse-wheel-progressive-speed nil
;; 1st #: lines to scroll, 2nd #: while holding shift ;; 1st #: lines to scroll, 2nd #: while holding shift
mouse-wheel-scroll-amount '(2 ((shift) .1))) mouse-wheel-scroll-amount '(2 ((shift) .1)))
(when (fboundp 'pixel-scroll-precision-mode) (when (fboundp 'pixel-scroll-precision-mode)
(pixel-scroll-precision-mode t)) (pixel-scroll-precision-mode t))
;; Cursor
(setq-default cursor-type 'bar
blink-cursor-delay 1.0)
;; Tabs ;; Tabs
(setq tab-always-indent 'complete) (setq tab-always-indent 'complete)
(setq-default tab-width 4 (setq-default tab-width 4
indent-tabs-mode nil) indent-tabs-mode nil)
;; Line/Column numbers ;; Column numbers
(setq column-number-mode t) (setq column-number-mode t)
(dolist (hook '(conf-mode-hook
prog-mode-hook
text-mode-hook))
(add-hook hook #'display-line-numbers-mode))
;; Disable suspend-frame shortcut
(global-set-key (kbd "<C-z>") nil)
;; Escape behaves like C-g
(global-set-key (kbd "<escape>") 'keyboard-escape-quit)
;; Prefer UTF-8 character coding ;; Prefer UTF-8 character coding
(prefer-coding-system 'utf-8) (prefer-coding-system 'utf-8)
@ -132,16 +132,6 @@
(set-terminal-coding-system 'utf-8) (set-terminal-coding-system 'utf-8)
(set-keyboard-coding-system 'utf-8) (set-keyboard-coding-system 'utf-8)
;; More reasonable keybinds for resizing windows
(global-set-key (kbd "S-C-<left>") 'shrink-window-horizontally)
(global-set-key (kbd "S-C-<right>") 'enlarge-window-horizontally)
(global-set-key (kbd "S-C-<down>") 'shrink-window)
(global-set-key (kbd "S-C-<up>") 'enlarge-window)
;; Built-in C settings
(setq-default c-basic-offset 2
c-default-style "k&r")
;;; Vertico ;;; Vertico
;; Add prompt to `completing-read-multiple' ;; Add prompt to `completing-read-multiple'
(defun crm-indicator (args) (defun crm-indicator (args)
@ -161,74 +151,107 @@
'(read-only t cursor-intangible t face minibuffer-prompt)) '(read-only t cursor-intangible t face minibuffer-prompt))
(add-hook 'minibuffer-setup-hook #'cursor-intangible-mode)) (add-hook 'minibuffer-setup-hook #'cursor-intangible-mode))
(use-package compile
:elpaca nil
:commands (compile recompile)
:custom (compilation-scroll-output t))
(use-package cus-edit
:elpaca nil
:init (setq-default custom-file null-device))
(use-package display-fill-column-indicator (use-package display-fill-column-indicator
:elpaca nil :elpaca nil
:hook ((conf-mode markdown-mode prog-mode) . display-fill-column-indicator-mode) :hook ((conf-mode
markdown-mode
lsp-mode) . display-fill-column-indicator-mode)
:config (setq-default fill-column 80)) :config (setq-default fill-column 80))
(use-package display-line-numbers
:elpaca nil
:hook ((conf-mode lsp-mode) . display-line-numbers-mode))
(use-package elec-pair (use-package elec-pair
:elpaca nil :elpaca nil
:defer 3
:config (electric-pair-mode)) :config (electric-pair-mode))
;; Move auto saves to XDG_CACHE_HOME
(use-package files (use-package files
:elpaca nil :elpaca nil
:init :init
(let ((auto-save-directory (concat xdg-cache-home "auto-save-list/"))) (let ((auto_save_directory (concat xdg_cache_home "auto-save-list/")))
(setq backup-directory-alist `(".*" . ,auto-save-directory) (setq backup-directory-alist `((".*" . ,auto_save_directory))
auto-save-file-name-transforms `(".*" ,auto-save-directory t))) auto-save-file-name-transforms `((".*" ,auto_save_directory t))))
:config :custom
(setq delete-old-versions t (backup-by-copying t)
kept-new-versions 5 (confirm-kill-processes nil)
kept-old-versions 3 (delete-old-versions t)
require-final-newline t (kept-new-versions 5)
version-control t)) (kept-old-versions 3)
(require-final-newline t)
(version-control t))
(use-package flyspell
:elpaca nil
:defer 3
:hook
(((git-commit-mode markdown-mode) . flyspell-mode)
(lsp-mode . flyspell-prog-mode)))
(use-package paren (use-package paren
:elpaca nil :elpaca nil
:defer 3
:config (show-paren-mode)) :config (show-paren-mode))
(use-package recentf (use-package recentf
:elpaca nil :elpaca nil
:init (setq recentf-save-file (expand-file-name "recentf" xdg-cache-home)) :init (setq recentf-save-file (concat xdg_cache_home "recentf"))
:config :config
(setq recentf-auto-cleanup 'never (recentf-mode)
recentf-max-menu-items 15 :custom
recentf-max-saved-items 100) (recentf-auto-cleanup 'never)
(recentf-mode)) (recentf-max-menu-items 15)
(recentf-max-saved-items 100))
(use-package savehist (use-package savehist
:elpaca nil :elpaca nil
:init (setq savehist-file (concat xdg-cache-home "history")) :defer 3
:init (setq savehist-file (concat xdg_cache_home "history"))
:config :config
(setq savehist-autosave-interval 60 (savehist-mode)
savehist-additional-variables '(search-ring regexp-search-ring)) :custom
(savehist-mode)) (savehist-autosave-interval 60)
(savehist-additional-variables '(search-ring regexp-search-ring)))
(use-package saveplace (use-package saveplace
:elpaca nil :elpaca nil
:init (setq save-place-file (concat xdg-cache-home "places")) :defer 1
:init (setq save-place-file (concat xdg_cache_home "places"))
:config (save-place-mode)) :config (save-place-mode))
(use-package whitespace (use-package whitespace
:elpaca nil :elpaca nil
:init :hook
(dolist (hook '(conf-mode-hook ((conf-mode
prog-mode-hook prog-mode
text-mode-hook)) text-mode) . whitespace-mode)
(add-hook hook #'whitespace-mode))
(add-hook 'before-save-hook #'whitespace-cleanup)
:config :config
(setq whitespace-line-column 100 (add-hook 'before-save-hook #'whitespace-cleanup)
whitespace-style '(big-indent :custom
(whitespace-line-column 100)
(whitespace-style '(big-indent
face face
lines-tail lines-tail
missing-newline-at-eof missing-newline-at-eof
tabs tabs
trailing))) trailing)))
(elpaca-wait)
;;; Packages ;;; Packages
;; Benchmark Emacs startup
(use-package esup
:defer t
:config (setq esup-depth 0))
;; Theme ;; Theme
(use-package everforest (use-package everforest
:elpaca (everforest :elpaca (everforest
@ -237,6 +260,7 @@
:config :config
(setq custom-safe-themes t) (setq custom-safe-themes t)
(load-theme 'everforest-hard-dark t) (load-theme 'everforest-hard-dark t)
(set-face-attribute 'cursor nil :background "#7fbbb3")
(let ((line (face-attribute 'mode-line :foreground)) (let ((line (face-attribute 'mode-line :foreground))
(inactive (face-attribute 'mode-line-inactive :background))) (inactive (face-attribute 'mode-line-inactive :background)))
(set-face-attribute 'mode-line nil :overline line) (set-face-attribute 'mode-line nil :overline line)
@ -246,50 +270,57 @@
(set-face-attribute 'mode-line-inactive nil :box nil) (set-face-attribute 'mode-line-inactive nil :box nil)
(set-face-attribute 'mode-line-inactive nil :background inactive))) (set-face-attribute 'mode-line-inactive nil :background inactive)))
(elpaca-wait)
;; Mode line ;; Mode line
(use-package minions
:defer 1
:config (minions-mode))
(use-package keycast
:defer t
:config
(setq keycast-mode-line-insert-after 'moody-mode-line-buffer-identification))
(use-package moody (use-package moody
:defer 1 :defer 1
:config :custom
(setq x-underline-at-descent-line t) (x-underline-at-descent-line t)
(moody-replace-eldoc-minibuffer-message-function) (moody-replace-eldoc-minibuffer-message-function)
(moody-replace-mode-line-buffer-identification) (moody-replace-mode-line-buffer-identification)
(moody-replace-mode-line-front-space) (moody-replace-mode-line-front-space)
(moody-replace-vc-mode)) (moody-replace-vc-mode))
(use-package minions
:after (moody)
:config (minions-mode))
(use-package keycast
:defer t
:custom
(keycast-mode-line-insert-after 'moody-mode-line-buffer-identification))
;; Show keybind hints ;; Show keybind hints
(use-package which-key (use-package which-key
:defer 1 :defer 3
:config :config
(setq which-key-idle-delay 0.3) (which-key-mode)
(which-key-mode)) :custom
(which-key-idle-delay 0.3))
;; Flyspell corrections
(use-package flyspell-correct
:after (flyspell)
:bind (:map flyspell-mode-map ("C-M-." . flyspell-correct-wrapper)))
;; Better annotations ;; Better annotations
(use-package marginalia (use-package marginalia
:defer 1 :defer 3
:bind (:map minibuffer-local-map :bind (:map minibuffer-local-map ("M-A" . marginalia-cycle))
("M-A" . marginalia-cycle))
:config (marginalia-mode)) :config (marginalia-mode))
;; Better undo/redo ;; Better undo/redo
(use-package undo-tree (use-package undo-tree
:defer 3 :defer 3
:config :init (setq undo-tree-history-directory-alist
(setq undo-tree-auto-save-history t `((".*" . ,(concat xdg_cache_home "undo-tree/"))))
undo-tree-history-directory-alist :config (global-undo-tree-mode)
`((".*" . ,(concat xdg-cache-home "undo-tree/")))) :custom (undo-tree-auto-save-history t))
(global-undo-tree-mode))
;; Completion style ;; Completion style
(use-package orderless (use-package orderless
:defer 1
:custom :custom
(completion-styles '(orderless basic)) (completion-styles '(orderless basic))
(completion-category-overrides '((file (styles basic partial-completion))))) (completion-category-overrides '((file (styles basic partial-completion)))))
@ -297,14 +328,14 @@
;; Completion UI ;; Completion UI
(use-package vertico (use-package vertico
:init (vertico-mode) :init (vertico-mode)
:config :custom
(setq vertico-cycle t (vertico-cycle t)
vertico-count 10 (vertico-count 10)
vertico-resize t (vertico-resize t)
vertico-scroll-margin 1 (vertico-scroll-margin 1)
completion-ignore-case t (completion-ignore-case t)
read-buffer-completion-ignore-case t (read-buffer-completion-ignore-case t)
read-file-name-completion-ignore-case t)) (read-file-name-completion-ignore-case t))
;; Command menu for items around point ;; Command menu for items around point
(use-package embark (use-package embark
@ -396,29 +427,29 @@
;; Consult-specific Embark actions ;; Consult-specific Embark actions
(use-package embark-consult (use-package embark-consult
:defer 3 :after (embark consult)
:hook (embark-collect-mode . consult-preview-at-point-mode)) :hook (embark-collect-mode . consult-preview-at-point-mode))
;; In-buffer completion ;; In-buffer completion
(use-package corfu (use-package corfu
:defer 3 :defer 3
:elpaca (corfu :files (:defaults "extensions/*")) :elpaca (corfu :files (:defaults "extensions/*"))
:init :bind (:map corfu-map ("M-SPC" . corfu-insert-separator))
:config
(setq corfu-min-width 60
corfu-max-width corfu-min-width
corfu-auto t
corfu-auto-delay 0.3
corfu-cycle t
corfu-popupinfo-delay 0.6
corfu-separator ?\s)
(global-corfu-mode) (global-corfu-mode)
(corfu-popupinfo-mode) (corfu-popupinfo-mode))
:custom
(corfu-min-width 60)
(corfu-max-width corfu-min-width)
(corfu-auto t)
(corfu-auto-delay 0.3)
(corfu-cycle t)
(corfu-popupinfo-delay 0.6)
(corfu-separator ?\s)
:bind (:map corfu-map ("M-SPC" . corfu-insert-separator)))
(use-package kind-icon (use-package kind-icon
:after corfu :after (corfu)
:init (setq svg-lib-icons-dir (concat xdg-cache-home "svg-lib/")) :init (setq svg-lib-icons-dir (concat xdg_cache_home "svg-lib/"))
:config :config
(setq kind-icon-default-face 'corfu-default (setq kind-icon-default-face 'corfu-default
kind-icon-blend-background nil) kind-icon-blend-background nil)
@ -426,22 +457,17 @@
;; Git ;; Git
(use-package magit (use-package magit
:init :init (setq transient-history-file (concat xdg_cache_home "transient-history"))
(setq transient-history-file (concat xdg-cache-home "transient-history")) :custom (magit-display-buffer-function #'magit-display-buffer-same-window-except-diff-v1)
:bind ("C-M-;" . magit-status) :bind ("C-M-;" . magit-status))
:commands (magit-status
magit-get-current-branch)
:custom
(magit-display-buffer-function #'magit-display-buffer-same-window-except-diff-v1))
(use-package git-timemachine (use-package git-timemachine
:bind ("C-M-'" . git-timemachine)) :bind ("C-M-'" . git-timemachine))
;; Project Managment ;; Project Management
(use-package projectile (use-package projectile
:defer 1 :defer 1
:init :init (setq projectile-known-projects-file (concat xdg_cache_home "projectile-bookmarks"))
(setq projectile-known-projects-file (concat xdg-cache-home "projectile-bookmarks"))
:bind ("C-c p" . projectile-command-map) :bind ("C-c p" . projectile-command-map)
:config :config
(push "*node_modules" projectile-globally-ignored-directories) (push "*node_modules" projectile-globally-ignored-directories)
@ -449,7 +475,7 @@
(use-package treemacs (use-package treemacs
:defer 1 :defer 1
:init (setq treemacs-persist-file (concat xdg-cache-home "treemacs-persist")) :init (setq treemacs-persist-file (concat xdg_cache_home "treemacs-persist"))
:bind :bind
(:map global-map (:map global-map
("M-0" . treemacs-select-window) ("M-0" . treemacs-select-window)
@ -463,24 +489,61 @@
(treemacs-filewatch-mode) (treemacs-filewatch-mode)
(treemacs-git-commit-diff-mode)) (treemacs-git-commit-diff-mode))
(use-package consult-projectile) (use-package consult-projectile
:after (consult projectile))
(use-package treemacs-magit) (use-package treemacs-magit
:after (treemacs magit))
(use-package treemacs-projectile) (use-package treemacs-projectile
:after (treemacs projectile))
;;; Language support ;;; Language support
;; Auto-format ;; Auto-format
(use-package apheleia (use-package apheleia
:defer 5 :defer 3
:config (apheleia-global-mode)) :config (apheleia-global-mode))
(use-package reformatter ; required for zig fmt (use-package reformatter ; required for zig fmt
:after zig-mode) :after (zig-mode))
;; Templates
(use-package tempel
:init
;; Completion at point
(defun tempel-setup-capf ()
(setq-local completion-at-point-functions
(cons #'tempel-expand ; or `tempel-complete' w/ `tempel-trigger-prexfix'
completion-at-point-functions)))
;; :custom (tempel-trigger-prefix "<")
:bind
(("M-+" . tempel-complete) ; or `tempel-expand'
("M-*" . tempel-insert))
:hook
((conf-mode
lsp-mode
text-mode) . tempel-setup-capf))
(use-package tempel-collection
:after (tempel))
(use-package yasnippet
:bind
("C-c y s" . yas-insert-snippet)
("C-c y v" . yas-visit-snippet-file)
:config (yas-reload-all)
:hook (lsp-mode . yas-minor-mode))
(use-package yasnippet-snippets
:after (yasnippet))
(use-package consult-yasnippet
:after (yasnippet consult))
;; Visualize color names ;; Visualize color names
(use-package rainbow-mode (use-package rainbow-mode
:hook ((conf-mode prog-mode) . rainbow-mode)) :commands (rainbow-mode)
:hook ((conf-mode lsp-mode) . rainbow-mode))
;; Syntax parsing/highlighting ;; Syntax parsing/highlighting
(use-package treesit-auto (use-package treesit-auto
@ -492,18 +555,23 @@
;; Syntax checking ;; Syntax checking
(use-package flycheck (use-package flycheck
:hook (lsp-mode . flycheck-mode) :hook (lsp-mode . flycheck-mode)
:config (setq flycheck-python-flake8-executable "flake8")) :config (setq flycheck-python-flake8-executable 'flake8))
(use-package consult-flycheck) (use-package consult-flycheck
:after (consult flycheck))
;; LSP ;; LSP
(use-package lsp-mode (use-package lsp-mode
:commands lsp lsp-deferred
:hook :hook
(((c-mode c++-mode python-mode zig-mode) . lsp) (((c-ts-mode
c++-ts-mode
go-ts-mode
python-ts-mode
zig-mode) . lsp)
(lsp-mode . lsp-enable-which-key-integration)) (lsp-mode . lsp-enable-which-key-integration))
:config :config
(setq lsp-idle-delay 0.6 (setq lsp-session-file (concat xdg_cache_home "lsp-session")
lsp-idle-delay 0.6
lsp-prefer-flymake nil)) lsp-prefer-flymake nil))
(use-package lsp-ui (use-package lsp-ui
@ -519,32 +587,36 @@
lsp-ui-peek-enable t)) lsp-ui-peek-enable t))
(use-package consult-lsp (use-package consult-lsp
:after (consult lsp-mode)
:bind :bind
(:map lsp-mode-map (:map lsp-mode-map
([remap xref-find-apropos] . consult-lsp-symbols))) ([remap xref-find-apropos] . consult-lsp-symbols)))
(use-package lsp-treemacs) (use-package lsp-treemacs
:after (lsp-mode treemacs))
;; Debugging ;; Debugging
(use-package dap-mode (use-package dap-mode
:after lsp-mode :after (lsp-mode)
:bind :bind
(:map dap-mode-map (:map dap-mode-map
("<f5>" . dap-debug) ("<f5>" . dap-debug)
("<f10>" . dap-next) ("<f10>" . dap-next)
("<f11>" . dap-step-in) ("<f11>" . dap-step-in)
("S-<f5>" . dap-disconnect) ("S-<f5>" . dap-disconnect)
("C-S-<f5>" . dap-debug-restart)) ("C-S-<f5>" . dap-debug-restart)
("C-c d" . dap-debug-last))
:config :config
(setq dap-auto-configure-features '(sessions locals tooltip) (setq dap-breakpoints-file (concat xdg_cache_home "dap-breakpoints")
dap-lldb-debug-program "/usr/bin/lldb-vscode" dap-utils-extension-path (concat user-emacs-directory "dap-extensions/")
dap-auto-configure-features '(sessions locals tooltip)
dap-lldb-debug-program 'lldb-vscode
dap-python-debugger 'debugpy) dap-python-debugger 'debugpy)
(eval-when-compile (eval-when-compile
(require 'cl-lib)) (require 'cl-lib))
(require 'dap-python) (require 'dap-python)
(require 'dap-lldb) (require 'dap-lldb)
(require 'dap-gdb-lldb) (require 'dap-gdb-lldb)
(dap-gdb-lldb-setup)
;; Templates ;; Templates
(dap-register-debug-template (dap-register-debug-template
"Rust :: LLDB Run Configuration" "Rust :: LLDB Run Configuration"
@ -553,28 +625,72 @@
:name "LLDB::Run" :name "LLDB::Run"
:gdbpath "rust-lldb"))) :gdbpath "rust-lldb")))
(use-package realgud) (use-package realgud
:defer t)
(use-package realgud-lldb) (use-package realgud-lldb
:defer t)
;; Go
(use-package go-mode
:hook (go-ts-mode . go-mode)
:config (add-hook 'before-save-hook #'lsp-organize-imports))
;; JavaScript
(use-package js2-mode
:interpreter (("nodejs" . js2-mode) ("node" . js2-mode))
:hook (js-ts-mode . js2-minor-mode)
:config
(setq js-indent-level 2
js2-mode-show-strict-warnings t))
;; Python
(use-package lsp-pyright
:after (python)
:hook (python-ts-mode . (lambda ()
(require 'lsp-pyright)
(lsp)))) ; or `lsp-deferred'
(use-package numpydoc
:after (python)
:bind (:map python-mode-map
("C-c C-n" . numpydoc-generate))
:config (setq numpydoc-insert-examples-block nil))
(use-package conda
:after (python)
:init
(setq conda-anaconda-home (expand-file-name "/opt/miniconda3")
conda-env-home-directory (expand-file-name "~/.conda/envs"))
(conda-env-initialize-interactive-shells)
;; (conda-env-autoactivate-mode)
:hook
('find-file-hook . (lambda ()
(when (bound-and-true-p conda-project-env-path)
(conda-env-activate-for-buffer)))))
;; Web templates
(use-package web-mode
:config
(setq web-mode-code-indent-offset 2
web-mode-enable-front-matter-block t
web-mode-markup-indent-offset 2
web-mode-attribute-indent-offset 2)
:mode
(("\\.astro\\'" . web-mode)
("\\.html?\\'" . web-mode)))
;; Zig ;; Zig
(use-package zig-mode (use-package zig-mode
:init
(push '(zig-mode . "zig") lsp-language-id-configuration)
(lsp-register-client
(make-lsp-client
:new-connection (lsp-stdio-connection "/usr/bin/zls")
:major-modes '(zig-mode)
:server-id 'zls))
:hook :hook
(zig-mode . (lambda () (zig-mode . (lambda ()
(setq-local fill-column 100) (setq-local fill-column 100)
(setq-local tab-width 4)))) (setq-local tab-width 4))))
;;; File format/markup support ;;; File format/markup support
(use-package markdown-mode) (use-package markdown-mode
:commands (markdown-mode))
(use-package toml-mode) (use-package yaml-pro
:hook (yaml-ts-mode . yaml-pro-ts-mode))
(use-package yaml-pro)
;;; init.el ends here ;;; init.el ends here