diff options
author | bd <bdunahu@operationnull.com> | 2024-11-17 00:40:56 -0500 |
---|---|---|
committer | bd <bdunahu@operationnull.com> | 2024-11-17 00:40:56 -0500 |
commit | 1500001e8c8335aac78d6c0438a25822783d141b (patch) | |
tree | e5f6f04ca423bebdd5ca4d94e3ee8cce455820bb | |
parent | 2e5f4dcc65e14517e5a194cc94da3c2b493fae63 (diff) |
Add yasnippet
-rw-r--r-- | .config/emacs/modules/bd--devel.el | 6 | ||||
-rw-r--r-- | .config/emacs/modules/bd--minibuffer.el | 3 | ||||
-rw-r--r-- | .config/emacs/modules/bd--notes.el | 30 | ||||
-rw-r--r-- | .config/emacs/snippets/org-mode/align-star | 10 | ||||
-rw-r--r-- | .config/emacs/snippets/org-mode/bmatrix | 12 | ||||
-rw-r--r-- | .config/emacs/snippets/org-mode/equation-star | 11 | ||||
-rw-r--r-- | .config/emacs/snippets/snippet-mode/header | 14 | ||||
-rw-r--r-- | .config/guix/modules/emacs.scm | 2 |
8 files changed, 65 insertions, 23 deletions
diff --git a/.config/emacs/modules/bd--devel.el b/.config/emacs/modules/bd--devel.el index 863a72a..d7426d1 100644 --- a/.config/emacs/modules/bd--devel.el +++ b/.config/emacs/modules/bd--devel.el @@ -68,6 +68,12 @@ to.") (add-to-list 'eglot-server-programs '(c-mode . ("ccls" "--init={\"clang\": {\"extraArgs\": [\"-std=c++20\"]}}")))) +(use-package yasnippet + :hook ((text-mode + prog-mode) . yas-minor-mode-on) + :bind (("H-s" . yas-insert-snippet) + ("H-e" . yas-expand))) + (use-package rainbow-mode :hook css-mode) diff --git a/.config/emacs/modules/bd--minibuffer.el b/.config/emacs/modules/bd--minibuffer.el index 51e3637..31338e7 100644 --- a/.config/emacs/modules/bd--minibuffer.el +++ b/.config/emacs/modules/bd--minibuffer.el @@ -122,6 +122,7 @@ selection commands.") (bd/selector-buffer-type "Ordinary" #'bd/buffer-ordinary-p) (bd/selector-project-files) (bd/selector-bookmarks) + (bd/selector-search) (selector-recentf-source)))) (keymap-global-set "C-x b" 'bd/navigate) @@ -159,7 +160,5 @@ selection commands.") (keymap-global-set "C-z s" 'bd/selector-rg)) - - (provide 'bd--minibuffer) ;;; bd-minibuffer ends here diff --git a/.config/emacs/modules/bd--notes.el b/.config/emacs/modules/bd--notes.el index 80d0a8c..aa1f4b1 100644 --- a/.config/emacs/modules/bd--notes.el +++ b/.config/emacs/modules/bd--notes.el @@ -11,24 +11,24 @@ then pastes the active region." (interactive) (let* ((mode major-mode) - (name (format "*scratch for %s*" mode)) - (contents (when (region-active-p) - (buffer-substring-no-properties - (region-beginning) (region-end)))) - (buf (get-buffer name))) + (name (format "*scratch for %s*" mode)) + (contents (when (region-active-p) + (buffer-substring-no-properties + (region-beginning) (region-end)))) + (buf (get-buffer name))) (pop-to-buffer (with-current-buffer (get-buffer-create name) (funcall mode) (setq-local scratch-buffer t) (when contents - (insert (format "\n\n%s" contents))) + (insert (format "\n\n%s" contents))) (current-buffer))))) (keymap-global-set "C-c s" #'bd/send-to-scratch) ;; default *scratch* must have var set (add-hook 'emacs-startup-hook - (lambda () - (with-current-buffer "*scratch*" - (setq-local scratch-buffer t)))) + (lambda () + (with-current-buffer "*scratch*" + (setq-local scratch-buffer t)))) (advice-add 'scratch-buffer :after (lambda () (setq-local scratch-buffer t))) (use-package denote @@ -55,18 +55,6 @@ then pastes the active region." "Format front matter KEYWORDS for skribe file type. KEYWORDS is a list of strings." (string-join keywords "\" \"")) - (add-to-list 'denote-file-types '(skribe - :extension ".skr" - :date-function bd/denote-skribe-format-date - :front-matter bd/denote-skribe-front-matter - :title-key-regexp "^:title\\s-*" - :title-value-function identity - :title-value-reverse-function denote-trim-whitespace - :keywords-key-regexp "^:tags\\s-*" - :keywords-value-function bd/denote-format-keywords-for-skribe-front-matter - :keywords-value-reverse-function denote-extract-keywords-from-front-matter - :link my-denote-shell-link-format - :link-in-context-regexp my-denote-shell-link-in-context-regexp)) :custom (denote-file-type 'org) (denote-known-keywords '("ss" "writing" "reading" "art" "csu" "umass" "cs" "guix" "emacs" "programs" "mem")) diff --git a/.config/emacs/snippets/org-mode/align-star b/.config/emacs/snippets/org-mode/align-star new file mode 100644 index 0000000..8b49f66 --- /dev/null +++ b/.config/emacs/snippets/org-mode/align-star @@ -0,0 +1,10 @@ +# name: align-star +# key: als +# keybinding : keybinding +# expand-env : () +# contributor : +# expand-env : () +# -- +\begin{align*} +$0 +\end{align*}
\ No newline at end of file diff --git a/.config/emacs/snippets/org-mode/bmatrix b/.config/emacs/snippets/org-mode/bmatrix new file mode 100644 index 0000000..3046913 --- /dev/null +++ b/.config/emacs/snippets/org-mode/bmatrix @@ -0,0 +1,12 @@ +# name: bmatrix +# key: bma +# keybinding : keybinding +# expand-env : () +# contributor : +# expand-env : () +# -- +\begin{equation*} +\begin{bmatrix} +$0 +\end{bmatrix} +\end{equation*}
\ No newline at end of file diff --git a/.config/emacs/snippets/org-mode/equation-star b/.config/emacs/snippets/org-mode/equation-star new file mode 100644 index 0000000..a67ad05 --- /dev/null +++ b/.config/emacs/snippets/org-mode/equation-star @@ -0,0 +1,11 @@ +# -*- mode: snippet -*- +# name: equation-star +# key: eqs +# keybinding : keybinding +# expand-env : () +# contributor : +# expand-env : () +# -- +\begin{equation*} +$0 +\end{equation*}
\ No newline at end of file diff --git a/.config/emacs/snippets/snippet-mode/header b/.config/emacs/snippets/snippet-mode/header new file mode 100644 index 0000000..870a035 --- /dev/null +++ b/.config/emacs/snippets/snippet-mode/header @@ -0,0 +1,14 @@ +# name: header +# key: trigger-key +# keybinding : keybinding +# expand-env : () +# contributor : +# expand-env : () +# -- +# name: +# key: trigger-key +# keybinding : keybinding +# expand-env : () +# contributor : +# expand-env : () +# --
\ No newline at end of file diff --git a/.config/guix/modules/emacs.scm b/.config/guix/modules/emacs.scm index f49b182..ecf820b 100644 --- a/.config/guix/modules/emacs.scm +++ b/.config/guix/modules/emacs.scm @@ -46,6 +46,8 @@ emacs-transient emacs-transmission emacs-visual-fill-column + emacs-yasnippet + emacs-yasnippet-snippets aspell aspell-dict-en |