diff --git a/init.org b/init.org index 18a239f..68682fc 100644 --- a/init.org +++ b/init.org @@ -739,6 +739,8 @@ See the excellent documentation on [[https://github.com/minad/consult][Minad's c ** Evil Vim Keybindings #+BEGIN_SRC emacs-lisp + (keymap-global-set "C-c v" vc-prefix-map) + (keymap-global-set "C-c p" project-prefix-map) (when snm-enable-evil ;; load evil (use-package evil @@ -761,11 +763,9 @@ See the excellent documentation on [[https://github.com/minad/consult][Minad's c ;; make vc commands available via leader key (evil-define-key 'normal 'global (kbd "v") vc-prefix-map) - (keymap-global-set "C-c v" vc-prefix-map) ;; make project commands available via leader key (evil-define-key 'normal 'global (kbd "p") project-prefix-map) - (keymap-global-set "C-c p" project-prefix-map) (evil-define-key 'normal 'global (kbd "ff") #'find-file @@ -1157,50 +1157,82 @@ Enables and configures Yasnippet, a template system for Emacs: *** Use Treesitter parser support -#+BEGIN_SRC emacs-lisp - ;; set locations for treesitter grammars - (use-package treesit - :config - (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") - (gomod "https://github.com/camdencheek/tree-sitter-go-mod.git") - (haskell "https://github.com/tree-sitter/tree-sitter-haskell" "master" "src" nil nil) - (html "https://github.com/tree-sitter/tree-sitter-html") - (java "https://github.com/tree-sitter/tree-sitter-java.git") - (javascript "https://github.com/tree-sitter/tree-sitter-javascript" "master" "src") - (json "https://github.com/tree-sitter/tree-sitter-json") - (lua "https://github.com/tjdevries/tree-sitter-lua") - (make "https://github.com/alemuller/tree-sitter-make") - (markdown "https://github.com/ikatyang/tree-sitter-markdown") - (ocaml "https://github.com/tree-sitter/tree-sitter-ocaml" nil "ocaml/src") - (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"))) + Recently with verion 0.25 the treesitter library changed ABI version + to 15. Newer parsers will complain about a version mismatch if the + installed library used by emacs is lower than this version. This ABI + version was introduced in the 0.25 branch of treesitter. - :hook - ((prog . treesit-inspect-mode))) + The best course of action till lib treesitter is updated is to pin + the version of the parser to the last version supporting ABI 14. - (use-package treesit-auto - :ensure t - :defer 5 - :custom - (treesit-auto-install 'prompt) - (treesit-auto-langs '(awk bash c c-sharp clojure cmake commonlisp cpp css - dart dockerfile elixir go gomod html java - javascript json julia kotlin lua make markdown nix nu - org perl proto python r ruby rust scala sql toml tsx - typescript vue yaml)) ; reduced langs list somewhat - :config - (treesit-auto-add-to-auto-mode-alist 'all) - (global-treesit-auto-mode)) -#+END_SRC + With the new ABI 15 version, parsers are required to provide a + ~treesitter.json~ file with additional metadata which can be used as + proxy to find a version which still supports ABI-14, i.e. the commit + before that. + + A lot of the parsers are provided by the treesitter project as sub + repos, and they follow the same version convention as the library, + selecting the last tag before the 0.25 tag is a good way to find a + compatible version. + + This branch can be added after the repo url in the + ~treesit-language-source-alist~ variable. Note that if you use + ~treesit-auto-install-all~ to get it over with, you have to probably + restart your emacs as treesit-auto apparently caches the value + during iniitialisation and changes are not picked up. + + #+BEGIN_SRC emacs-lisp + + ;; set locations for treesitter grammars + (use-package treesit + :config + (setq treesit-language-source-alist + '((bash "https://github.com/tree-sitter/tree-sitter-bash" "v0.23.3") + (c "https://github.com/tree-sitter/tree-sitter-c" "v0.23.6") + (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") + (gomod "https://github.com/camdencheek/tree-sitter-go-mod.git") + (haskell "https://github.com/tree-sitter/tree-sitter-haskell" "master" "src" nil nil) + (html "https://github.com/tree-sitter/tree-sitter-html") + (java "https://github.com/tree-sitter/tree-sitter-java.git") + (javascript "https://github.com/tree-sitter/tree-sitter-javascript" "master" "src") + (json "https://github.com/tree-sitter/tree-sitter-json") + (lua "https://github.com/tjdevries/tree-sitter-lua") + (make "https://github.com/alemuller/tree-sitter-make") + (markdown "https://github.com/ikatyang/tree-sitter-markdown") + (ocaml "https://github.com/tree-sitter/tree-sitter-ocaml" nil "ocaml/src") + (rust "https://github.com/tree-sitter/tree-sitter-rust" "v0.23.3") + (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"))) + + :hook + ((prog . treesit-inspect-mode))) + #+END_SRC + +Treesit-auto automatically configures things behind the scenes to use +the treesitter modes and download them if needed. \ + + #+BEGIN_SRC emacs-lisp + (use-package treesit-auto + :ensure t + :defer 5 + :custom + (treesit-auto-install 'prompt) + (treesit-auto-langs '(awk bash c c-sharp clojure cmake commonlisp cpp css + dart dockerfile elixir go gomod html java + javascript json julia kotlin lua make markdown nix + org perl proto python r ruby rust scala sql toml tsx + typescript vue yaml)) ; reduced langs list somewhat + :config + (treesit-auto-add-to-auto-mode-alist 'all) + (global-treesit-auto-mode)) + #+END_SRC #+RESULTS: : [nil 26284 45426 709595 nil elpaca-process-queues nil nil 734000 nil] @@ -2300,7 +2332,7 @@ exporter manual.]] (add-to-list 'org-capture-templates '("m" "Manual Cookbook" entry (file "~/org/cookbook.org") "* %^{Recipe title: }\n :PROPERTIES:\n :source-url:\n :servings:\n :prep-time:\n :cook-time:\n :ready-in:\n :END:\n** Ingredients\n %?\n** Directions\n\n"))) - :bind (("X" . org-capture))) + :bind (("C-c C" . org-capture))) #+END_SRC @@ -2645,7 +2677,11 @@ We can add a list of queries (org-todo-keywords '((sequence "TODO(t)" "NEXT(n)" "WAITING(w)" "SOMEDAY(s)" "PROJ(p)" "|" "DONE(d)" "CANCELED(c)"))) (org-todo-keywords-for-agenda '((sequence "NEXT(n)" "TODO(t)" "WAITING(w)" "SOMEDAY(s)" "PROJ(p)" "|" "DONE(d)" "CANCELED(c)"))) - (org-agenda-files (list "~/Nextcloud/org/" "~/org/snamellit/" "~/org/customer/" "~/org/personal/")) + (org-agenda-files (list + "~/Nextcloud/org/" + "~/org/snamellit/" + ;"~/org/customer/" + "~/org/personal/")) (org-refile-targets '( (org-agenda-files . (:level . 1)) ("~/org/personal/bijen.org" . (:level . 1))