logoalt Hacker News

bulbaryesterday at 10:08 AM3 repliesview on HN

I want an editor that's built around language entities.

"Move to end of the scope" or "insert after this expression" and similar.

The overlap between languages should be large enough to make this feasible.


Replies

vaylianyesterday at 2:10 PM

Helix has built-in Tree Sitter support.

> "Move to end of the scope"

You can select the current syntax object under the cursor with alt+o and expand the selection to the enclosing syntax objects with further presses of alt+o. This moves you automatically to the end of the selected syntax object. You can use alt+b to move to the beginning of the selected syntax object.

> "insert after this expression"

Select the expression and after that you can use regular commands like a and p.

srikyesterday at 10:24 AM

Neo/vim does this with community and built-in “text objects”.

https://neovim.io/doc/user/usr_04/#_text-objects

show 1 reply