mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-04-25 10:18:37 +02:00
fix: emacs - code highlighting is buggy, remove lsp-bridge, add lsp-mode & copilot
fix: emacs - unicode symbols rendering is buggy, remove +pretty from org-mode feat: emacs - add pandoc & jupyter for orgmode
This commit is contained in:
@@ -51,6 +51,13 @@ just emacs-reload
|
|||||||
just emacs-clean
|
just emacs-clean
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Limits
|
||||||
|
|
||||||
|
|
||||||
|
- Emacs's markdown-mode works not well with tables, see:
|
||||||
|
- https://github.com/jrblevin/markdown-mode/issues/380
|
||||||
|
|
||||||
|
|
||||||
## Cheetsheet
|
## Cheetsheet
|
||||||
|
|
||||||
Here is the cheetsheet related to my DoomEmacs configs. Please read vim's common cheetsheet at [../README.md](../README.md) before reading the following.
|
Here is the cheetsheet related to my DoomEmacs configs. Please read vim's common cheetsheet at [../README.md](../README.md) before reading the following.
|
||||||
|
|||||||
@@ -72,11 +72,6 @@ in {
|
|||||||
force = true;
|
force = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
xdg.configFile."emacs/lsp-bridge-user-langserver" = {
|
|
||||||
source = ./lsp-bridge-user-langserver;
|
|
||||||
force = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
home.activation.installDoomEmacs = lib.hm.dag.entryAfter ["writeBoundary"] ''
|
home.activation.installDoomEmacs = lib.hm.dag.entryAfter ["writeBoundary"] ''
|
||||||
${pkgs.rsync}/bin/rsync -avz --chmod=D2755,F744 ${doomemacs}/ ${config.xdg.configHome}/emacs/
|
${pkgs.rsync}/bin/rsync -avz --chmod=D2755,F744 ${doomemacs}/ ${config.xdg.configHome}/emacs/
|
||||||
|
|
||||||
|
|||||||
@@ -96,41 +96,21 @@
|
|||||||
;; You can also try 'gd' (or 'C-c c d') to jump to their definition and see how
|
;; You can also try 'gd' (or 'C-c c d') to jump to their definition and see how
|
||||||
;; they are implemented.
|
;; they are implemented.
|
||||||
|
|
||||||
(after! vterm
|
|
||||||
(setq vterm-shell "nu")) ; use nushell by defualt
|
|
||||||
|
|
||||||
(use-package! lsp-bridge
|
|
||||||
:config
|
|
||||||
(setq lsp-bridge-enable-log nil) ;; disabled for performance
|
|
||||||
;; for user's custom langserver file
|
|
||||||
(setq lsp-bridge-user-langserver-dir "~/.config/emacs/lsp-bridge-user-langserver")
|
|
||||||
(setq lsp-bridge-enable-auto-format-code 1)
|
|
||||||
(global-lsp-bridge-mode))
|
|
||||||
|
|
||||||
(use-package! wakatime-mode :ensure t)
|
|
||||||
;; fully enable tree-sitter highlighting
|
|
||||||
(after! tree-sitter
|
|
||||||
(setq +tree-sitter-hl-enabled-modes t))
|
|
||||||
|
|
||||||
;; fix: https://github.com/jrblevin/markdown-mode/issues/380
|
|
||||||
;; even add this one, editing a large markdown table is still very slow.
|
|
||||||
;; so avoid editing large markdown file in emacs, use neovim instead...
|
|
||||||
;; and this setting make vterm's color theme not work!
|
|
||||||
;; (after! markdown-mode
|
|
||||||
;; (global-font-lock-mode 0))
|
|
||||||
|
|
||||||
;; use alejandra to format nix files
|
;; use alejandra to format nix files
|
||||||
;; (use-package! lsp-nix
|
(use-package! lsp-nix
|
||||||
;; :ensure lsp-mode
|
:ensure lsp-mode
|
||||||
;; :after
|
:after
|
||||||
;; (lsp-mode)
|
(lsp-mode)
|
||||||
;; :demand t
|
:demand t
|
||||||
;; :custom
|
:custom
|
||||||
;; (lsp-nix-nil-formatter
|
(lsp-nix-nil-formatter
|
||||||
;; ["alejandra"]))
|
["alejandra"]))
|
||||||
|
|
||||||
(use-package! nushell-mode
|
(use-package! nushell-mode
|
||||||
:config
|
:config
|
||||||
(setq nushell-enable-auto-indent 1))
|
(setq nushell-enable-auto-indent 1))
|
||||||
|
(after! vterm
|
||||||
|
(setq vterm-shell "nu")) ; use nushell by defualt
|
||||||
|
|
||||||
;; emacs-rime
|
;; emacs-rime
|
||||||
(use-package! rime
|
(use-package! rime
|
||||||
@@ -179,3 +159,16 @@
|
|||||||
;; save on find-file
|
;; save on find-file
|
||||||
(add-to-list 'super-save-hook-triggers 'find-file-hook)
|
(add-to-list 'super-save-hook-triggers 'find-file-hook)
|
||||||
|
|
||||||
|
(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))
|
||||||
|
:config
|
||||||
|
(copilot-mode +1))
|
||||||
|
|
||||||
|
(use-package! wakatime-mode :ensure t)
|
||||||
|
|||||||
@@ -61,7 +61,7 @@
|
|||||||
(format +onsave)
|
(format +onsave)
|
||||||
; automated prettiness
|
; automated prettiness
|
||||||
;; multiple-cursors ; editing in many places at once
|
;; multiple-cursors ; editing in many places at once
|
||||||
;; objed ; text object editing for the innocent
|
;; objed ; text object editing for the innocent, conflict with parinfer
|
||||||
parinfer ; turn lisp into python, sort of, conflict with copilot/objed/smartparens
|
parinfer ; turn lisp into python, sort of, conflict with copilot/objed/smartparens
|
||||||
;;rotate-text ; cycle region at point between text candidates
|
;;rotate-text ; cycle region at point between text candidates
|
||||||
snippets ; my elves. They type so I don't have to
|
snippets ; my elves. They type so I don't have to
|
||||||
@@ -98,7 +98,7 @@
|
|||||||
(eval +overlay)
|
(eval +overlay)
|
||||||
; run code, run (also, repls)
|
; run code, run (also, repls)
|
||||||
lookup ; navigate your code and its documentation
|
lookup ; navigate your code and its documentation
|
||||||
;; lsp ; lsp-mode, conflict with lsp-bridge
|
lsp ; lsp-mode, conflict with lsp-bridge
|
||||||
magit ; a git porcelain for Emacs
|
magit ; a git porcelain for Emacs
|
||||||
;;make ; run make tasks from Emacs
|
;;make ; run make tasks from Emacs
|
||||||
;;pass ; password manager for nerds
|
;;pass ; password manager for nerds
|
||||||
@@ -117,7 +117,7 @@
|
|||||||
:lang
|
:lang
|
||||||
;;agda ; types of types of types of types...
|
;;agda ; types of types of types of types...
|
||||||
;;beancount ; mind the GAAP
|
;;beancount ; mind the GAAP
|
||||||
(cc +tree-sitter)
|
(cc +lsp +tree-sitter)
|
||||||
; C > C++ == 1
|
; C > C++ == 1
|
||||||
;;clojure ; java with a lisp
|
;;clojure ; java with a lisp
|
||||||
;;common-lisp ; if you've seen one lisp, you've seen them all
|
;;common-lisp ; if you've seen one lisp, you've seen them all
|
||||||
@@ -138,17 +138,17 @@
|
|||||||
;;fsharp ; ML stands for Microsoft's Language
|
;;fsharp ; ML stands for Microsoft's Language
|
||||||
;;fstar ; (dependent) types and (monadic) effects and Z3
|
;;fstar ; (dependent) types and (monadic) effects and Z3
|
||||||
;;gdscript ; the language you waited for
|
;;gdscript ; the language you waited for
|
||||||
(go +tree-sitter) ;; disable go-mode, use lsp-bridge instead
|
(go +lsp +tree-sitter) ;; disable go-mode, use lsp-bridge instead
|
||||||
; the hipster dialect
|
; the hipster dialect
|
||||||
;;(graphql) ; Give queries a REST
|
;;(graphql) ; Give queries a REST
|
||||||
;;(haskell) ; a language that's lazier than I am
|
;;(haskell) ; 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 +tree-sitter)
|
(json +lsp +tree-sitter)
|
||||||
; At least it ain't XML
|
; At least it ain't XML
|
||||||
(java +tree-sitter)
|
(java +lsp +tree-sitter)
|
||||||
; the poster child for carpal tunnel syndrome
|
; the poster child for carpal tunnel syndrome
|
||||||
(javascript +tree-sitter)
|
(javascript +lsp +tree-sitter)
|
||||||
; all(hope(abandon(ye(who(enter(here))))))
|
; all(hope(abandon(ye(who(enter(here))))))
|
||||||
;;julia ; a better, faster MATLAB
|
;;julia ; a better, faster MATLAB
|
||||||
;;kotlin ; a better, slicker Java(Script)
|
;;kotlin ; a better, slicker Java(Script)
|
||||||
@@ -156,19 +156,19 @@
|
|||||||
; writing papers in Emacs has never been so fun
|
; writing papers in Emacs has never been so fun
|
||||||
;;lean ; for folks with too much to prove
|
;;lean ; for folks with too much to prove
|
||||||
;;ledger ; be audit you can be
|
;;ledger ; be audit you can be
|
||||||
(lua +tree-sitter)
|
(lua +lsp +tree-sitter)
|
||||||
; one-based indices? one-based indices
|
; one-based indices? one-based indices
|
||||||
(markdown +grip)
|
(markdown +grip)
|
||||||
; writing docs for people to ignore
|
; writing docs for people to ignore
|
||||||
;;nim ; python + lisp at the speed of c
|
;;nim ; python + lisp at the speed of c
|
||||||
(nix +tree-sitter)
|
(nix +lsp +tree-sitter)
|
||||||
; I hereby declare "nix geht mehr!"
|
; I hereby declare "nix geht mehr!"
|
||||||
;;ocaml ; an objective camel
|
;;ocaml ; an objective camel
|
||||||
(org +pandoc +present +roam2 +hugo +pretty) ; organize your plain life in plain text
|
(org +pandoc +hugo +jupyter) ; organize your plain life in plain text
|
||||||
;;php ; perl's insecure younger brother
|
;;php ; perl's insecure younger brother
|
||||||
;;plantuml ; diagrams for confusing people more
|
;;plantuml ; diagrams for confusing people more
|
||||||
;;purescript ; javascript, but functional
|
;;purescript ; javascript, but functional
|
||||||
(python +tree-sitter +pyright)
|
(python +lsp +tree-sitter +pyright)
|
||||||
; beautiful is better than ugly
|
; 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
|
||||||
@@ -176,20 +176,20 @@
|
|||||||
;;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 +tree-sitter)
|
(rust +lsp +tree-sitter)
|
||||||
; Fe2O3.unwrap().unwrap().unwrap().unwrap()
|
; Fe2O3.unwrap().unwrap().unwrap().unwrap()
|
||||||
;;scala ; java, but good
|
;;scala ; java, but good
|
||||||
(scheme +guile)
|
(scheme +guile)
|
||||||
; a fully conniving family of lisps
|
; a fully conniving family of lisps
|
||||||
(sh +tree-sitter)
|
(sh +lsp +tree-sitter)
|
||||||
; she sells {ba,z,fi}sh shells on the C xor
|
; she sells {ba,z,fi}sh shells on the C xor
|
||||||
;;sml
|
;;sml
|
||||||
;;solidity ; do you need a blockchain? No.
|
;;solidity ; do you need a blockchain? No.
|
||||||
;;swift ; who asked for emoji variables?
|
;;swift ; who asked for emoji variables?
|
||||||
;;terra ; Earth and Moon in alignment for performance.
|
;;terra ; Earth and Moon in alignment for performance.
|
||||||
(web +tree-sitter)
|
(web +lsp +tree-sitter)
|
||||||
; support for various web languages, including HTML5, CSS, SASS/SCSS, Pug/Jade/Slim, and more
|
; support for various web languages, including HTML5, CSS, SASS/SCSS, Pug/Jade/Slim, and more
|
||||||
(yaml +tree-sitter)
|
(yaml +lsp +tree-sitter)
|
||||||
; JSON, but readable
|
; JSON, but readable
|
||||||
;;zig ; C, but simpler
|
;;zig ; C, but simpler
|
||||||
|
|
||||||
|
|||||||
@@ -15,15 +15,10 @@
|
|||||||
(package! nushell-mode :recipe
|
(package! nushell-mode :recipe
|
||||||
(:host github :repo "mrkkrp/nushell-mode"))
|
(:host github :repo "mrkkrp/nushell-mode"))
|
||||||
|
|
||||||
(when (package! lsp-bridge
|
(package! copilot
|
||||||
:recipe (:host github
|
:recipe
|
||||||
:repo "manateelazycat/lsp-bridge"
|
(:host github :repo "copilot-emacs/copilot.el" :files
|
||||||
:branch "master"
|
("*.el" "dist")))
|
||||||
:files ("*.el" "*.py" "acm" "core" "langserver" "multiserver" "resources")
|
|
||||||
;; do not perform byte compilation or native compilation for lsp-bridge
|
|
||||||
:build (:not compile)))
|
|
||||||
(package! markdown-mode)
|
|
||||||
(package! yasnippet))
|
|
||||||
|
|
||||||
;; To install SOME-PACKAGE from MELPA, ELPA or emacsmirror:
|
;; To install SOME-PACKAGE from MELPA, ELPA or emacsmirror:
|
||||||
;; (package! some-package)
|
;; (package! some-package)
|
||||||
|
|||||||
@@ -1,10 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "nil",
|
|
||||||
"languageId": "nix",
|
|
||||||
"command": ["nil"],
|
|
||||||
"settings": {
|
|
||||||
"nil": {
|
|
||||||
"formatting": { "command": ["alejandra"] }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
checkmake
|
checkmake
|
||||||
# c/c++ compiler, required by nvim-treesitter!
|
# c/c++ compiler, required by nvim-treesitter!
|
||||||
gcc
|
gcc
|
||||||
# c/c++ tools with clang-tools, the unwrapped version won't
|
# c/c++ tools with clang-tools, the unwrapped version won't
|
||||||
# add alias like `cc` and `c++`, so that it won't conflict with gcc
|
# add alias like `cc` and `c++`, so that it won't conflict with gcc
|
||||||
llvmPackages.clang-unwrapped
|
llvmPackages.clang-unwrapped
|
||||||
lldb
|
lldb
|
||||||
@@ -27,6 +27,7 @@
|
|||||||
ruff-lsp
|
ruff-lsp
|
||||||
black # python formatter
|
black # python formatter
|
||||||
|
|
||||||
|
jupyter
|
||||||
ipython
|
ipython
|
||||||
pandas
|
pandas
|
||||||
requests
|
requests
|
||||||
@@ -120,6 +121,7 @@
|
|||||||
marksman # language server for markdown
|
marksman # language server for markdown
|
||||||
glow # markdown previewer
|
glow # markdown previewer
|
||||||
fzf
|
fzf
|
||||||
|
pandoc # document converter
|
||||||
|
|
||||||
#-- Optional Requirements:
|
#-- Optional Requirements:
|
||||||
gdu # disk usage analyzer, required by AstroNvim
|
gdu # disk usage analyzer, required by AstroNvim
|
||||||
|
|||||||
Reference in New Issue
Block a user