emacs 于 29 由付禹安引入了 tree-sitter 支持,可以使用原生的 API 操控经过解析得到的代码语法树,而不是只能进行简单的正则匹配(当然,之前也有emacs-tree-sitter)。我对在 emacs 中使用 treesit 编写一些强力插件非常感兴趣,但是我缺少 tree-sitter 和 emacs treesit 的知识。我至少需要知道编写
https://github.com/emacs-tree-sitter/tree-sitter-langs/releases Emacs 默认从 treesit-extra-load-path 指定的路径去加载动态链接库,如果这个值是 nil ,它默认会从 user-emacs-directory 下的tree-sitter 内加载。 所以在下载好对应平台的压缩包后,可以解压到上面指定的目录内。一般来说,语言和动态链接库名字...
Emacs29 的 tree-sitter 优化了缩进处理,使代码格式更规范。 对于大型代码项目,tree-sitter 能加快文件加载和解析速度。利用 tree-sitter 可以轻松实现语法高亮的个性化定制。它能准确识别代码中的变量、函数等元素,方便代码浏览。在处理动态类型语言时,tree-sitter 表现出色。Emacs29 中 tree-sitter 的更新频率较高,...
https://emacs-tree-sitter.github.io/ PinnedLoading elisp-tree-sitterelisp-tree-sitterPublic Emacs Lisp bindings for tree-sitter Emacs Lisp83274 tree-sitter-langstree-sitter-langsPublic Language bundle for Emacs's tree-sitter package Emacs Lisp288136 ...
In this post, I show how to setup Emacs for TypeScript and React (tsx) development, with tree-sitter for syntax highlighting and indentation, and LSP with the TypeScript compiler (including a plugin for faster eslint), via eglot, for code intelligence. U
Emacs Erlang mode using treesitter Requires emacs-29 compiled with treesitter support. Currently uses treesitter only for syntax-highlighting, font-lock-mode, and uses the old erlang-mode for everything else. There is a lot of work to do to convert the old erlang mode to use treesitter, ...
也有可能是我那个时候比较菜,当初针对 python配置的补全效果很一般只能补全内置函数,自己定义的类和方法无法补全,而且跳转时好时坏。后来我抛弃了vim很长一段时间。好在微软提供了lsp这个大杀器,让vim、emacs这类编辑器的代码编辑体验提升了很大一截。而且配置还相对简单。
也有可能是我那个时候比较菜,当初针对 python配置的补全效果很一般只能补全内置函数,自己定义的类和方法无法补全,而且跳转时好时坏。后来我抛弃了vim很长一段时间。好在微软提供了lsp这个大杀器,让vim、emacs这类编辑器的代码编辑体验提升了很大一截。而且配置还相对简单。
也有可能是我那个时候比较菜,当初针对 python配置的补全效果很一般只能补全内置函数,自己定义的类和方法无法补全,而且跳转时好时坏。后来我抛弃了vim很长一段时间。好在微软提供了lsp这个大杀器,让vim、emacs这类编辑器的代码编辑体验提升了很大一截。而且配置还相对简单。
也有可能是我那个时候比较菜,当初针对 python配置的补全效果很一般只能补全内置函数,自己定义的类和方法无法补全,而且跳转时好时坏。后来我抛弃了vim很长一段时间。好在微软提供了lsp这个大杀器,让vim、emacs这类编辑器的代码编辑体验提升了很大一截。而且配置还相对简单。