Compare commits

..

5 Commits

2 changed files with 15 additions and 40 deletions

View File

@ -1,7 +1,7 @@
#+title: Emacs — Keybinding Managers
#+setupfile: ../headers
#+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
* Keybinding Managers

View File

@ -20,7 +20,8 @@ variables to install grammars for different languages.
json-ts-mode rust-ts-mode tsx-ts-mode python-ts-mode
css-ts-mode yaml-ts-mode) . lsp-deferred)
:init
(setq treesit-language-source-alist
(setq treesit-font-lock-level 4
treesit-language-source-alist
'((astro "https://github.com/virchau13/tree-sitter-astro")
(bash "https://github.com/tree-sitter/tree-sitter-bash")
(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))
#+end_src
*** dap-mode
~dap-mode~ is an advanced debugging mode that works through LSP. Note
that currently, ~dap-firefox~ and ~dap-chrome~ dont 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.
@ -1669,43 +1671,16 @@ Tide enabled interactivity with Typescript.
"roi" #'tide-organize-imports))
#+end_src
*** Zig
[[https://ziglang.org/][Zig]] is to C kind of what Rust is to C++: a modern replacement without
sacrificing performance. It is much safer than C while providing
interop with it. Plus, its [[https://ziglang.org/documentation/master/std/][standard library]] is pretty complete.
First, here is its major mode.
#+begin_src emacs-lisp
(use-package zig-mode
: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))
**** Vue
There isnt really any configuration in this heading, but an important
note concerning the usage of LSP with Vue. If the packages =typescript=
and =vue-tsc= are not in the =package.json= of a project, =volar= (or
=vue-semantic-server= according to =lsp-mode=) wont start properly. The
simplest fix is to run the following command:
#+begin_src sh
npm install --save-dev vue-tsc typescript
#+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
Arch Linux, I can install it from the AUR, and my AUR helper is ~paru~.
#+begin_src fish :results raw :wrap "src text" :exports code
paru --skipreview --noconfirm -S zls-bin 2>&1
#+end_src
If you want to work with Vue in Emacs, =web-mode= is more than enough
when paired with an LSP server.