Skip to content

Instantly share code, notes, and snippets.

@aamedina
Created March 13, 2024 15:10
Show Gist options
  • Save aamedina/b3258f3755163c515a5b772e4117a110 to your computer and use it in GitHub Desktop.
Save aamedina/b3258f3755163c515a5b772e4117a110 to your computer and use it in GitHub Desktop.
(use-package lsp-mode
:ensure t
:bind (:map lsp-mode-map
("M-." . lsp-find-definition)
("TAB" . company-indent-or-complete-common))
:hook ((typescript-ts-mode . lsp-deferred)
(js-mode . lsp-deferred)
(js2-mode . lsp-deferred)
(js-jsx-mode . lsp-deferred)
(tsx-ts-mode . lsp-deferred)
(clojure-mode . lsp-deferred))
:init (setq treesit-language-source-alist
'((bash "https://github.com/tree-sitter/tree-sitter-bash")
(cmake "https://github.com/uyha/tree-sitter-cmake")
(css "https://github.com/tree-sitter/tree-sitter-css")
(elisp "https://github.com/Wilfred/tree-sitter-elisp")
(go "https://github.com/tree-sitter/tree-sitter-go")
(html "https://github.com/tree-sitter/tree-sitter-html")
(javascript "https://github.com/tree-sitter/tree-sitter-javascript" "master" "src")
(json "https://github.com/tree-sitter/tree-sitter-json")
(make "https://github.com/alemuller/tree-sitter-make")
(markdown "https://github.com/ikatyang/tree-sitter-markdown")
(python "https://github.com/tree-sitter/tree-sitter-python")
(toml "https://github.com/tree-sitter/tree-sitter-toml")
(tsx "https://github.com/tree-sitter/tree-sitter-typescript" "master" "tsx/src")
(typescript "https://github.com/tree-sitter/tree-sitter-typescript" "master" "typescript/src")
(yaml "https://github.com/ikatyang/tree-sitter-yaml"))))
;; to install the grammars
;; (mapc #'treesit-install-language-grammar (mapcar #'car treesit-language-source-alist))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment