This commit is contained in:
Zelong Kuang
2025-11-21 01:05:13 +11:00
parent b431e63bd3
commit c8c650ee5f
5 changed files with 13 additions and 70 deletions

View File

@@ -65,12 +65,6 @@
(add-hook 'post-command-hook #'my-yas-try-expanding-auto-snippets) (add-hook 'post-command-hook #'my-yas-try-expanding-auto-snippets)
) )
(use-package! gptel
:config
(setq gptel-model 'claude-sonnet-4.5)
(setq gptel-backend (gptel-make-gh-copilot "Copilot"))
)
(use-package! rainbow-delimiters (use-package! rainbow-delimiters
:hook ((prog-mode . rainbow-delimiters-mode) :hook ((prog-mode . rainbow-delimiters-mode)
(typst-ts-mode . rainbow-delimiters-mode) (typst-ts-mode . rainbow-delimiters-mode)

View File

@@ -96,63 +96,6 @@ Thisenables the feature of auto-expanding snippets when matching the pattern
) )
#+end_src #+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"))))
#+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"))))
#+end_src
*** Copilot
#+begin_src emacs-lisp :tangle no
(package! copilot
:recipe (:host github :repo "copilot-emacs/copilot.el" :files ("*.el")))
#+end_src
Configuration
#+begin_src emacs-lisp :tangle no
;; 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))
: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
*** LLM (gptel)
#+begin_src emacs-lisp
(use-package! gptel
:config
(setq gptel-model 'claude-sonnet-4.5)
(setq gptel-backend (gptel-make-gh-copilot "Copilot"))
)
#+end_src
*** Rainbow delimiters *** Rainbow delimiters
#+begin_src emacs-lisp :tangle packages.el #+begin_src emacs-lisp :tangle packages.el
(package! rainbow-delimiters) (package! rainbow-delimiters)
@@ -163,6 +106,10 @@ Configuration
(typst-ts-mode . rainbow-delimiters-mode) (typst-ts-mode . rainbow-delimiters-mode)
(foo-mode . rainbow-delimiters-mode))) (foo-mode . rainbow-delimiters-mode)))
#+end_src #+end_src
*** Leetcode
#+begin_src emacs-lisp :tangle packages.el
(package! leetcode)
#+end_src
** Lang ** Lang
*** Typst *** Typst
**** Tree-sitter **** Tree-sitter

10
init.el
View File

@@ -35,7 +35,7 @@
;; (emoji +unicode) ; 🙂 ;; (emoji +unicode) ; 🙂
hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW
;; indent-guides ; highlighted indent columns ;; indent-guides ; highlighted indent columns
ligatures ; ligatures and symbols to make your code pretty again ( ligatures +extras) ; ligatures and symbols to make your code pretty again
;;minimap ; show a map of the code on the side ;;minimap ; show a map of the code on the side
;; modeline ; snazzy, Atom-inspired modeline, plus API ;; modeline ; snazzy, Atom-inspired modeline, plus API
;;nav-flash ; blink cursor line after big motions ;;nav-flash ; blink cursor line after big motions
@@ -50,7 +50,7 @@
vi-tilde-fringe ; fringe tildes to mark beyond EOB vi-tilde-fringe ; fringe tildes to mark beyond EOB
;;window-select ; visually switch windows ;;window-select ; visually switch windows
workspaces ; tab emulation, persistence & separate workspaces workspaces ; tab emulation, persistence & separate workspaces
;;zen ; distraction-free coding or writing ( zen +mixed-pitch-mode) ; distraction-free coding or writing
:editor :editor
(evil +everywhere); come to the dark side, we have cookies (evil +everywhere); come to the dark side, we have cookies
@@ -139,7 +139,7 @@
;;gdscript ; the language you waited for ;;gdscript ; the language you waited for
;;(go +lsp) ; the hipster dialect ;;(go +lsp) ; the hipster dialect
;;(graphql +lsp) ; Give queries a REST ;;(graphql +lsp) ; Give queries a REST
;;(haskell +lsp) ; a language that's lazier than I am (haskell +lsp +tree-sitter) ; a language that's lazier than I am
;;hy ; readability of scheme w/ speed of python ;;hy ; readability of scheme w/ speed of python
;;idris ; a language you can depend on ;;idris ; a language you can depend on
( json +lsp +tree-sitter) ; At least it ain't XML ( json +lsp +tree-sitter) ; At least it ain't XML
@@ -161,14 +161,14 @@
;;plantuml ; diagrams for confusing people more ;;plantuml ; diagrams for confusing people more
;;graphviz ; diagrams for confusing yourself even more ;;graphviz ; diagrams for confusing yourself even more
;;purescript ; javascript, but functional ;;purescript ; javascript, but functional
python ; beautiful is better than ugly ( python +lsp +pyright +tree-sitter +poetry) ; beautiful is better than ugly
;;qt ; the 'cutest' gui framework ever ;;qt ; the 'cutest' gui framework ever
;;racket ; a DSL for DSLs ;;racket ; a DSL for DSLs
;;raku ; the artist formerly known as perl6 ;;raku ; the artist formerly known as perl6
;;rest ; Emacs as a REST client ;;rest ; Emacs as a REST client
;;rst ; ReST in peace ;;rst ; ReST in peace
;;(ruby +rails) ; 1.step {|i| p "Ruby is #{i.even? ? 'love' : 'life'}"} ;;(ruby +rails) ; 1.step {|i| p "Ruby is #{i.even? ? 'love' : 'life'}"}
;;(rust +lsp) ; Fe2O3.unwrap().unwrap().unwrap().unwrap() (rust +lsp +tree-sitter) ; Fe2O3.unwrap().unwrap().unwrap().unwrap()
;;scala ; java, but good ;;scala ; java, but good
;;(scheme +guile) ; a fully conniving family of lisps ;;(scheme +guile) ; a fully conniving family of lisps
sh ; she sells {ba,z,fi}sh shells on the C xor sh ; she sells {ba,z,fi}sh shells on the C xor

View File

@@ -8,6 +8,8 @@
(package! rainbow-delimiters) (package! rainbow-delimiters)
(package! leetcode)
(package! typst-ts-mode :recipe (:host codeberg :repo "meow_king/typst-ts-mode")) (package! typst-ts-mode :recipe (:host codeberg :repo "meow_king/typst-ts-mode"))
(package! typst-preview (package! typst-preview

View File

@@ -1,6 +1,6 @@
# -*- mode: snippet -*- # -*- mode: snippet -*-
# name: source block # name: source block
# key: <source # key: <src
# -- # --
#+begin_src ${1:$$(yas-auto-next (yas-completing-read "Language: " (mapcar 'car org-babel-load-languages))) } #+begin_src ${1:$$(yas-auto-next (yas-completing-read "Language: " (mapcar 'car org-babel-load-languages))) }
$0 $0