文章摘要
Helix 25.07版本正式发布,带来了核心组件的重大更新和多项新功能。此次更新由195位贡献者共同完成,新增了文件浏览器功能,用户可通过<space>e访问,支持模糊搜索和目录层级浏览。此外,Helix作为模态文本编辑器,内置多选、语言服务器协议(LSP)、tree-sitter支持,并实验性支持调试适配器协议(DAP)。
文章总结
Helix 25.07 版本亮点总结
发布日期:2025年7月15日
主要贡献者:195位
核心变化:替换了Helix的一个主要核心组件,并新增了许多炫酷功能。
1. 文件资源管理器
新增了文件资源管理器功能,通过<space>e快捷键打开。该资源管理器是一个类似于telescope的UI组件,支持模糊搜索。选择目录后按Enter键会打开该目录下的新资源管理器,选择文件则会打开该文件。与传统的文件资源管理器(<space>f)不同,新资源管理器更适合查看目录层级结构,尤其适用于大型项目。
2. LSP文档颜色支持
Helix 25.07 新增了对LSP(Language Server Protocol)文档颜色请求的支持。该功能允许Helix向语言服务器(如tailwindcss-language-server或vscode-css-language-server)请求文档中与RGB颜色对应的范围,并在文档中内联显示颜色样本。
3. 命令模式新特性
命令模式(:)用于执行可键入的命令。25.07版本对命令模式的代码进行了全面重写,修复了多个解析和自动补全的bug,并引入了两个新特性:标志(Flags)和扩展(Expansions)。
- Flags:类似于Shell命令中的标志,用于对命令行为进行微调。例如,
:sort命令现在支持--reverse或-r标志,:write命令支持--no-format标志。 - Expansions:引入了一种特殊语法来插入值。例如,
%{buffer_name}可以插入当前文档的名称,%sh{..}可以执行Shell命令。
4. Tree-house:全新的Tree-sitter集成
25.07版本中,Helix替换了与Tree-sitter交互的库,引入了全新的tree-house库,移除了官方的Tree-sitter绑定和大量旧代码。
- Tree-sitter简介:Tree-sitter是一个用于生成和使用快速、容错性强的解析器的框架。Helix使用Tree-sitter进行语法高亮、缩进和文本对象识别等功能。
- Tree-house的优势:
tree-house库基于早期高亮器的经验重新构建,解决了长期存在的bug,并支持并行解析等未来改进。其核心优势在于对注入(Injections)功能的强大处理。 - Injections:注入是Tree-sitter中的一个概念,允许在文档中切换语言。例如,在Markdown文档中,代码块可以被解析为Rust代码。
tree-house通过树状结构管理这些注入层,实现了高效的增量解析和查询。
5. 其他改进
- Locals:
tree-house改进了locals.scm查询,解决了定义在视图外时高亮丢失的问题。 - 跨语言一致性:
tree-house的Syntax类型和TreeCursor类型使得跨注入层的操作更加高效,未来所有基于Tree-sitter的功能(如代码折叠、拼写检查等)都将更加一致。
6. 总结
25.07版本带来了许多新功能和改进,特别是对Tree-sitter集成的深度优化。更多详细信息可查看完整更新日志。
评论总结
评论总结:
正面评价:
1. 易于使用和默认配置:多位用户赞赏Helix的默认主题和配置,认为它开箱即用,无需复杂设置。
- "Good looking default theme. Sensible defaults. Literally install and use, no configuration needed."
(“默认主题好看,配置合理,安装即用,无需配置。”)
- "Very sane configuration — my config includes just one line to change the default theme to something with more contrast."
(“配置非常合理,我的配置只有一行,用于更改默认主题以增加对比度。”)
与Vim理念相似但更易上手:一些用户认为Helix继承了Vim的优点,但更易于学习和使用,尤其适合那些不熟悉Vim的用户。
- "I found it much easier to learn and use, and it is distinguished from other vimlikes in that it's got a useful starting configuration."
(“我发现它更容易学习和使用,与其他类Vim编辑器不同,它有一个有用的默认配置。”) - "It takes the vim idea of applying actions to blocks of code, and swaps them around — you first select the code, and then apply an action to it."
(“它采用了Vim对代码块应用操作的理念,但将其反转——你先选择代码,然后对其应用操作。”)
- "I found it much easier to learn and use, and it is distinguished from other vimlikes in that it's got a useful starting configuration."
功能丰富且无AI干扰:用户喜欢Helix内置的多种功能(如文件选择器、语法高亮等),且没有强制加入AI功能。
- "Helix is great and includes a lot of stuff out of the box (file pickers, syntax highlighting, linting etc) without any configuration or installing plugins."
(“Helix很棒,开箱即用,包含许多功能(如文件选择器、语法高亮等),无需配置或安装插件。”) - "Very nice to see a text editor that is very capable, yet still minimal and not focused on including a bunch of useless AI features."
(“很高兴看到一个功能强大但依然简洁的文本编辑器,没有加入一堆无用的AI功能。”)
- "Helix is great and includes a lot of stuff out of the box (file pickers, syntax highlighting, linting etc) without any configuration or installing plugins."
负面评价:
1. 撤销功能问题:有用户指出Helix的撤销功能不够直观,有时会撤销过多内容,导致工作丢失。
- "There is something about the way undo works that just feels incredibly wrong to me. What it wants to undo doesn't always seem logical and always undoes too much."
(“撤销功能的方式让我感到非常不对劲,它撤销的内容并不总是合乎逻辑,而且总是撤销过多。”)
键位绑定与Vim不同:一些长期使用Vim的用户对Helix的键位绑定感到不适应,认为这会带来困扰。
- "The main disadvantage is that some keybindings work differently than vim. I expect "x" in normal mode to delete the character under the cursor or "d" to wait for the motion before deleting anything."
(“主要缺点是某些键位绑定与Vim不同。我期望在普通模式下按‘x’删除光标下的字符,或按‘d’等待动作后再删除内容。”)
- "The main disadvantage is that some keybindings work differently than vim. I expect "x" in normal mode to delete the character under the cursor or "d" to wait for the motion before deleting anything."
缺少多光标支持:有用户希望Helix能支持类似Sublime的多光标功能。
- "Very sad that Helix still doesn't have Sublime-like multi-caret support. All I want is to Ctrl + Click and Shift + Alt + Arrows."
(“很遗憾Helix仍然没有类似Sublime的多光标支持,我只想用Ctrl+点击和Shift+Alt+箭头来实现。”)
- "Very sad that Helix still doesn't have Sublime-like multi-caret support. All I want is to Ctrl + Click and Shift + Alt + Arrows."
其他观点:
1. 对未来的期待:部分用户期待Helix未来的更新,如新的文件选择器和与Vim键位兼容的版本(如evil-helix)。
- "Looking forward to the new file picker! Now to wait for evilhelix."
(“期待新的文件选择器!现在等待evil-helix。”)
- "I terribly need a vim-like with Helix all-in-one comprehensiveness."
(“我非常需要一个像Helix这样功能全面的类Vim编辑器。”)
- 与Neovim的比较:一些用户认为Neovim仍然是更好的选择,尽管Helix在某些方面做得不错。
- "I use Neovim. It does what i want it to do. It's one of the best available options."
(“我使用Neovim,它能满足我的需求,是最好的选择之一。”)
- "I use Neovim. It does what i want it to do. It's one of the best available options."
总结:Helix因其开箱即用的配置、易用性和功能丰富性受到广泛好评,尤其适合不熟悉Vim的用户。然而,其撤销功能、键位绑定和多光标支持的不足也引发了一些批评。未来更新和与Vim兼容的版本(如evil-helix)备受期待。