Helix save cursor position (manual workaround)
27. 6. 2026Just do it ↓
Script that we call from helix and it stores the current line (hxsaveline):
https://raw.githubusercontent.com/brontosaurusrex/bucentaur/refs/heads/master/.experiments/bin/hxsaveline
Entry in your config.toml that binds alt+w to save current line via hxsaveline script (under [keys.normal]):
"A-w" = ":sh hxsaveline %{buffer_name} %{cursor_line}"
Wrapper that will read the stored line and open helix (hxw):
https://raw.githubusercontent.com/brontosaurusrex/bucentaur/refs/heads/master/.experiments/bin/hxw
so you open your file as
hxw yourfile
and it should open with cursor on stored line.
How about just reading and displaying stored line inside helix, this script (hxloadline):
https://raw.githubusercontent.com/brontosaurusrex/bucentaur/refs/heads/master/.experiments/bin/hxloadline
and in your config.toml we will use free alt+l (under [keys.normal])
"A-l" = ":sh hxloadline %{buffer_name}"
will just print stored line number and do nothing else, but one can 18gg or :g 18.
This is experimental workaround that will not work in all conditions and ‘should’ really be a core editor feature imho.
Recap ↓
You have 3 new little shell scripts somewhere on $PATH: hxloadline, hxsaveline, hxw and something like this added to your config.toml under [keys.normal]
# save cursor position with ctrl+w via small bash script
"A-w" = ":sh hxsaveline %{buffer_name} %{cursor_line}"
# load cursor position and do nothing with it via small bash script
"A-l" = ":sh hxloadline %{buffer_name}"
And you can use hxw instead of hx to load your files positioned on the stored line. Or use alt+l to display stored line and then :g 42.
btw ↓
The issue goes deeper, undo history, command history, etc.