2023-03-05 12:03:36 -05:00
;;; $DOOMDIR/config.el -*- lexical-binding: t; -*-
;; Place your private configuration here! Remember, you do not need to run 'doom
;; sync' after modifying this file!
;; Some functionality uses this to identify you, e.g. GPG configuration, email
;; clients, file temp+bindingslates and snippets. It is optional.
( setq user-full-name " Matt Nish-Lapidus "
user-mail-address " matt@emenel.ca " )
;; See 'C-h v doom-font' for documentation and more examples of what they
;; accept. For example:
( setq doom-font ( font-spec :family " JetBrains Mono " :size 14 ) )
2023-03-11 11:01:07 -05:00
( setq fancy-splash-image ( concat doom-user-dir " splash.png " ) )
2023-03-05 12:03:36 -05:00
( setq doom-theme 'doom-monokai-pro )
;; This determines the style of line numbers in effect. If set to `nil', line
;; numbers are disabled. For relative line numbers, set this to `relative'.
( setq display-line-numbers-type t )
( setq scroll-preserve-screen-position t )
2023-08-31 13:46:13 -04:00
( setq global-hl-line-modes nil )
2023-03-05 12:03:36 -05:00
2023-10-19 11:23:45 -04:00
( setq locale-coding-system 'utf-8 )
( set-terminal-coding-system 'utf-8 )
( set-keyboard-coding-system 'utf-8 )
( prefer-coding-system 'utf-8 )
2024-03-25 14:18:11 -04:00
( setq org-directory " ~/Library/Mobile Documents/iCloud~md~obsidian/Documents/Primary " )
2023-03-11 11:01:07 -05:00
2024-06-09 10:27:11 -04:00
( setq treesit-extra-load-path ' ( " ~/Source/_src/tree-sitter-module/dist/ " ) )
2024-06-06 15:42:40 -04:00
2023-03-05 12:03:36 -05:00
;; Modeline
;; - add current workspace name
;; - add major mode icon
( after! doom-modeline
( setq doom-modeline-persp-name t
2023-09-20 09:32:32 -04:00
doom-modeline-major-mode-icon t )
( setq doom-modeline-total-line-number t ) )
2023-10-28 12:20:30 -04:00
( defun +default/insert-snippet ( )
( interactive )
( cond ( ( modulep! :completion vertico )
( call-interactively #' consult-yasnippet ) )
( t ( call-interactively #' yas-insert-snippet ) ) ) )
2023-03-05 12:03:36 -05:00
2023-04-04 17:38:52 -04:00
;; set default frame size on launch
2024-04-18 14:24:42 -04:00
( setq default-frame-alist ' ( ( left . 0 ) ( top . 0 ) ( height . 48 ) ( width . 160 ) ) )
2023-04-04 17:38:52 -04:00
2023-06-02 12:04:53 -04:00
( defun mnl/frame-center ( )
" Center the current frame. "
( interactive )
( let* ( ( dw ( display-pixel-width ) )
( dh ( display-pixel-height ) )
( f ( selected-frame ) )
( fw ( frame-pixel-width f ) )
( fh ( frame-pixel-height f ) )
( x ( - ( / dw 2 ) ( / fw 2 ) ) )
( y ( - ( / dh 2 ) ( / fh 2 ) ) ) )
( message ( format " dw %d dh %d fw %d fh %d x %d y %d " dw dh fw fh x y ) )
( set-frame-position f x y ) ) )
2023-03-05 12:03:36 -05:00
2023-03-07 14:46:47 -05:00
;; some global settings
2024-04-18 14:24:42 -04:00
( setq tab-always-indent t ) ; don't autocomplete with tab
( +global-word-wrap-mode +1 ) ; default to soft word wrap
( delete-selection-mode 1 ) ; delete stuff!
( setq delete-active-region t ) ; delete selected stuff!
2024-03-25 14:18:11 -04:00
( setq shell-file-name ( executable-find " bash " ) )
2024-04-18 14:24:42 -04:00
( after! vterm
( setq-default vterm-shell ( executable-find " fish " ) )
( setq-default explicit-shell-file-name ( executable-find " fish " ) )
2024-05-13 14:52:42 -04:00
( setq vterm-kill-buffer-on-exit t )
( after! meow
2024-06-03 10:11:08 -04:00
( meow-vterm-enable ) ) )
2023-03-05 12:03:36 -05:00
2023-03-07 14:46:47 -05:00
;; remove org agenda from the splash screen
( assoc-delete-all " Open org-agenda " +doom-dashboard-menu-sections )
2023-03-05 12:03:36 -05:00
2023-03-12 14:31:23 -04:00
;; reduce which-key waiting
( after! which-key
( setq which-key-idle-delay 0.3 ) )
2023-04-04 17:38:52 -04:00
;; some defaults for cursor size, scrolling, and buffer handling
2023-03-13 10:25:02 -04:00
( setq x-stretch-cursor t
kill-buffer-delete-auto-save-files t
scroll-conservatively 0 )
2023-03-07 14:46:47 -05:00
;; nicer resizing
2023-03-05 12:03:36 -05:00
( cond
( ( string-equal system-type " darwin " )
( setq frame-resize-pixelwise t
window-resize-pixelwise t ) ) )
2023-03-07 14:46:47 -05:00
;; tabs! i like them
2024-03-25 14:18:11 -04:00
;; (setq-default indent-tabs-mode t)
2023-03-05 12:03:36 -05:00
( setq-default tab-width 2 )
2023-03-07 14:46:47 -05:00
;; import all my customized keybindings based on doom evil mode, but without evil.
( load! " bindings.el " )
2023-06-02 12:04:53 -04:00
( after! treemacs
( setq treemacs-follow-mode t )
( setq treemacs-project-follow-mode t ) )
2023-03-05 12:03:36 -05:00
2023-10-28 11:18:59 -04:00
( after! anzu
( global-anzu-mode ) )
2024-06-05 14:14:43 -04:00
( global-so-long-mode 1 )
2024-04-06 13:20:25 -04:00
( after! parinfer-rust-mode
( setq parinfer-rust-auto-download t )
( setq parinfer-rust-preferred-mode " smart " ) )
2023-08-31 13:46:13 -04:00
( setq dap-ui-variable-length 200 )
2023-03-07 14:46:47 -05:00
;; smart tabs set modes
2023-03-05 12:03:36 -05:00
( after! smart-tabs-mode
( smart-tabs-insinuate 'c 'javascript 'python ) )
2023-11-05 14:34:18 -05:00
;; Add consult-line searches to isearch history (both regular and regex) -- can now use meow 'n' to continue search as well as isearch
2023-10-28 11:50:40 -04:00
( advice-add #' consult-line :after
( lambda ( &rest _ )
( when consult--line-history
( add-to-history
'regexp-search-ring
( car consult--line-history )
regexp-search-ring-max )
( add-to-history
'search-ring
( car consult--line-history )
search-ring-max ) ) ) )
2023-03-07 14:46:47 -05:00
;; bibliography file location
2023-03-12 11:49:11 -04:00
( after! citar
( setq! citar-bibliography ' ( " /Users/emenel/Zotero/lib.bib " ) )
( setq! citar-notes-paths ' ( " /Users/emenel/Library/Mobile Documents/iCloud~md~obsidian/Documents/Primary/Sources " ) )
( setq! citar-file-note-extensions ' ( " md " ) ) )
2023-03-07 14:46:47 -05:00
2023-03-05 12:03:36 -05:00
;; svelte support
( add-to-list 'auto-mode-alist ' ( " \\ .svelte \\ ' " . web-mode ) )
2023-11-05 14:34:18 -05:00
( add-to-list 'auto-mode-alist ' ( " \\ .css \\ ' " . web-mode ) )
2023-03-05 12:03:36 -05:00
( setq web-mode-engines-alist
' ( ( " svelte " . " \\ .svelte \\ ' " ) ) )
2023-11-05 14:34:18 -05:00
;; web-mode settings
2023-10-19 11:23:45 -04:00
( add-hook! web-mode ( web-mode-toggle-current-element-highlight ) )
2023-11-05 14:34:18 -05:00
( after! web-mode
( setq web-mode-markup-indent-offset 2 )
( setq web-mode-css-indent-offset 2 )
( setq web-mode-code-indent-offset 2 ) )
( after! markdown-mode
( setq markdown-list-indent-width 2 )
( setq markdown-enable-wiki-links t ) )
2023-03-05 12:03:36 -05:00
2023-03-07 14:46:47 -05:00
;; fix centaur tabs to show at the right times and add my muscle memory keybind
2023-03-05 12:03:36 -05:00
( after! centaur-tabs
( setq centaur-tabs-set-bar 'right )
( setq centaur-tabs-cycle-scope 'tabs )
( map! :map centaur-tabs-mode-map
2024-04-18 14:24:42 -04:00
" s-M-<right> " 'centaur-tabs-forward
" s-M-<left> " 'centaur-tabs-backward ) )
2023-03-05 12:03:36 -05:00
2023-03-07 14:46:47 -05:00
;; use kitty for terminal-here
2024-03-25 14:18:11 -04:00
( setq terminal-here-mac-terminal-command ' ( " kitty " " @ " " launch " " --type=tab " ) )
2023-03-05 12:03:36 -05:00
2023-03-07 14:46:47 -05:00
;; set project paths and ignore buffers
2023-03-05 12:03:36 -05:00
( setq projectile-project-search-path ' ( ( " ~/Source " . 2 ) ) )
( setq projectile-globally-ignored-buffers
' ( " *scratch* "
2024-04-18 14:24:42 -04:00
" *lsp-log* " ) )
2023-03-05 12:03:36 -05:00
;; ignoring buffers by their major mode
( setq projectile-globally-ignored-modes
' ( " erc-mode "
2024-04-18 14:24:42 -04:00
" help-mode "
" completion-list-mode "
" Buffer-menu-mode "
" gnus-.*-mode "
" occur-mode " ) )
2023-03-05 12:03:36 -05:00
2023-03-07 14:46:47 -05:00
;; mouse support for vertico buffers
2023-03-05 12:03:36 -05:00
( after! vertico
( vertico-mouse-mode ) )
2024-04-06 13:20:25 -04:00
;; sly
2023-03-05 12:03:36 -05:00
( after! sly
2023-03-20 10:40:35 -04:00
( setq sly-lisp-implementations
2024-03-25 14:18:11 -04:00
' ( ( sbcl ( " sbcl " " --dynamic-space-size " " 12000 " ) )
2024-04-18 14:24:42 -04:00
( ciel ( " sbcl " " --core " " /Users/emenel/quicklisp/local-projects/CIEL/ciel-core " " --eval " " (in-package :ciel-user) " " --dynamic-space-size " " 2600 " ) ) ) )
2023-03-29 08:58:08 -04:00
( setq sly-default-lisp 'sbcl )
2023-03-05 12:03:36 -05:00
( setq sly-complete-symbol-function 'sly-flex-completions ) )
2023-03-07 14:46:47 -05:00
;; make esc close completion from corfu
2023-03-05 12:03:36 -05:00
( map! :map corfu-map [ escape ] 'corfu-quit )
;; cl-collider cl-patterns emacs helpers TODO: test this
( after! lisp-mode
( defun cl-patterns-helpers-load ( )
( interactive )
( sly-eval-async ' ( cl:namestring ( asdf:system-source-directory ( asdf:find-system 'cl-patterns ) ) )
2024-03-25 14:18:11 -04:00
( lambda ( path )
( load ( concat path " res/emacs/cl-patterns-helpers " ) nil nil nil t )
( load ( concat path " res/emacs/cl-patterns-skeletons " ) nil nil nil t ) ) )
2023-11-05 14:34:18 -05:00
( define-key sly-mode-map ( kbd " C-c p " ) 'cl-patterns-play-or-end-context-or-select-pdef )
( define-key sly-mode-map ( kbd " C-c P " ) 'cl-patterns-play-or-stop-context-or-select-pdef )
( define-key sly-mode-map ( kbd " C-c s " ) 'cl-patterns-stop-all )
( define-key sly-doc-map ( kbd " s " ) 'cl-patterns-supercollider-documentation )
( add-hook! 'sly-connected-hook 'cl-patterns-helpers-load ) ) )
( set-popup-rule! " *sly-description* " :side 'right :size '0.52 )
2023-03-05 12:03:36 -05:00
2024-05-13 14:52:42 -04:00
( use-package! ajrepl
:after janet-mode
:config
( add-hook 'a-janet-mode-hook
#' ajrepl-interaction-mode ) )
( after! lsp-mode
2024-06-03 10:11:08 -04:00
( setq lsp-signature-render-documentation nil )
2024-05-13 14:52:42 -04:00
( add-to-list 'lsp-language-id-configuration ' ( a-janet-mode . " janet " ) )
( lsp-register-client ( make-lsp-client :new-connection ( lsp-stdio-connection " janet-lsp " )
:activation-fn ( lsp-activate-on " janet " )
:server-id 'janet-ls ) ) )
( after! lisp-markup
( add-hook! 'lisp-mode 'lisp-markup-minor-mode ) )
( add-to-list 'auto-mode-alist ' ( " \\ .lsx \\ ' " . lisp-mode ) )
2023-10-19 11:23:45 -04:00
;; adding supercollider path
( setq exec-path ( append exec-path ' ( " /Applications/SuperCollider.app/Contents/MacOS/ " ) ) )
2023-03-07 14:46:47 -05:00
;; tidal cycles!
2024-03-25 14:18:11 -04:00
;; (setq tidal-boot-script-path "~/.cabal/share/aarch64-osx-ghc-9.4.2/tidal-1.9.3/BootTidal.hs")
2023-03-05 12:03:36 -05:00
2023-10-19 11:23:45 -04:00
;; add platformio to ino files
( add-to-list 'auto-mode-alist ' ( " \\ .ino \\ ' " . arduino-mode ) )
( add-to-list 'auto-mode-alist ' ( " \\ .ino \\ ' " . platformio-mode ) )
2023-11-25 16:09:22 -05:00
( after! gcode-mode
( add-hook! 'gcode-mode-hook 'eldoc-mode ) )
2023-06-02 12:04:53 -04:00
2023-03-11 11:01:07 -05:00
( load! " obsidian-config.el " )
2023-06-02 12:04:53 -04:00
( add-hook 'window-setup-hook #' mnl/frame-center )
2023-08-31 13:46:13 -04:00
( custom-set-faces!
' ( line-number :foreground " #424242 " ) )
2024-03-25 14:18:11 -04:00
;; mu4e
( set-email-account! " matt@emenel.ca "
' ( ( mu4e-sent-folder . " /matt@emenel.ca/Sent " )
( mu4e-drafts-folder . " /matt@emenel.ca/Drafts " )
( mu4e-trash-folder . " /matt@emenel.ca/Trash " )
( mu4e-refile-folder . " /matt@emenel.ca/Archive " )
( mu4e-spam-folder . " /matt@emenel.ca/Spam " )
( smtpmail-smtp-user . " matt@emenel.ca " )
2024-06-21 08:31:36 -04:00
( user-mail-address . " matt@emenel.ca " ) ;; only needed for mu < 1.4
( smtpmail-default-smtp-server . " smtp.fastmail.com " )
( smtpmail-smtp-server . " smtp.fastmail.com " )
2024-06-24 17:26:31 -04:00
( smtpmail-local-domain . " fastmail.com " ) )
t )
2024-03-25 14:18:11 -04:00
2024-06-24 17:26:31 -04:00
( defun message-insert-signature-at-point ( )
" Insert signature at point. "
( interactive )
( setq message-signature " Matt Nish-Lapidus \n https://emenel.ca " )
( save-restriction
( narrow-to-region ( point ) ( point ) )
( message-insert-signature )
( newline ) )
( setq message-signature nil ) )
( use-package! consult-mu
:custom
;;maximum number of results shown in minibuffer
( consult-mu-maxnum 200 )
;;show preview when pressing any keys
( consult-mu-preview-key 'any )
;;do not mark email as read when previewed. If you turn this to t, be aware that the auto-loaded preview if the preview-key above is 'any would also get marked as read!
( consult-mu-mark-previewed-as-read nil )
;;mark email as read when selected.
;; (consult-mu-mark-viewed-as-read t)
;;use reply to all when composing reply emails
( consult-mu-use-wide-reply t )
;; define a template for headers view in minibuffer. The example below adjusts the width based on the width of the screen.
( consult-mu-headers-template ( lambda ( ) ( concat " %f " ( number-to-string ( floor ( * ( frame-width ) 0.15 ) ) ) " %s " ( number-to-string ( floor ( * ( frame-width ) 0.5 ) ) ) " %d13 " " %g " " %x " ) ) )
( consult-mu-action #' consult-mu--view-action )
:config
;;create a list of saved searches for quick access using `histroy-next-element' with `M-n' in minibuffer. Note the "#" character at the beginning of each query! Change these according to
( setq consult-mu-saved-searches-dynamics ' ( " #flag:unread " ) )
( setq consult-mu-saved-searches-async ' ( " #flag:unread " ) )
;; require embark actions for marking, replying, forwarding, etc. directly from minibuffer
( require 'consult-mu-embark )
;; require extra module for composing (e.g. for interactive attachment) as well as embark actions
( require 'consult-mu-compose )
( require 'consult-mu-compose-embark )
;; require extra module for searching contacts and runing embark actions on contacts
( require 'consult-mu-contacts )
( require 'consult-mu-contacts-embark )
;; change the prefiew key for compose so you don't open a preview of every file when selecting files to attach
( setq consult-mu-compose-preview-key " M-o " )
;; pick a key to bind to consult-mu-compose-attach in embark-file-map
( setq consult-mu-embark-attach-file-key " C-a " )
( setq consult-mu-contacts-ignore-list ' ( " ^.*no.*reply.* " ) )
( setq consult-mu-contacts-ignore-case-fold-search t )
( consult-mu-compose-embark-bind-attach-file-key )
;; choose if you want to use dired for attaching files (choice of 'always, 'in-dired, or nil)
( setq consult-mu-compose-use-dired-attachment 'in-dired ) )
2024-06-21 08:31:36 -04:00
2024-06-06 13:30:00 -04:00
( after! mu4e
( setq
mu4e-index-cleanup t
mu4e-index-lazy-check nil
mu4e-show-images t
2024-06-24 17:26:31 -04:00
message-kill-buffer-on-exit t
mu4e-enable-async-operations t )
( setq message-citation-line-format " On %e %B %Y at %R %Z, %f wrote: \n " )
( setq message-citation-line-function 'message-insert-formatted-citation-line )
( setq message-signature nil )
2024-06-06 13:30:00 -04:00
( setq mu4e-bookmarks nil )
2024-06-21 08:31:36 -04:00
( setq sendmail-program " /opt/homebrew/bin/msmtp "
send-mail-function 'smtpmail-send-it
message-sendmail-f-is-evil t
message-sendmail-extra-arguments ' ( " --read-envelope-from " )
message-send-mail-function 'message-send-mail-with-sendmail )
2024-06-24 17:26:31 -04:00
( setq mu4e-compose-format-flowed t )
( add-hook! 'mu4e-compose-mode-hook
( use-hard-newlines -1 )
( message-goto-body )
( message-insert-signature-at-point )
( message-goto-body ) )
;; spam
2024-06-06 13:30:00 -04:00
( mu4e-bookmark-define
" maildir:/matt@emenel.ca/Spam "
" Spam mail "
?S )
2024-06-24 17:26:31 -04:00
;; sent
2024-06-06 13:30:00 -04:00
( mu4e-bookmark-define
" maildir:/matt@emenel.ca/Sent "
" Sent mail "
?s )
2024-06-24 17:26:31 -04:00
;; unread
2024-06-06 13:30:00 -04:00
( mu4e-bookmark-define
( concat " flag:unread "
" and not maildir:/matt@emenel.ca/Spam "
" and not maildir:/matt@emenel.ca/Trash " )
" All Unread "
?u )
2024-06-24 17:26:31 -04:00
;; inboxes
2024-06-06 13:30:00 -04:00
( mu4e-bookmark-define
" maildir:/matt@emenel.ca/Inbox "
" All Inboxes "
?i )
( add-hook! mu4e-compose-mode
( ws-butler-mode -1 ) ) )
2024-03-25 14:18:11 -04:00
( use-package! kbd-mode )
2023-06-02 12:04:53 -04:00
( server-start )