-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add prefix position to hx
CLI file args
#5945
Conversation
A cursor position can now be specified using common prefix notation used by vim, nvim, kak, emacs and nano. eg. `hx +10 Cargo.toml` This prefix notation also allows the user to set the cursor at the end of the file. eg. `hx +: Cargo.toml` This allows `hx` to play nicely with other tools that want to open a file at a given position using prefix notation. The existing postfix notation can still be used (`hx Cargo.toml:10`) but has been extended to support jumping to the end of a buffer. eg. `hx Cargo.toml:`
This is dependant on Helix accepting the PR: helix-editor/helix#5945
Duplicate of #5603 |
I would highlight that this PR implements file positioning just like Kakoune's CLI |
* Add Helix editor (`hx`) to editors that support prefix positions This is dependant on Helix accepting the PR: helix-editor/helix#5945 * Add `helix` variant to accepted editors * Add branch for Helix file opening * style(code): add clarification comment * style(fmt): whitespace --------- Co-authored-by: Aram Drevekenin <aram@poor.dev>
* Add Helix editor (`hx`) to editors that support prefix positions This is dependant on Helix accepting the PR: helix-editor/helix#5945 * Add `helix` variant to accepted editors * Add branch for Helix file opening * style(code): add clarification comment * style(fmt): whitespace --------- Co-authored-by: Aram Drevekenin <aram@poor.dev>
This was partially superseded by #8521 We wanted to support |
@the-mikedavis All good Mike, as long as it works!
I'm also not sure where that came from, I presumed it was some sort of standard across editors. Anyways my need here was to integrate |
Resolves #5437
A cursor position can now be specified using common prefix notation used by vim, nvim, kak, emacs and nano.
hx +10 Cargo.toml
This prefix notation also allows the user to set the cursor at the end of the file.
hx +: Cargo.toml
This allows
hx
to play nicely with other tools that want to open a file at a given position using prefix notation.The existing postfix notation can still be used (
hx Cargo.toml:10
) but has been extended to support jumping to the end of a buffer.hx Cargo.toml:
The prefix notation works for each file in the list.
hx +10 Cargo.toml +20 README
and can be intermixed with postfix notation.
hx +10 Cargo.toml README:20
Prefix notation also supports column indexing.
hx +10:20 Cargo.toml