mirror of
https://github.com/js0ny/dotfiles.git
synced 2025-12-21 08:43:00 +00:00
feat(emacs): implement tree-sitter
This commit is contained in:
parent
707e837753
commit
2ef99c209c
4 changed files with 40 additions and 15 deletions
12
tools/emacs.d/lisp/init-lang.el
Normal file
12
tools/emacs.d/lisp/init-lang.el
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
;;; init-lang.el
|
||||
|
||||
;; (use-package lsp-mode
|
||||
;; :commands (lsp lsp-deferred)
|
||||
;; :hook (prog-mode . lsp-deferred))
|
||||
|
||||
|
||||
|
||||
;; (setq package-check-signature t)
|
||||
|
||||
(provide 'init-lang)
|
||||
;;; init-lang.el ends
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
;;; init-lsp.el
|
||||
;;; First edit on 2025/01/29
|
||||
;;; Stores Language Server Protocol Configs
|
||||
;;; FIXME: Cannot install `lsp-mode` plugin, this file will not be loaded by Emacs for now
|
||||
|
||||
(use-package lsp-mode
|
||||
:commands (lsp lsp-deferred)
|
||||
:hook (prog-mode . lsp-deferred))
|
||||
|
||||
|
||||
;; (setq package-check-signature t)
|
||||
(provide 'init-lsp)
|
||||
;;; init-lsp.el ends
|
||||
20
tools/emacs.d/lisp/init-treesitter.el
Normal file
20
tools/emacs.d/lisp/init-treesitter.el
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
;;; init-treesitter.el tree-sitter integration for emacs
|
||||
;;; Reference: https://emacs.liujiacai.net/post/038-hello-treesitter/
|
||||
;;; Download: https://github.com/emacs-tree-sitter/tree-sitter-langs/releases/tag/0.12.268
|
||||
|
||||
|
||||
(add-to-list 'treesit-extra-load-path (expand-file-name "tree-sitter" user-emacs-data))
|
||||
|
||||
(setq major-mode-remap-alist
|
||||
'((yaml-mode . yaml-ts-mode)
|
||||
(sh-mode . bash-ts-mode)
|
||||
(js-mode . js-ts-mode)
|
||||
(css-mode . css-ts-mode)
|
||||
(c-mode . c-ts-mode)
|
||||
(c++-mode . c++-ts-mode)
|
||||
(c-or-c++-mode . c-or-c++-ts-mode)
|
||||
(python-mode . python-ts-mode)
|
||||
(js-json-mode . json-ts-mode)))
|
||||
|
||||
|
||||
(provide 'init-treesitter)
|
||||
Loading…
Add table
Add a link
Reference in a new issue