helix icon indicating copy to clipboard operation
helix copied to clipboard

Draft: tree sitter path

Open winged opened this issue 1 year ago • 2 comments

Add a "tree-sitter-path" element to the possible status lines, which is useful for large code bases where you cannot see the beginning of the current function/class/type etc.

Suggested config:

[editor.statusline]
center = ["tree-sitter-path"]

This scratches an itch I've had while editing large files where you may lose the overview of "which class / type / function am I editing currently?"

Note: This is my first time hacking something in Rust, so most likely I'm doing several things wrong. Also, there's no test suite for the feature either.

I'm willing to take hints and learn and iterate on this if there's interest in this feature from the maintainers :-)

Screenshot demonstrating the new statusline feature in the center: image

winged avatar Sep 26 '23 14:09 winged

I like it! If both breadcrumbs and sticky context gets merged then users will have multiple options as to how to keep context around.

Some formatting questions: de we need the ~ in front of it? Also most editors use chevrons to separate the path elements, maybe helix should do the same?

breadcrumbs

hamrik avatar Sep 27 '23 06:09 hamrik

Some formatting questions: de we need the ~ in front of it? Also most editors use chevrons to separate the path elements, maybe helix should do the same?

I needed something to separate the breadcrumbs from the filename when putting it next to it (as I had been experimenting). Love the chevrons idea though - I was thinking about some language-agnostic separator but didn't think of them. Updated patch coming right up

winged avatar Sep 27 '23 06:09 winged