TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN: The Neovim syntax tree traversal plugin you've been waiting for

3 点作者 Aaronik4 个月前
Treewalker.nvim<p>For a while I&#x27;d been wanting a good syntax tree traversal and manipulation plugin for neovim. I tried stuff like treesitter-textobjects and syntax-tree-surfer but neither could meet my needs.<p>So I built the one I&#x27;d been wanting.<p>Introducing Treewalker.nvim (<a href="https:&#x2F;&#x2F;github.com&#x2F;aaronik&#x2F;treewalker.nvim">https:&#x2F;&#x2F;github.com&#x2F;aaronik&#x2F;treewalker.nvim</a>). It offers movement and swapping. Design goals include stability and ergonomics.<p>Movement<p>* Up&#x2F;down go to neighbor nodes up&#x2F;down in the document.<p>* Left goes to the parent node<p>* Right goes to next found indent in the document<p>Each has their own spin on a literal tree movement. The ultimate goel is to make the movement feel ergonomic, not to strictly adhere to the AST.<p>Swapping<p>* Up&#x2F;down swaps take the highest node on the line _and its comments, decorators, and annotations_. This makes it easy to swap things like route handlers. These swaps operate on whole lines.<p>* Left&#x2F;right swaps operate on the node under the cursor. This is good for swapping arguments and list items.<p>The plugin aims to be stable - it&#x27;s well tested and leverages types with luacheck in the CI. There are few options. It&#x27;s meant to &quot;just work&quot;.<p>Ok that&#x27;s all, I hope this can be of some use to folks!

暂无评论

暂无评论