Update
This commit is contained in:
134
config.org
134
config.org
@@ -1,83 +1,85 @@
|
||||
* My doom config
|
||||
** Some tweak
|
||||
*** change indent size
|
||||
#+begin_src emacs-lisp
|
||||
(setq-default tab-width 4)
|
||||
#+end_src
|
||||
** Appearance settings
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
(setq doom-font (font-spec :family "Maple Mono" :size 20))
|
||||
(add-to-list 'default-frame-alist '(height . 53))
|
||||
(add-to-list 'default-frame-alist '(width . 120))
|
||||
(setq catppuccin-flavor 'mocha)
|
||||
(setq doom-theme 'catppuccin)
|
||||
(setq display-line-numbers-type 'relative)
|
||||
(setq org-directory "~/org/")
|
||||
#+end_src
|
||||
*** Themes
|
||||
Catppuccin
|
||||
**** Catppuccin
|
||||
#+begin_src emacs-lisp :tangle packages.el
|
||||
(package! catppuccin-theme)
|
||||
#+end_src
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
(setq catppuccin-flavor 'mocha)
|
||||
(catppuccin-reload)
|
||||
#+end_src
|
||||
|
||||
** Plugins
|
||||
*** Yasnippet
|
||||
This enables the feature of auto-expanding snippets when matching the pattern
|
||||
#+begin_src emacs-lisp
|
||||
(after! yasnippet
|
||||
(defun my-yas-try-expanding-auto-snippets ()
|
||||
(when yas-minor-mode
|
||||
(let ((yas-buffer-local-condition ''(require-snippet-condition . auto)))
|
||||
(yas-expand))))
|
||||
(add-hook 'post-command-hook #'my-yas-try-expanding-auto-snippets))
|
||||
(use-package! yasnippet
|
||||
:config
|
||||
(defun my-yas-try-expanding-auto-snippets ()
|
||||
(when yas-minor-mode
|
||||
(let ((yas-buffer-local-condition ''(require-snippet-condition . auto)))
|
||||
(yas-expand))))
|
||||
(add-hook 'post-command-hook #'my-yas-try-expanding-auto-snippets)
|
||||
)
|
||||
#+end_src
|
||||
|
||||
*** Eat (deprecated)
|
||||
#+begin_src emacs-lisp :tangle no
|
||||
(package! eat
|
||||
:recipe (:type git
|
||||
:host codeberg
|
||||
:repo "akib/emacs-eat"
|
||||
:files ("*.el" ("term" "term/*.el") "*.texi"
|
||||
"*.ti" ("terminfo/e" "terminfo/e/*")
|
||||
("terminfo/65" "terminfo/65/*")
|
||||
("integration" "integration/*")
|
||||
(:exclude ".dir-locals.el" "*-tests.el"))))
|
||||
:recipe (:type git
|
||||
:host codeberg
|
||||
:repo "akib/emacs-eat"
|
||||
:files ("*.el" ("term" "term/*.el") "*.texi"
|
||||
"*.ti" ("terminfo/e" "terminfo/e/*")
|
||||
("terminfo/65" "terminfo/65/*")
|
||||
("integration" "integration/*")
|
||||
(:exclude ".dir-locals.el" "*-tests.el"))))
|
||||
#+end_src
|
||||
|
||||
Fix the issue that backspace doesn't work on mac
|
||||
#+begin_src emacs-lisp :tangle no
|
||||
(after! eat
|
||||
(when (eq system-type 'darwin)
|
||||
(define-key eat-semi-char-mode-map (kbd "C-h") #'eat-self-input)
|
||||
(define-key eat-semi-char-mode-map (kbd "<backspace>") (kbd "C-h"))))
|
||||
(when (eq system-type 'darwin)
|
||||
(define-key eat-semi-char-mode-map (kbd "C-h") #'eat-self-input)
|
||||
(define-key eat-semi-char-mode-map (kbd "<backspace>") (kbd "C-h"))))
|
||||
#+end_src
|
||||
|
||||
*** Copilot
|
||||
#+begin_src emacs-lisp :tangle packages.el
|
||||
(package! copilot
|
||||
:recipe (:host github :repo "copilot-emacs/copilot.el" :files ("*.el")))
|
||||
:recipe (:host github :repo "copilot-emacs/copilot.el" :files ("*.el")))
|
||||
#+end_src
|
||||
|
||||
Configuration
|
||||
#+begin_src emacs-lisp
|
||||
;; accept completion from copilot and fallback to company
|
||||
(use-package! copilot
|
||||
:hook (prog-mode . copilot-mode)
|
||||
:bind (:map copilot-completion-map
|
||||
("<tab>" . 'copilot-accept-completion)
|
||||
("TAB" . 'copilot-accept-completion)
|
||||
("C-TAB" . 'copilot-accept-completion-by-word)
|
||||
("C-<tab>" . 'copilot-accept-completion-by-word)
|
||||
("C-n" . 'copilot-next-completion)
|
||||
("C-p" . 'copilot-previous-completion))
|
||||
:hook (prog-mode . copilot-mode)
|
||||
:bind (:map copilot-completion-map
|
||||
("<tab>" . 'copilot-accept-completion)
|
||||
("TAB" . 'copilot-accept-completion)
|
||||
("C-TAB" . 'copilot-accept-completion-by-word)
|
||||
("C-<tab>" . 'copilot-accept-completion-by-word)
|
||||
("C-n" . 'copilot-next-completion)
|
||||
("C-p" . 'copilot-previous-completion))
|
||||
|
||||
:config
|
||||
(add-to-list 'copilot-indentation-alist '(prog-mode 2))
|
||||
(add-to-list 'copilot-indentation-alist '(org-mode 2))
|
||||
(add-to-list 'copilot-indentation-alist '(text-mode 2))
|
||||
(add-to-list 'copilot-indentation-alist '(clojure-mode 2))
|
||||
(add-to-list 'copilot-indentation-alist '(emacs-lisp-mode 2)))
|
||||
:config
|
||||
(add-to-list 'copilot-indentation-alist '(prog-mode 2))
|
||||
(add-to-list 'copilot-indentation-alist '(org-mode 2))
|
||||
(add-to-list 'copilot-indentation-alist '(text-mode 2))
|
||||
(add-to-list 'copilot-indentation-alist '(clojure-mode 2))
|
||||
(add-to-list 'copilot-indentation-alist '(emacs-lisp-mode 2)))
|
||||
#+end_src
|
||||
|
||||
** Lang
|
||||
@@ -89,47 +91,51 @@ Configuration
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
(use-package! typst-ts-mode
|
||||
:custom
|
||||
;; (typst-ts-watch-options "--open")
|
||||
(typst-ts-mode-grammar-location (expand-file-name "tree-sitter/libtree-sitter-typst.so" user-emacs-directory))
|
||||
(typst-ts-mode-enable-raw-blocks-highlight t)
|
||||
:config
|
||||
(keymap-set typst-ts-mode-map "C-c C-c" #'typst-ts-tmenu))
|
||||
:init
|
||||
(add-hook 'typst-ts-mode-hook #'eglot-ensure)
|
||||
:custom
|
||||
;; (typst-ts-watch-options "--open")
|
||||
(typst-ts-mode-grammar-location (expand-file-name "tree-sitter/libtree-sitter-typst.so" user-emacs-directory))
|
||||
(typst-ts-mode-enable-raw-blocks-highlight t)
|
||||
:config
|
||||
(keymap-set typst-ts-mode-map "C-c C-c" #'typst-ts-tmenu))
|
||||
#+end_src
|
||||
|
||||
**** Tinymist (lsp)
|
||||
#+begin_src emacs-lisp
|
||||
(with-eval-after-load 'eglot
|
||||
(with-eval-after-load 'typst-ts-mode
|
||||
(add-to-list 'eglot-server-programs
|
||||
`((typst-ts-mode) .
|
||||
,(eglot-alternatives `(,typst-ts-lsp-download-path
|
||||
"tinymist"
|
||||
"typst-lsp"))))))
|
||||
(with-eval-after-load 'typst-ts-mode
|
||||
(add-to-list 'eglot-server-programs
|
||||
`((typst-ts-mode) .
|
||||
,(eglot-alternatives `(,"tinymist"
|
||||
"typst-lsp"))))))
|
||||
#+end_src
|
||||
|
||||
**** Live-preview
|
||||
#+begin_src emacs-lisp :tangle packages.el
|
||||
(package! typst-preview
|
||||
:recipe (:host github :repo "havarddj/typst-preview.el"))
|
||||
:recipe (:host github :repo "havarddj/typst-preview.el"))
|
||||
#+end_src
|
||||
|
||||
***** Config
|
||||
#+begin_src emacs-lisp
|
||||
(use-package! websocket)
|
||||
(use-package! typst-preview
|
||||
;; :load-path "path/to/typst-preview.el" ;; if installed manually
|
||||
:init
|
||||
(setq typst-preview-autostart t) ; start preview automatically when typst-preview-mode is activated
|
||||
;; (setq typst-preview-open-browser-automatically t) ; open browser automatically when typst-preview-start is run
|
||||
;; :load-path "path/to/typst-preview.el" ;; if installed manually
|
||||
:init
|
||||
(setq typst-preview-autostart t) ; start preview automatically when typst-preview-mode is activated
|
||||
;; (setq typst-preview-open-browser-automatically t) ; open browser automatically when typst-preview-start is run
|
||||
|
||||
:custom
|
||||
(typst-preview-browser "default") ; this is the default option; other options are `eaf-browser' or `xwidget'.
|
||||
(typst-preview-invert-colors "auto") ; invert colors depending on system theme
|
||||
(typst-preview-executable "tinymist") ; path to tinymist binary (relative or absolute)
|
||||
(typst-preview-partial-rendering t) ; enable partial rendering
|
||||
:custom
|
||||
(typst-preview-browser "default") ; this is the default option; other options are `eaf-browser' or `xwidget'.
|
||||
(typst-preview-invert-colors "auto") ; invert colors depending on system theme
|
||||
(typst-preview-executable "tinymist") ; path to tinymist binary (relative or absolute)
|
||||
(typst-preview-partial-rendering t) ; enable partial rendering
|
||||
|
||||
:config
|
||||
(define-key typst-preview-mode-map (kbd "C-c C-j") 'typst-preview-send-position)
|
||||
(define-key typst-ts-mode-map (kbd "C-c C-l") #'typst-preview-mode))
|
||||
:config
|
||||
(define-key typst-preview-mode-map (kbd "C-c C-j") 'typst-preview-send-position)
|
||||
(define-key typst-ts-mode-map (kbd "C-c C-l") #'typst-preview-mode))
|
||||
#+end_src
|
||||
|
||||
#+RESULTS:
|
||||
: t
|
||||
|
||||
Reference in New Issue
Block a user