Compare commits
5 Commits
39f8a4510b
...
4baaaadf02
Author | SHA1 | Date | |
---|---|---|---|
4baaaadf02 | |||
03bde6015f | |||
5631935f8f | |||
edaef817b5 | |||
697edb0cdb |
@ -1,7 +1,7 @@
|
|||||||
#+title: Emacs — Keybinding Managers
|
#+title: Emacs — Keybinding Managers
|
||||||
#+setupfile: ../headers
|
#+setupfile: ../headers
|
||||||
#+property: header-args:emacs-lisp :mkdirp yes :lexical t :exports code
|
#+property: header-args:emacs-lisp :mkdirp yes :lexical t :exports code
|
||||||
#+property: header-args:emacs-lisp+ :tangle ~/.config/emacs/lisp/keybinding-managemers.el
|
#+property: header-args:emacs-lisp+ :tangle ~/.config/emacs/lisp/keybinding-managers.el
|
||||||
#+property: header-args:emacs-lisp+ :mkdirp yes :noweb no-export
|
#+property: header-args:emacs-lisp+ :mkdirp yes :noweb no-export
|
||||||
|
|
||||||
* Keybinding Managers
|
* Keybinding Managers
|
||||||
|
@ -20,7 +20,8 @@ variables to install grammars for different languages.
|
|||||||
json-ts-mode rust-ts-mode tsx-ts-mode python-ts-mode
|
json-ts-mode rust-ts-mode tsx-ts-mode python-ts-mode
|
||||||
css-ts-mode yaml-ts-mode) . lsp-deferred)
|
css-ts-mode yaml-ts-mode) . lsp-deferred)
|
||||||
:init
|
:init
|
||||||
(setq treesit-language-source-alist
|
(setq treesit-font-lock-level 4
|
||||||
|
treesit-language-source-alist
|
||||||
'((astro "https://github.com/virchau13/tree-sitter-astro")
|
'((astro "https://github.com/virchau13/tree-sitter-astro")
|
||||||
(bash "https://github.com/tree-sitter/tree-sitter-bash")
|
(bash "https://github.com/tree-sitter/tree-sitter-bash")
|
||||||
(c "https://github.com/tree-sitter/tree-sitter-c")
|
(c "https://github.com/tree-sitter/tree-sitter-c")
|
||||||
@ -288,6 +289,7 @@ You can find the keybinds of Treemacs here.
|
|||||||
[remap xref-find-apropos] #'consult-lsp-symbols))
|
[remap xref-find-apropos] #'consult-lsp-symbols))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
*** dap-mode
|
||||||
~dap-mode~ is an advanced debugging mode that works through LSP. Note
|
~dap-mode~ is an advanced debugging mode that works through LSP. Note
|
||||||
that currently, ~dap-firefox~ and ~dap-chrome~ don’t work correctly due to
|
that currently, ~dap-firefox~ and ~dap-chrome~ don’t work correctly due to
|
||||||
[[https://github.com/emacs-lsp/dap-mode/issues/547][this issue]]. A workaround can be found in [[https://github.com/emacs-lsp/dap-mode/issues/554#issuecomment-1171256089][this comment]] though.
|
[[https://github.com/emacs-lsp/dap-mode/issues/547][this issue]]. A workaround can be found in [[https://github.com/emacs-lsp/dap-mode/issues/554#issuecomment-1171256089][this comment]] though.
|
||||||
@ -1669,43 +1671,16 @@ Tide enabled interactivity with Typescript.
|
|||||||
"roi" #'tide-organize-imports))
|
"roi" #'tide-organize-imports))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
*** Zig
|
**** Vue
|
||||||
[[https://ziglang.org/][Zig]] is to C kind of what Rust is to C++: a modern replacement without
|
There isn’t really any configuration in this heading, but an important
|
||||||
sacrificing performance. It is much safer than C while providing
|
note concerning the usage of LSP with Vue. If the packages =typescript=
|
||||||
interop with it. Plus, its [[https://ziglang.org/documentation/master/std/][standard library]] is pretty complete.
|
and =vue-tsc= are not in the =package.json= of a project, =volar= (or
|
||||||
|
=vue-semantic-server= according to =lsp-mode=) won’t start properly. The
|
||||||
First, here is its major mode.
|
simplest fix is to run the following command:
|
||||||
#+begin_src emacs-lisp
|
#+begin_src sh
|
||||||
(use-package zig-mode
|
npm install --save-dev vue-tsc typescript
|
||||||
:defer t
|
|
||||||
:straight (:build t)
|
|
||||||
:after flycheck
|
|
||||||
:hook (zig-mode . lsp-deferred)
|
|
||||||
:config
|
|
||||||
;; This is from DoomEmacs
|
|
||||||
(flycheck-define-checker zig
|
|
||||||
"A zig syntax checker using the zig-fmt interpreter."
|
|
||||||
:command ("zig" "fmt" (eval (buffer-file-name)))
|
|
||||||
:error-patterns
|
|
||||||
((error line-start (file-name) ":" line ":" column ": error: " (message) line-end))
|
|
||||||
:modes zig-mode)
|
|
||||||
(add-to-list 'flycheck-checkers 'zig)
|
|
||||||
:general
|
|
||||||
(phundrak/major-leader-key
|
|
||||||
:keymaps 'zip-mode-map
|
|
||||||
:packages 'lsp-mode
|
|
||||||
"l" '(:keymap lsp-command-map :which-key "lsp"))
|
|
||||||
(phundrak/major-leader-key
|
|
||||||
:packages 'zig-mode
|
|
||||||
:keymaps 'zig-mode-map
|
|
||||||
"c" #'zig-compile
|
|
||||||
"f" #'zig-format-buffer
|
|
||||||
"r" #'zig-run
|
|
||||||
"t" #'zig-test-buffer))
|
|
||||||
#+end_src
|
#+end_src
|
||||||
|
Or replace =npm= with whichever package manager you prefer.
|
||||||
|
|
||||||
For LSP to work, we need ~zls~ to be installed. In my case, as I am on
|
If you want to work with Vue in Emacs, =web-mode= is more than enough
|
||||||
Arch Linux, I can install it from the AUR, and my AUR helper is ~paru~.
|
when paired with an LSP server.
|
||||||
#+begin_src fish :results raw :wrap "src text" :exports code
|
|
||||||
paru --skipreview --noconfirm -S zls-bin 2>&1
|
|
||||||
#+end_src
|
|
||||||
|
Loading…
Reference in New Issue
Block a user