commit 6261a44aa468f3a05e011f659c9a14d7b24a57ad Author: Matt Nish-Lapidus Date: Sun Mar 5 12:03:36 2023 -0500 making repo for config diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..5f3f948 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "modules/editor/meow"] + path = modules/editor/meow + url = git@github.com:emenel/doom-meow.git diff --git a/config.el b/config.el new file mode 100644 index 0000000..1410416 --- /dev/null +++ b/config.el @@ -0,0 +1,561 @@ +;;; $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)) + +;; There are two ways to load a theme. Both assume the theme is installed and +;; available. You can either set `doom-theme' or manually load a theme with the +;; `load-theme' function. This is the default: +(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) + +;; Modeline +;; - add current workspace name +;; - add major mode icon +(after! doom-modeline + (setq doom-modeline-persp-name t + doom-modeline-major-mode-icon t)) + +(setq doom-localleader-alt-key "C-SPC") + +(map! :leader "`" nil) + +(setq aw-dispatch-always t) + +(map! :leader + + (:prefix-map ("!" . "checkers")) ; bound by flycheck + + :desc "M-x" ":" #'execute-extended-command + :desc "Pop up scratch buffer" "x" #'doom/open-scratch-buffer + :desc "Universal argument" "u" #'universal-argument + + (:prefix-map ("w" . "window") + :desc "ace-window" "w" #'ace-window + :desc "split horizontally" "h" #'split-window-below + :desc "split vertically" "v" #'split-window-below + :desc "make taller" "+" #'enlarge-window + :desc "make taller" "-" #'shrink-window + :desc "make wider" ">" #'enlarge-window-horizontally + :desc "make narrower" "<" #'shrink-window-horizontally + :desc "delete current window" "d" #'delete-window) + + :desc "help" "h" help-map + + (:when (modulep! :ui popup) + :desc "Toggle last popup" "~" #'+popup/toggle) + :desc "Find file" "." #'find-file + :desc "Switch buffer" "," #'switch-to-buffer + (:when (modulep! :ui workspaces) + :desc "Switch workspace buffer" "," #'persp-switch-to-buffer + :desc "Switch buffer" "<" #'switch-to-buffer) + :desc "Resume last search" "'" + (cond ((modulep! :completion vertico) #'vertico-repeat) + ((modulep! :completion ivy) #'ivy-resume) + ((modulep! :completion helm) #'helm-resume)) + + :desc "Search for symbol in project" "*" #'+default/search-project-for-symbol-at-point + :desc "Search project" "/" #'+default/search-project + + :desc "Find file in project" "SPC" #'projectile-find-file + :desc "Jump to bookmark" "RET" #'bookmark-jump + + (:prefix-map ("TAB" . "workspace") + :desc "Display tab bar" "TAB" #'+workspace/display + :desc "Switch workspace" "." #'+workspace/switch-to + :desc "Switch to last workspace" "`" #'+workspace/other + :desc "New workspace" "n" #'+workspace/new + :desc "New named workspace" "N" #'+workspace/new-named + :desc "Load workspace from file" "l" #'+workspace/load + :desc "Save workspace to file" "s" #'+workspace/save + :desc "Delete session" "x" #'+workspace/kill-session + :desc "Delete this workspace" "d" #'+workspace/delete + :desc "Rename workspace" "r" #'+workspace/rename + :desc "Restore last session" "R" #'+workspace/restore-last-session + :desc "Next workspace" "]" #'+workspace/switch-right + :desc "Previous workspace" "[" #'+workspace/switch-left + :desc "Switch to 1st workspace" "1" #'+workspace/switch-to-0 + :desc "Switch to 2nd workspace" "2" #'+workspace/switch-to-1 + :desc "Switch to 3rd workspace" "3" #'+workspace/switch-to-2 + :desc "Switch to 4th workspace" "4" #'+workspace/switch-to-3 + :desc "Switch to 5th workspace" "5" #'+workspace/switch-to-4 + :desc "Switch to 6th workspace" "6" #'+workspace/switch-to-5 + :desc "Switch to 7th workspace" "7" #'+workspace/switch-to-6 + :desc "Switch to 8th workspace" "8" #'+workspace/switch-to-7 + :desc "Switch to 9th workspace" "9" #'+workspace/switch-to-8 + :desc "Switch to final workspace" "0" #'+workspace/switch-to-final) + + (:prefix-map ("f" . "file") + :desc "Open project editorconfig" "c" #'editorconfig-find-current-editorconfig + :desc "Copy this file" "C" #'doom/copy-this-file + :desc "Find directory" "d" #'+default/dired + :desc "Delete this file" "D" #'doom/delete-this-file + :desc "Find file in emacs.d" "e" #'doom/find-file-in-emacsd + :desc "Browse emacs.d" "E" #'doom/browse-in-emacsd + :desc "Find file" "f" #'find-file + :desc "Find file from here" "F" #'+default/find-file-under-here + :desc "Locate file" "l" #'locate + :desc "Find file in private config" "p" #'doom/find-file-in-private-config + :desc "Browse private config" "P" #'doom/open-private-config + :desc "Recent files" "r" #'recentf-open-files + :desc "Rename/move file" "R" #'doom/move-this-file + :desc "Save file" "s" #'save-buffer + :desc "Save file as..." "S" #'write-file + :desc "Sudo find file" "u" #'doom/sudo-find-file + :desc "Sudo this file" "U" #'doom/sudo-this-file + :desc "Yank file path" "y" #'+default/yank-buffer-path + :desc "Yank file path from project" "Y" #'+default/yank-buffer-path-relative-to-project) + + (:prefix-map ("p" . "project") + :desc "Browse project" "." #'+default/browse-project + :desc "Browse other project" ">" #'doom/browse-in-other-project + :desc "Run cmd in project root" "!" #'projectile-run-shell-command-in-root + :desc "Async cmd in project root" "&" #'projectile-run-async-shell-command-in-root + :desc "Add new project" "a" #'projectile-add-known-project + :desc "Switch to project buffer" "b" #'projectile-switch-to-buffer + :desc "Compile in project" "c" #'projectile-compile-project + :desc "Repeat last command" "C" #'projectile-repeat-last-command + :desc "Remove known project" "d" #'projectile-remove-known-project + :desc "Discover projects in folder" "D" #'+default/discover-projects + :desc "Edit project .dir-locals" "e" #'projectile-edit-dir-locals + :desc "Find file in project" "f" #'projectile-find-file + :desc "Find file in other project" "F" #'doom/find-file-in-other-project + :desc "Configure project" "g" #'projectile-configure-project + :desc "Invalidate project cache" "i" #'projectile-invalidate-cache + :desc "Kill project buffers" "k" #'projectile-kill-buffers + :desc "Find other file" "o" #'projectile-find-other-file + :desc "Switch project" "p" #'projectile-switch-project + :desc "Find recent project files" "r" #'projectile-recentf + :desc "Run project" "R" #'projectile-run-project + :desc "Save project files" "s" #'projectile-save-project-buffers + :desc "List project todos" "t" #'magit-todos-list + :desc "Test project" "T" #'projectile-test-project + :desc "Pop up scratch buffer" "x" #'doom/open-project-scratch-buffer + :desc "Switch to scratch buffer" "X" #'doom/switch-to-project-scratch-buffer + (:when (and (modulep! :tools taskrunner) + (or (modulep! :completion ivy) + (modulep! :completion helm))) + :desc "List project tasks" "z" #'+taskrunner/project-tasks)) + + + ;;; s --- search + (:prefix-map ("s" . "search") + :desc "Search buffer" "b" + (cond ((modulep! :completion vertico) #'+default/search-buffer) + ((modulep! :completion ivy) #'swiper) + ((modulep! :completion helm) #'swiper)) + :desc "Search all open buffers" "B" + (cond ((modulep! :completion vertico) (cmd!! #'consult-line-multi 'all-buffers)) + ((modulep! :completion ivy) #'swiper-all) + ((modulep! :completion helm) #'swiper-all)) + :desc "Search current directory" "d" #'+default/search-cwd + :desc "Search other directory" "D" #'+default/search-other-cwd + :desc "Search .emacs.d" "e" #'+default/search-emacsd + :desc "Locate file" "f" #'locate + :desc "Jump to symbol" "i" #'imenu + :desc "Jump to visible link" "l" #'link-hint-open-link + :desc "Jump to link" "L" #'ffap-menu + ;; :desc "Jump list" "j" #'evil-show-jumps + :desc "Jump to bookmark" "m" #'bookmark-jump + :desc "Look up online" "o" #'+lookup/online + :desc "Look up online (w/ prompt)" "O" #'+lookup/online-select + :desc "Look up in local docsets" "k" #'+lookup/in-docsets + :desc "Look up in all docsets" "K" #'+lookup/in-all-docsets + :desc "Search project" "p" #'+default/search-project + :desc "Search other project" "P" #'+default/search-other-project + ;; :desc "Jump to mark" "r" #'evil-show-marks + :desc "Search buffer" "s" #'+default/search-buffer + :desc "Search buffer for thing at point" "S" + (cond ((modulep! :completion vertico) #'+vertico/search-symbol-at-point) + ((modulep! :completion ivy) #'swiper-isearch-thing-at-point) + ((modulep! :completion helm) #'swiper-isearch-thing-at-point)) + :desc "Dictionary" "t" #'+lookup/dictionary-definition + :desc "Thesaurus" "T" #'+lookup/synonyms) + + + ;;; t --- toggle + (:prefix-map ("t" . "toggle") + :desc "Big mode" "b" #'doom-big-font-mode + :desc "Fill Column Indicator" "c" #'global-display-fill-column-indicator-mode + :desc "Flymake" "f" #'flymake-mode + (:when (modulep! :checkers syntax) + :desc "Flycheck" "f" #'flycheck-mode) + :desc "Frame fullscreen" "F" #'toggle-frame-fullscreen + ;; :desc "Evil goggles" "g" #'evil-goggles-mode + (:when (modulep! :ui indent-guides) + :desc "Indent guides" "i" #'highlight-indent-guides-mode) + :desc "Indent style" "I" #'doom/toggle-indent-style + :desc "Line numbers" "l" #'doom/toggle-line-numbers + (:when (modulep! :ui minimap) + :desc "Minimap" "m" #'minimap-mode) + (:when (modulep! :lang org +present) + :desc "org-tree-slide mode" "p" #'org-tree-slide-mode) + :desc "Read-only mode" "r" #'read-only-mode + (:when (and (modulep! :checkers spell) (not (modulep! :checkers spell +flyspell))) + :desc "Spell checker" "s" #'spell-fu-mode) + (:when (modulep! :checkers spell +flyspell) + :desc "Spell checker" "s" #'flyspell-mode) + (:when (modulep! :lang org +pomodoro) + :desc "Pomodoro timer" "t" #'org-pomodoro) + :desc "Visible mode" "v" #'visible-mode + :desc "Soft line wrapping" "w" #'visual-line-mode + (:when (modulep! :editor word-wrap) + :desc "Soft line wrapping" "w" #'+word-wrap-mode) + (:when (modulep! :ui zen) + :desc "Zen mode" "z" #'+zen/toggle + :desc "Zen mode (fullscreen)" "Z" #'+zen/toggle-fullscreen)) + + (:prefix-map ("o" . "open") + :desc "Start debugger" "d" #'+debugger/start + :desc "New frame" "f" #'make-frame + :desc "Select frame" "F" #'select-frame-by-name + :desc "REPL" "r" #'+eval/open-repl-other-window + :desc "REPL (same window)" "R" #'+eval/open-repl-same-window + :desc "Dired" "-" #'dired-jump + (:when (modulep! :ui neotree) + :desc "Project sidebar" "p" #'+neotree/open + :desc "Find file in project sidebar" "P" #'+neotree/find-this-file) + (:when (modulep! :ui treemacs) + :desc "Project sidebar" "p" #'+treemacs/toggle + :desc "Find file in project sidebar" "P" #'treemacs-find-file) + (:when (modulep! :term shell) + :desc "Toggle shell popup" "t" #'+shell/toggle + :desc "Open shell here" "T" #'+shell/here) + (:when (modulep! :term term) + :desc "Toggle terminal popup" "t" #'+term/toggle + :desc "Open terminal here" "T" #'+term/here) + (:when (modulep! :term vterm) + :desc "Toggle vterm popup" "t" #'+vterm/toggle + :desc "Open vterm here" "T" #'+vterm/here) + (:when (modulep! :term eshell) + :desc "Toggle eshell popup" "e" #'+eshell/toggle + :desc "Open eshell here" "E" #'+eshell/here) + (:when (modulep! :os macos) + :desc "Reveal in Finder" "o" #'+macos/reveal-in-finder + :desc "Reveal project in Finder" "O" #'+macos/reveal-project-in-finder + :desc "Send to Transmit" "u" #'+macos/send-to-transmit + :desc "Send project to Transmit" "U" #'+macos/send-project-to-transmit + :desc "Send to Launchbar" "l" #'+macos/send-to-launchbar + :desc "Send project to Launchbar" "L" #'+macos/send-project-to-launchbar + :desc "Open in iTerm" "i" #'+macos/open-in-iterm + :desc "Open in new iTerm window" "I" #'+macos/open-in-iterm-new-window) + (:when (modulep! :tools docker) + :desc "Docker" "D" #'docker) + (:when (modulep! :email mu4e) + :desc "mu4e" "m" #'=mu4e) + (:when (modulep! :email notmuch) + :desc "notmuch" "m" #'=notmuch) + (:when (modulep! :email wanderlust) + :desc "wanderlust" "m" #'=wanderlust)) + + (:prefix-map ("n" . "notes") + :desc "Search notes for symbol" "*" #'+default/search-notes-for-symbol-at-point + (:when (modulep! :tools biblio) + :desc "Bibliographic notes" "b" + (cond ((modulep! :completion vertico) #'citar-open-notes) + ((modulep! :completion ivy) #'ivy-bibtex) + ((modulep! :completion helm) #'helm-bibtex))) + + :desc "Find file in notes" "f" #'+default/find-in-notes + :desc "Browse notes" "F" #'+default/browse-notes) + + (:prefix-map ("g" . "git") + :desc "Revert file" "R" #'vc-revert + :desc "Copy link to remote" "y" #'+vc/browse-at-remote-kill + :desc "Copy link to homepage" "Y" #'+vc/browse-at-remote-kill-homepage + (:when (modulep! :ui hydra) + :desc "SMerge" "m" #'+vc/smerge-hydra/body) + (:when (modulep! :ui vc-gutter) + (:when (modulep! :ui hydra) + :desc "VCGutter" "." #'+vc/gutter-hydra/body) + :desc "Revert hunk at point" "r" #'+vc-gutter/revert-hunk + :desc "stage hunk at point" "s" #'+vc-gutter/stage-hunk + :desc "Git time machine" "t" #'git-timemachine-toggle + :desc "Jump to next hunk" "]" #'+vc-gutter/next-hunk + :desc "Jump to previous hunk" "[" #'+vc-gutter/previous-hunk) + (:when (modulep! :tools magit) + :desc "Magit dispatch" "/" #'magit-dispatch + :desc "Magit file dispatch" "." #'magit-file-dispatch + :desc "Forge dispatch" "'" #'forge-dispatch + :desc "Magit switch branch" "b" #'magit-branch-checkout + :desc "Magit status" "g" #'magit-status + :desc "Magit status here" "G" #'magit-status-here + :desc "Magit file delete" "D" #'magit-file-delete + :desc "Magit blame" "B" #'magit-blame-addition + :desc "Magit clone" "C" #'magit-clone + :desc "Magit fetch" "F" #'magit-fetch + :desc "Magit buffer log" "L" #'magit-log-buffer-file + :desc "Git stage file" "S" #'magit-stage-file + :desc "Git unstage file" "U" #'magit-unstage-file + (:prefix ("f" . "find") + :desc "Find file" "f" #'magit-find-file + :desc "Find gitconfig file" "g" #'magit-find-git-config-file + :desc "Find commit" "c" #'magit-show-commit + :desc "Find issue" "i" #'forge-visit-issue + :desc "Find pull request" "p" #'forge-visit-pullreq) + (:prefix ("o" . "open in browser") + :desc "Browse file or region" "o" #'+vc/browse-at-remote + :desc "Browse homepage" "h" #'+vc/browse-at-remote-homepage + :desc "Browse remote" "r" #'forge-browse-remote + :desc "Browse commit" "c" #'forge-browse-commit + :desc "Browse an issue" "i" #'forge-browse-issue + :desc "Browse a pull request" "p" #'forge-browse-pullreq + :desc "Browse issues" "I" #'forge-browse-issues + :desc "Browse pull requests" "P" #'forge-browse-pullreqs) + (:prefix ("l" . "list") + (:when (modulep! :tools gist) + :desc "List gists" "g" #'+gist:list) + :desc "List repositories" "r" #'magit-list-repositories + :desc "List submodules" "s" #'magit-list-submodules + :desc "List issues" "i" #'forge-list-issues + :desc "List pull requests" "p" #'forge-list-pullreqs + :desc "List notifications" "n" #'forge-list-notifications) + (:prefix ("c" . "create") + :desc "Initialize repo" "r" #'magit-init + :desc "Clone repo" "R" #'magit-clone + :desc "Commit" "c" #'magit-commit-create + :desc "Fixup" "f" #'magit-commit-fixup + :desc "Branch" "b" #'magit-branch-and-checkout + :desc "Issue" "i" #'forge-create-issue + :desc "Pull request" "p" #'forge-create-pullreq))) + + (:prefix-map ("c" . "code") + (:when (and (modulep! :tools lsp) (not (modulep! :tools lsp +eglot))) + :desc "LSP Execute code action" "a" #'lsp-execute-code-action + :desc "LSP Organize imports" "o" #'lsp-organize-imports + (:when (modulep! :completion ivy) + :desc "Jump to symbol in current workspace" "j" #'lsp-ivy-workspace-symbol + :desc "Jump to symbol in any workspace" "J" #'lsp-ivy-global-workspace-symbol) + (:when (modulep! :completion helm) + :desc "Jump to symbol in current workspace" "j" #'helm-lsp-workspace-symbol + :desc "Jump to symbol in any workspace" "J" #'helm-lsp-global-workspace-symbol) + (:when (modulep! :completion vertico) + :desc "Jump to symbol in current workspace" "j" #'consult-lsp-symbols + :desc "Jump to symbol in any workspace" "J" (cmd!! #'consult-lsp-symbols 'all-workspaces)) + (:when (modulep! :ui treemacs +lsp) + :desc "Errors list" "X" #'lsp-treemacs-errors-list + :desc "Incoming call hierarchy" "y" #'lsp-treemacs-call-hierarchy + :desc "Outgoing call hierarchy" "Y" (cmd!! #'lsp-treemacs-call-hierarchy t) + :desc "References tree" "R" (cmd!! #'lsp-treemacs-references t) + :desc "Symbols" "S" #'lsp-treemacs-symbols) + :desc "LSP" "l" #'+default/lsp-command-map + :desc "LSP Rename" "r" #'lsp-rename) + (:when (modulep! :tools lsp +eglot) + :desc "LSP Execute code action" "a" #'eglot-code-actions + :desc "LSP Rename" "r" #'eglot-rename + :desc "LSP Find declaration" "j" #'eglot-find-declaration + (:when (modulep! :completion vertico) + :desc "Jump to symbol in current workspace" "j" #'consult-eglot-symbols)) + :desc "Compile" "c" #'compile + :desc "Recompile" "C" #'recompile + :desc "Jump to definition" "d" #'+lookup/definition + :desc "Jump to references" "D" #'+lookup/references + :desc "Evaluate buffer/region" "e" #'+eval/buffer-or-region + :desc "Evaluate & replace region" "E" #'+eval:replace-region + :desc "Format buffer/region" "f" #'+format/region-or-buffer + :desc "Find implementations" "i" #'+lookup/implementations + :desc "Jump to documentation" "k" #'+lookup/documentation + :desc "Send to repl" "s" #'+eval/send-region-to-repl + :desc "Find type definition" "t" #'+lookup/type-definition + :desc "Delete trailing whitespace" "w" #'delete-trailing-whitespace + :desc "Delete trailing newlines" "W" #'doom/delete-trailing-newlines + :desc "List errors" "x" #'+default/diagnostics) + ) + +(after! which-key + (let ((prefix-re (regexp-opt (list doom-leader-key doom-leader-alt-key)))) + (cl-pushnew `((,(format "\\`\\(?:C-w\\|%s w\\) m\\'" prefix-re)) + nil . "maximize") + which-key-replacement-alist))) + +(map! "s-c" #'kill-ring-save + "s-v" #'yank + "s-x" #'kill-region + "s-a" #'mark-whole-buffer + "s-z" #'undo + "s-w" #'kill-buffer + "s-f" #'+default/search-buffer + "M-s-]" #'next-window-any-frame + "M-s-[" #'previous-window-any-frame + ;; "M-s-" #'backward-paragraph + ;; "M-s-" #'forward-paragraph + "s-" #'beginning-of-buffer + "s-" #'end-of-buffer + "M-s-v" #'consult-yank-from-kill-ring) + +(cond + ((string-equal system-type "darwin") + (setq frame-resize-pixelwise t + window-resize-pixelwise t))) + +(setq treemacs-follow-mode t) +(setq treemacs-project-follow-mode t) + +(setq-default indent-tabs-mode t) +(setq-default tab-width 2) + +(defalias 'compat-string-width 'string-width) + +(after! smart-tabs-mode + (smart-tabs-insinuate 'c 'javascript 'python)) + +(after! lsp-mode + (setq lsp-completion-provider :none) + (setq lsp-signature-render-documentation nil) + (setq lsp-completion-show-kind t) + + (defun my/lsp-mode-setup-completion () + (setf (alist-get 'styles (alist-get 'lsp-capf completion-category-defaults)) + '(orderless))) ;; Configure orderless + (add-hook! lsp-completion-mode 'my/lsp-mode-setup-completion)) + +(setq! citar-bibliography '("/Users/emenel/Zotero/lib.bib")) + +(after! lisp-mode + (setq lsp-completion-provider :none)) + +;; svelte support +(add-to-list 'auto-mode-alist '("\\.svelte\\'" . web-mode)) +(setq web-mode-engines-alist + '(("svelte" . "\\.svelte\\'"))) + +(after! web-mode + (map! :map web-mode-map + "M-s-." 'web-mode-element-close)) + +(add-hook! web-mode (web-mode-use-tabs) (setq indent-tabs-mode t)) + +(after! centaur-tabs + (setq centaur-tabs-set-bar 'right) + (setq centaur-tabs-cycle-scope 'tabs) + (map! :map centaur-tabs-mode-map + "s-M-" 'centaur-tabs-forward + "s-M-" 'centaur-tabs-backward)) + +(use-package! moom + :load-path "/Users/emenel/Source/_src/moom" + :after-call doom-after-init-hook + :config + (setq moom-use-font-module nil) + (moom-recommended-keybindings '(all wof)) + (setq moom-user-margin '(50 50 50 50)) + (setq moom-command-with-centering '(single double delete split)) + (when (display-graphic-p) (defun my-moom-default-frame-size () (set-frame-width (selected-frame) 150) (set-frame-height (selected-frame) 48) (moom-move-frame-to-center)) (add-hook! 'moom-mode-hook #'my-moom-default-frame-size) (moom-mode 1))) + +(setq terminal-here-mac-terminal-command '("kitty")) + +(setq projectile-project-search-path '(("~/Source" . 2))) +(setq projectile-globally-ignored-buffers + '("*scratch*" + "*lsp-log*")) + +;; ignoring buffers by their major mode +(setq projectile-globally-ignored-modes + '("erc-mode" + "help-mode" + "completion-list-mode" + "Buffer-menu-mode" + "gnus-.*-mode" + "occur-mode")) + +(use-package! obsidian + :config + (obsidian-specify-path "~/Library/Mobile Documents/iCloud~md~obsidian/Documents/Primary") + (setq obsidian-inbox-directory "_Inbox") + (global-obsidian-mode t) + (map! :map obsidian-mode-map + ;; Replace C-c C-o with Obsidian.el's implementation. It's ok to use another key binding. + "C-c C-o" #'obsidian-follow-link-at-point + ;; Jump to backlinks + "C-c C-b" #'obsidian-backlink-jump + ;; If you prefer you can use `obsidian-insert-link' + "C-c C-l" #'obsidian-insert-wikilink)) + +(defun mnl/obsidian-capture () + "Create new obsidian note. In the `obsidian-inbox-directory' if set otherwise in `obsidian-directory' root." + (interactive) + (let* ((title (read-from-minibuffer "Title: " (format-time-string "%Y-%m-%d"))) + (filename (s-concat obsidian-directory "/" obsidian-inbox-directory "/" title ".md")) + (clean-filename (s-replace "//" "/" filename))) + (find-file (expand-file-name clean-filename) t))) + +(map! :leader + :desc "Obsidian Quick Capture" + "X" #'mnl/obsidian-capture) + +(map! :leader + :prefix "n" + :desc "Obsidian Jump" + "f" #'obsidian-jump + :desc "Obsidian Search" + "s" #'obsidian-search + "*" #'obsidian-search + :desc "Obsidian Tag Search" + "m" #'obsidian-tag-find + :desc "Obsidian Capture" + "n" #'mnl/obsidian-capture + "a" nil + "d" nil) + +(map! :after markdown-mode + :leader + :prefix "n" + :desc "Obsidian Insert Wikilink" + "l" #'obsidian-insert-wikilink + :desc "Obsidian Backlink Jump" + "j" #'obsidian-backlink-jump) + +(setq org-directory "~/Library/Mobile Documents/iCloud~md~obsidian/Documents/Primary/org/") + +(after! vertico + (vertico-mouse-mode)) + +(after! sly + (setq sly-complete-symbol-function 'sly-flex-completions)) + +(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))) + (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))) + ;; (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))) + +(setq tidal-boot-script-path "~/.cabal/share/aarch64-osx-ghc-9.4.2/tidal-1.9.3/BootTidal.hs") + +;; TODO update this for sly to use ciel by default +;; (setq slime-lisp-implementations +;; `((sbcl ("sbcl")) ;; default. Adapt if needed. +;; (ciel-sbcl ("sbcl" "--core" "/path/to/ciel/ciel-core" "--eval" "(in-package :ciel-user)")))) +;; (setq slime-default-lisp 'ciel-sbcl) + +(defun mnl/remove-all-blank-lines () + (flush-lines "^$")) + +(+global-word-wrap-mode +1) +(delete-selection-mode 1) +(setq delete-active-region t) + +;; remove org agenda from the splash screen +(assoc-delete-all "Open org-agenda" +doom-dashboard-menu-sections) diff --git a/custom.el b/custom.el new file mode 100644 index 0000000..eae5688 --- /dev/null +++ b/custom.el @@ -0,0 +1,33 @@ +(custom-set-variables + ;; custom-set-variables was added by Custom. + ;; If you edit it by hand, you could mess it up, so be careful. + ;; Your init file should contain only one such instance. + ;; If there is more than one, they won't work right. + '(blink-cursor-mode nil) + '(column-number-mode t) + '(context-menu-mode t) + '(size-indication-mode t) + '(tool-bar-mode nil) + '(warning-suppress-log-types '((lsp-mode) (lsp-mode) (lsp-mode) (defvaralias))) + '(warning-suppress-types '((lsp-mode) (lsp-mode) (defvaralias)))) +(custom-set-faces + ;; custom-set-faces was added by Custom. + ;; If you edit it by hand, you could mess it up, so be careful. + ;; Your init file should contain only one such instance. + ;; If there is more than one, they won't work right. + ) + ;; custom-set-faces was added by Custom. + ;; If you edit it by hand, you could mess it up, so be careful. + ;; Your init file should contain only one such instance. + ;; If there is more than one, they won't work right. + + ;; custom-set-faces was added by Custom. + ;; If you edit it by hand, you could mess it up, so be careful. + ;; Your init file should contain only one such instance. + ;; If there is more than one, they won't work right. + + ;; custom-set-faces was added by Custom. + ;; If you edit it by hand, you could mess it up, so be careful. + ;; Your init file should contain only one such instance. + ;; If there is more than one, they won't work right. + diff --git a/init.el b/init.el new file mode 100644 index 0000000..c507984 --- /dev/null +++ b/init.el @@ -0,0 +1,196 @@ +;;; init.el -*- lexical-binding: t; -*- + +;; This file controls what Doom modules are enabled and what order they load +;; in. Remember to run 'doom sync' after modifying it! + +;; NOTE Press 'SPC h d h' (or 'C-h d h' for non-vim users) to access Doom's +;; documentation. There you'll find a link to Doom's Module Index where all +;; of our modules are listed, including what flags they support. + +;; NOTE Move your cursor over a module's name (or its flags) and press 'K' (or +;; 'C-c c k' for non-vim users) to view its documentation. This works on +;; flags as well (those symbols that start with a plus). +;; +;; Alternatively, press 'gd' (or 'C-c c d') on a module to browse its +;; directory (for easy access to its source code). + +(doom! :input + ;;bidi ; (tfel ot) thgir etirw uoy gnipleh + ;;chinese + ;;japanese + ;;layout ; auie,ctsrnm is the superior home row + + :completion + ;; company ; the ultimate code completion backend + ;; helm ; the *other* search engine for love and life + ;;ido ; the other *other* search engine... + ;;ivy ; a search engine for love and life + (vertico +icons +orderless) ; the search engine of the future + (corfu +icons +orderless) + + :ui + ;;deft ; notational velocity for Emacs + doom ; what makes DOOM look the way it does + doom-dashboard ; a nifty splash screen for Emacs + ;;doom-quit ; DOOM quit-message prompts when you quit Emacs + (emoji +unicode) ; 🙂 + hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW + ;;hydra + ;; indent-guides ; highlighted indent columns + (ligatures) ; ligatures and symbols to make your code pretty again + ;; minimap ; show a map of the code on the side + modeline ; snazzy, Atom-inspired modeline, plus API + nav-flash ; blink cursor line after big motions + neotree ; a project drawer, like NERDTree for vim + ophints ; highlight the region an operation acts on + (popup +all +defaults) ; tame sudden yet inevitable temporary windows + tabs ; a tab bar for Emacs + ;; treemacs ; a project drawer, like neotree but cooler + ;;unicode ; extended unicode support for various languages + (vc-gutter +pretty) ; vcs diff in the fringe + vi-tilde-fringe ; fringe tildes to mark beyond EOB + ;;window-select ; visually switch windows + workspaces ; tab emulation, persistence & separate workspaces + ;;zen ; distraction-free coding or writing + + :editor + (meow +qwerty +override +leader) + ;; evil; come to the dark side, we have cookies + file-templates ; auto-snippets for empty files + fold ; (nigh) universal code folding + format ; automated prettiness + ;;god ; run Emacs commands without modifier keys + ;; lispy ; vim for lisp, for people who don't like vim + ;; multiple-cursors ; editing in many places at once + ;; objed ; text object editing for the innocent + ;; parinfer ; turn lisp into python, sort of + ;;rotate-text ; cycle region at point between text candidates + snippets ; my elves. They type so I don't have to + word-wrap ; soft wrapping with language-aware indent + + :emacs + (dired +icons) ; making dired pretty [functional] + electric ; smarter, keyword-based electric-indent + (ibuffer +icons) ; interactive buffer management + undo ; persistent, smarter undo for your inevitable mistakes + vc ; version-control and Emacs, sitting in a tree + + :term + ;;eshell ; the elisp shell that works everywhere + ;;shell ; simple shell REPL for Emacs + ;;term ; basic terminal emulator for Emacs + vterm ; the best terminal emulation in Emacs + + :checkers + syntax ; tasing you for every semicolon you forget + (spell +flyspell) ; tasing you for misspelling mispelling + ;;grammar ; tasing grammar mistake every you make + + :tools + ;;ansible + biblio ; Writes a PhD for you (citation needed) + ;;debugger ; FIXME stepping through code, to help you add bugs + ;;direnv + ;;docker + ;;editorconfig ; let someone else argue about tabs vs spaces + ;;ein ; tame Jupyter notebooks with emacs + (eval +overlay) ; run code, run (also, repls) + ;;gist ; interacting with github gists + lookup ; navigate your code and its documentation + lsp ; M-x vscode + magit ; a git porcelain for Emacs + ;;make ; run make tasks from Emacs + ;;pass ; password manager for nerds + pdf ; pdf enhancements + ;;prodigy ; FIXME managing external services & code builders + rgb ; creating color strings + ;;taskrunner ; taskrunner for all your projects + ;;terraform ; infrastructure as code + ;;tmux ; an API for interacting with tmux + ;; tree-sitter ; syntax and parsing, sitting in a tree... + ;;upload ; map local to remote projects via ssh/ftp + + :os + (:if IS-MAC macos) ; improve compatibility with macOS + ;;tty ; improve the terminal Emacs experience + + :lang + ;;agda ; types of types of types of types... + ;;beancount ; mind the GAAP + (cc +lsp) ; C > C++ == 1 + (clojure +lsp) ; java with a lisp + (common-lisp +lsp) ; if you've seen one lisp, you've seen them all + ;;coq ; proofs-as-programs + ;;crystal ; ruby at the speed of c + ;;csharp ; unity, .NET, and mono shenanigans + data ; config/data formats + ;;(dart +flutter) ; paint ui and not much else + ;;dhall + ;;elixir ; erlang done right + ;;elm ; care for a cup of TEA? + emacs-lisp ; drown in parentheses + ;;erlang ; an elegant language for a more civilized age + ;;ess ; emacs speaks statistics + ;;factor + ;;faust ; dsp, but you get to keep your soul + ;;fortran ; in FORTRAN, GOD is REAL (unless declared INTEGER) + ;;fsharp ; ML stands for Microsoft's Language + ;;fstar ; (dependent) types and (monadic) effects and Z3 + ;;gdscript ; the language you waited for + ;;(go +lsp) ; the hipster dialect + ;;(graphql +lsp) ; Give queries a REST + (haskell +lsp) ; a language that's lazier than I am + ;;hy ; readability of scheme w/ speed of python + ;;idris ; a language you can depend on + json ; At least it ain't XML + (java +lsp) ; the poster child for carpal tunnel syndrome + (javascript +lsp) ; all(hope(abandon(ye(who(enter(here)))))) + ;;julia ; a better, faster MATLAB + ;;kotlin ; a better, slicker Java(Script) + ;;latex ; writing papers in Emacs has never been so fun + ;;lean ; for folks with too much to prove + ;;ledger ; be audit you can be + lua ; one-based indices? one-based indices + markdown ; writing docs for people to ignore + ;;nim ; python + lisp at the speed of c + ;;nix ; I hereby declare "nix geht mehr!" + ;;ocaml ; an objective camel + (org +pretty) ; organize your plain life in plain text + php ; perl's insecure younger brother + ;;plantuml ; diagrams for confusing people more + purescript ; javascript, but functional + (python +lsp) ; beautiful is better than ugly + qt ; the 'cutest' gui framework ever + racket ; a DSL for DSLs + ;;raku ; the artist formerly known as perl6 + ;;rest ; Emacs as a REST client + ;;rst ; ReST in peace + ;;(ruby +rails) ; 1.step {|i| p "Ruby is #{i.even? ? 'love' : 'life'}"} + (rust +lsp) ; Fe2O3.unwrap().unwrap().unwrap().unwrap() + ;;scala ; java, but good + ;;(scheme +guile) ; a fully conniving family of lisps + sh ; she sells {ba,z,fi}sh shells on the C xor + ;;sml + ;;solidity ; do you need a blockchain? No. + ;;swift ; who asked for emoji variables? + ;;terra ; Earth and Moon in alignment for performance. + (web +lsp) + yaml ; JSON, but readable + ;;zig ; C, but simpler + + :email + ;; (mu4e +org +gmail) + ;;notmuch + ;;(wanderlust +gmail) + + :app + ;;calendar + ;;emms + ;;everywhere ; *leave* Emacs!? You must be joking + ;;irc ; how neckbeards socialize + ;; (rss +org) ; emacs as an RSS reader + ;;twitter ; twitter client https://twitter.com/vnought + + :config + ;;literate + (default +smartparens)) ;;+bindings diff --git a/modules/completion/corfu/autoload/extra.el b/modules/completion/corfu/autoload/extra.el new file mode 100644 index 0000000..3f9739c --- /dev/null +++ b/modules/completion/corfu/autoload/extra.el @@ -0,0 +1,39 @@ +;;; completion/corfu/autoload.el -*- lexical-binding: t; -*- + +;;;###autoload +(defun +corfu-complete-file-at-point () + "Complete a file path from scratch at point" + (interactive) + (completion-in-region (point) (point) #'read-file-name-internal)) + +;;;###autoload +(defun +corfu-files () + "Complete using files source" + (interactive) + (let ((completion-at-point-functions (list #'+file-completion-at-point-function))) + (completion-at-point))) + +;;;###autoload +(defun +corfu-dabbrev () + "Complete using dabbrev source" + (interactive) + (let ((completion-at-point-functions (list #'+dabbrev-completion-at-point-function))) + (completion-at-point))) + +;;;###autoload +(defun +corfu-ispell () + "Complete using ispell source. + +See `ispell-lookup-words' for more info" + (interactive) + (let ((completion-at-point-functions (list #'+ispell-completion-at-point-function))) + (completion-at-point))) + +;;;###autoload +(defun +corfu-dict () + "Complete using dict source. + +See `+dict--words' for extra words, and `+dict-file' for a wordslist source " + (interactive) + (let ((completion-at-point-functions (list #'+dict-completion-at-point-function))) + (completion-at-point))) diff --git a/modules/completion/corfu/autoload/minad-capf.el b/modules/completion/corfu/autoload/minad-capf.el new file mode 100644 index 0000000..6bea695 --- /dev/null +++ b/modules/completion/corfu/autoload/minad-capf.el @@ -0,0 +1,75 @@ +;; Daniel "minad" Mendler extra capfs -*- lexical-binding: t -*- +;; Source : https://github.com/minad/corfu/issues/9#issuecomment-945090516 + +(require 'dabbrev) + +;;;###autoload +(defun +file-completion-at-point-function () + "File name completion-at-point-function." + (when-let (bounds (bounds-of-thing-at-point 'filename)) + (list (car bounds) (cdr bounds) + 'read-file-name-internal + :exclusive 'no + :annotation-function (lambda (_) " (File)")))) + +;;;###autoload +(defun +dabbrev-completion-at-point-function () + (let ((dabbrev-check-all-buffers nil) + (dabbrev-check-other-buffers nil)) + (dabbrev--reset-global-variables)) + (let ((abbrev (ignore-errors (dabbrev--abbrev-at-point)))) + (when (and abbrev (not (string-match-p "[ \t]" abbrev))) + (pcase ;; Interruptible scanning + (while-no-input + (let ((inhibit-message t) + (message-log-max nil)) + (or (dabbrev--find-all-expansions + abbrev (dabbrev--ignore-case-p abbrev)) + t))) + ('nil (keyboard-quit)) + ('t nil) + (words + ;; Ignore completions which are too short + (let ((min-len (+ 4 (length abbrev)))) + (setq words (seq-remove (lambda (x) (< (length x) min-len)) words))) + (when words + (let ((beg (progn (search-backward abbrev) (point))) + (end (progn (search-forward abbrev) (point)))) + (unless (string-match-p "\n" (buffer-substring beg end)) + (list beg end words + :exclusive 'no + :annotation-function (lambda (_) " (Dabbrev)")))))))))) + +(autoload 'ispell-lookup-words "ispell") + +;;;###autoload +(defun +ispell-completion-at-point-function () + (when-let* ((bounds (bounds-of-thing-at-point 'word)) + (table (with-demoted-errors + (let ((message-log-max nil) + (inhibit-message t)) + (ispell-lookup-words + (format "*%s*" + (buffer-substring-no-properties (car bounds) (cdr bounds)))))))) + (list (car bounds) (cdr bounds) table + :exclusive 'no + :annotation-function (lambda (_) " (Ispell)")))) + +(defun +word-completion-at-point-function (words) + (when-let (bounds (bounds-of-thing-at-point 'word)) + (list (car bounds) (cdr bounds) words + :exclusive 'no + :annotation-function (lambda (_) " (Words)")))) + +(defvar +dict--words nil) +(defvar +dict-file "/etc/dictionaries-common/words") + +;;;###autoload +(defun +dict-completion-at-point-function () + (+word-completion-at-point-function + (or +dict--words + (setq +dict--words + (split-string (with-temp-buffer + (insert-file-contents-literally +dict-file) + (buffer-string)) + "\n"))))) diff --git a/modules/completion/corfu/autoload/minibuffer.el b/modules/completion/corfu/autoload/minibuffer.el new file mode 100644 index 0000000..7f5d455 --- /dev/null +++ b/modules/completion/corfu/autoload/minibuffer.el @@ -0,0 +1,13 @@ +;;; completion/corfu/autoload/corfu.el -*- lexical-binding: t; -*- +;;;###if (modulep! :completion corfu +minibuffer) + +;;;###autoload +(defun +corfu--enable-in-minibuffer () + (unless (or (bound-and-true-p mct--active) + (bound-and-true-p vertico--input) + (memq this-command '(evil-ex + evil-ex-search-forward + evil-ex-search-backward)) + (and (modulep! :completion helm) + (helm--alive-p)) + (corfu-mode +1)))) diff --git a/modules/completion/corfu/config.el b/modules/completion/corfu/config.el new file mode 100644 index 0000000..4ce7a8d --- /dev/null +++ b/modules/completion/corfu/config.el @@ -0,0 +1,215 @@ +;;; completion/corfu/config.el -*- lexical-binding: t; -*- + +;; Corfu completion module + +(defvar +corfu-global-capes + '(cape-yasnippet + :completion + cape-dict) + "A list of global capes to be available at all times. + The key :completion is used to specify where completion candidates should be + placed, otherwise they come first.") + +(defvar +corfu-capf-hosts + '(lsp-completion-at-point + eglot-completion-at-point + elisp-completion-at-point + tags-completion-at-point-function) + "A prioritised list of host capfs to create a super cape onto from + `+corfu-global-capes'.") + +(defun +corfu--load-capes () + "Load all capes specified in `+corfu-global-capes'." + (interactive) + (when-let ((host (cl-intersection +corfu-capf-hosts completion-at-point-functions))) + (setq-local + completion-at-point-functions + (cl-substitute + (apply #'cape-super-capf (cl-substitute (car host) :completion (cl-pushnew :completion +corfu-global-capes))) + (car host) + completion-at-point-functions)))) + +(add-hook 'lsp-mode-hook #'+corfu--load-capes) +(add-hook 'eglot-mode-hook #'+corfu--load-capes) +(add-hook 'change-major-mode-hook #'+corfu--load-capes) + +(use-package! corfu + :custom + (corfu-separator ?\s) + (corfu-auto t) + (corfu-auto-delay 0.2) + (corfu-preview-current nil) ;; Disable current candidate preview + (corfu-on-exact-match nil) + (corfu-quit-no-match 'separator) + (corfu-cycle t) + (corfu-auto-prefix 2) + (completion-cycle-threshold 1) + (tab-always-indent 'complete) + (corfu-max-width 80) + (corfu-preselect-first nil) + :hook + (doom-first-buffer . global-corfu-mode) + :config + (when (modulep! +minibuffer) + (add-hook 'minibuffer-setup-hook #'+corfu--enable-in-minibuffer)) + + ;; Dirty hack to get c completion running + ;; Discussion in https://github.com/minad/corfu/issues/34 + (when (and (modulep! :lang cc) + (equal tab-always-indent 'complete)) + (map! :map c-mode-base-map + :i [remap c-indent-line-or-region] #'completion-at-point)) + + ;; Reset lsp-completion provider + (add-hook 'doom-init-modules-hook + (lambda () + (after! lsp-mode + (setq lsp-completion-provider :none)))) + + ;; Set orderless filtering for LSP-mode completions + ;; TODO: expose a Doom variable to control this part + (add-hook 'lsp-completion-mode-hook + (lambda () + (setf (alist-get 'lsp-capf completion-category-defaults) '((styles . (orderless flex)))))) + + (defun corfu-move-to-minibuffer () + "Move current completions to the minibuffer" + (interactive) + (let ((completion-extra-properties corfu--extra) + completion-cycle-threshold completion-cycling) + (apply #'consult-completion-in-region completion-in-region--data))) + + (map! :map corfu-map + "C-SPC" #'corfu-insert-separator + "C-n" #'corfu-next + "C-p" #'corfu-previous + "M-m" #'corfu-move-to-minibuffer + (:prefix "C-x" + "C-k" #'cape-dict + "s" #'cape-ispell + "C-n" #'cape-keyword + "C-f" #'cape-file)) + (after! evil + (advice-add 'corfu--setup :after 'evil-normalize-keymaps) + (advice-add 'corfu--teardown :after 'evil-normalize-keymaps) + (evil-make-overriding-map corfu-map)) + + (defadvice! +corfu--org-return (orig) :around '+org/return + (if (and (modulep! :completion corfu) + corfu-mode + (>= corfu--index 0)) + (corfu-insert) + (funcall orig))) + + ;; TODO: check how to deal with Daemon/Client workflow with that + (unless (display-graphic-p) + (corfu-doc-terminal-mode) + (corfu-terminal-mode))) + +(use-package! orderless + :when (modulep! +orderless) + :init + (setq completion-styles '(orderless partial-completion) + completion-category-defaults nil + completion-category-overrides '((file (styles . (partial-completion)))))) + +(use-package! kind-icon + :after corfu + :when (modulep! +icons) + :custom + (kind-icon-default-face 'corfu-default) + :config + (setq kind-icon-use-icons t + svg-lib-icons-dir (expand-file-name "svg-lib" doom-cache-dir) + kind-icon-mapping + '((array "a" :icon "code-brackets" :face font-lock-variable-name-face) + (boolean "b" :icon "circle-half-full" :face font-lock-builtin-face) + (class "c" :icon "view-grid-plus-outline" :face font-lock-type-face) + (color "#" :icon "palette" :face success) + (constant "co" :icon "pause-circle" :face font-lock-constant-face) + (constructor "cn" :icon "table-column-plus-after" :face font-lock-function-name-face) + (enum "e" :icon "format-list-bulleted-square" :face font-lock-builtin-face) + (enum-member "em" :icon "format-list-checks" :face font-lock-builtin-face) + (event "ev" :icon "lightning-bolt-outline" :face font-lock-warning-face) + (field "fd" :icon "application-braces-outline" :face font-lock-variable-name-face) + (file "f" :icon "file" :face font-lock-string-face) + (folder "d" :icon "folder" :face font-lock-doc-face) + (function "f" :icon "lambda" :face font-lock-function-name-face) + (interface "if" :icon "video-input-component" :face font-lock-type-face) + (keyword "kw" :icon "image-filter-center-focus" :face font-lock-keyword-face) + (macro "mc" :icon "sigma" :face font-lock-keyword-face) + (method "m" :icon "lambda" :face font-lock-function-name-face) + (module "{" :icon "view-module" :face font-lock-preprocessor-face}) + (numeric "nu" :icon "numeric" :face font-lock-builtin-face) + (operator "op" :icon "plus-circle-outline" :face font-lock-comment-delimiter-face) + (param "pa" :icon "cog" :face default) + (property "pr" :icon "tune-vertical" :face font-lock-variable-name-face) + (reference "rf" :icon "bookmark-box-multiple" :face font-lock-variable-name-face) + (snippet "S" :icon "text-short" :face font-lock-string-face) + (string "s" :icon "sticker-text-outline" :face font-lock-string-face) + (struct "%" :icon "code-braces" :face font-lock-variable-name-face) + (t "." :icon "crosshairs-question" :face shadow) + (text "tx" :icon "script-text-outline" :face shadow) + (type-parameter "tp" :icon "format-list-bulleted-type" :face font-lock-type-face) + (unit "u" :icon "ruler-square" :face shadow) + (value "v" :icon "numeric-1-box-multiple-outline" :face font-lock-builtin-face) + (variable "va" :icon "adjust" :face font-lock-variable-name-face))) + (add-hook 'doom-load-theme-hook #'kind-icon-reset-cache) + (add-to-list 'corfu-margin-formatters #'kind-icon-margin-formatter)) + + +(use-package! cape + :defer t + :init + (map! + [remap dabbrev-expand] 'cape-dabbrev) + (add-hook! 'latex-mode-hook (defun +corfu--latex-set-capfs () + (add-to-list 'completion-at-point-functions #'cape-tex))) + (when (modulep! :checkers spell) + (add-to-list 'completion-at-point-functions #'cape-dict) + (add-to-list 'completion-at-point-functions #'cape-ispell)) + (add-to-list 'completion-at-point-functions #'cape-file) + (add-to-list 'completion-at-point-functions #'cape-keyword t) + (add-to-list 'completion-at-point-functions #'cape-dabbrev t)) + + +(use-package! corfu-history + :after corfu + :hook (corfu-mode . (lambda () + (corfu-history-mode 1) + (savehist-mode 1) + (add-to-list 'savehist-additional-variables 'corfu-history)))) + +(use-package! corfu-quick + :after corfu + :bind (:map corfu-map + ("M-q" . corfu-quick-complete) + ("C-q" . corfu-quick-insert))) + +(use-package! corfu-echo + :after corfu + :hook (corfu-mode . corfu-echo-mode)) + + +(use-package! corfu-info + :after corfu) + + +(use-package! corfu-popupinfo + :after corfu + :hook (corfu-mode . corfu-popupinfo-mode)) + +(when (modulep! :editor evil +everywhere) + (setq evil-collection-corfu-key-themes '(default magic-return))) + +(use-package! cape-yasnippet + :after cape) + +;; Override :config default mapping by waiting for after corfu is loaded +(add-hook! 'doom-after-modules-config-hook + (defun +corfu-unbind-yasnippet-h () + "Remove problematic tab bindings in cmds! on :i TAB" + (map! :i [tab] nil + :i "TAB" nil + :i "C-SPC" #'completion-at-point + :i "C-@" #'completion-at-point))) diff --git a/modules/completion/corfu/packages.el b/modules/completion/corfu/packages.el new file mode 100644 index 0000000..878ffb6 --- /dev/null +++ b/modules/completion/corfu/packages.el @@ -0,0 +1,20 @@ +(package! corfu + :recipe (:files (:defaults "extensions/*.el"))) + +(when (modulep! +icons) + (package! kind-icon)) + +(when (modulep! +orderless) + (package! orderless)) + +(package! cape) + +(package! popon + :recipe (:type git :repo "https://codeberg.org/akib/emacs-popon")) +(package! corfu-terminal + :recipe (:type git :repo "https://codeberg.org/akib/emacs-corfu-terminal.git")) +(package! corfu-doc-terminal + :recipe (:type git :repo "https://codeberg.org/akib/emacs-corfu-doc-terminal.git")) + +(package! cape-yasnippet + :recipe (:host github :repo "elken/cape-yasnippet")) diff --git a/modules/editor/.DS_Store b/modules/editor/.DS_Store new file mode 100644 index 0000000..5008ddf Binary files /dev/null and b/modules/editor/.DS_Store differ diff --git a/modules/editor/meow b/modules/editor/meow new file mode 160000 index 0000000..e770738 --- /dev/null +++ b/modules/editor/meow @@ -0,0 +1 @@ +Subproject commit e77073837591ab013588abb889392a5c23a00afb diff --git a/packages.el b/packages.el new file mode 100644 index 0000000..6855aa6 --- /dev/null +++ b/packages.el @@ -0,0 +1,84 @@ +;; -*- no-byte-compile: t; -*- +;;; $DOOMDIR/packages.el + +;; To install a package with Doom you must declare them here and run 'doom sync' +;; on the command line, then restart Emacs for the changes to take effect -- or +;; use 'M-x doom/reload'. + +(unpin! compat) +;; (:host github :repo "emacs-compat/compat") +(unpin! doom-themes) +(unpin! lsp-mode) +(unpin! sly) +(unpin! corfu) +(unpin! cape) +(unpin! markdown-mode) +;; (unpin! consult) +;; (unpin! vertico) +;; (unpin! embark) +;; (unpin! orderless) + +(package! meow) + +(package! obsidian) +(package! terminal-here) +(package! processing-mode) +(package! ob-p5js) +(package! tidal) +(package! fish-mode) +(package! smart-tabs-mode) +(package! arduino-mode) +(package! arduino-cli-mode) +(package! w3m) +(package! supercollider + :recipe (:local-repo "/Users/emenel/Library/Application Support/SuperCollider/downloaded-quarks/scel/el")) +;; (package! ijanet + ;; :recipe (:type git + ;; :host github + ;; :repo "serialdev/ijanet-mode")) + + + + +;; To install SOME-PACKAGE from MELPA, ELPA or emacsmirror: +;(package! some-package) + +;; To install a package directly from a remote git repo, you must specify a +;; `:recipe'. You'll find documentation on what `:recipe' accepts here: +;; https://github.com/radian-software/straight.el#the-recipe-format +;(package! another-package +; :recipe (:host github :repo "username/repo")) + +;; If the package you are trying to install does not contain a PACKAGENAME.el +;; file, or is located in a subdirectory of the repo, you'll need to specify +;; `:files' in the `:recipe': +;(package! this-package +; :recipe (:host github :repo "username/repo" +; :files ("some-file.el" "src/lisp/*.el"))) + +;; If you'd like to disable a package included with Doom, you can do so here +;; with the `:disable' property: +;(package! builtin-package :disable t) + +;; You can override the recipe of a built in package without having to specify +;; all the properties for `:recipe'. These will inherit the rest of its recipe +;; from Doom or MELPA/ELPA/Emacsmirror: +;(package! builtin-package :recipe (:nonrecursive t)) +;(package! builtin-package-2 :recipe (:repo "myfork/package")) + +;; Specify a `:branch' to install a package from a particular branch or tag. +;; This is required for some packages whose default branch isn't 'master' (which +;; our package manager can't deal with; see radian-software/straight.el#279) +;(package! builtin-package :recipe (:branch "develop")) + +;; Use `:pin' to specify a particular commit to install. +;(package! builtin-package :pin "1a2b3c4d5e") + + +;; Doom's packages are pinned to a specific commit and updated from release to +;; release. The `unpin!' macro allows you to unpin single packages... +;(unpin! pinned-package) +;; ...or multiple packages +;(unpin! pinned-package another-pinned-package) +;; ...Or *all* packages (NOT RECOMMENDED; will likely break things) +;(unpin! t) diff --git a/snippets/web-mode/.yas-parents b/snippets/web-mode/.yas-parents new file mode 100644 index 0000000..64e4d54 --- /dev/null +++ b/snippets/web-mode/.yas-parents @@ -0,0 +1,3 @@ +html-mode +css-mode +js-mode \ No newline at end of file