6

To open a file relative to the current one in Helix, you can to the do the following with 24.3:

:o <C-r>%<C-w>

Here, the Control-R allows you to select a register and the special register "%" contains the current file path and inserts into the command line, while the final Control-w chops off the last part of the file name leaving with you current directory.

This is like :o %:h from Vim/Neovim

top 2 comments
sorted by: hot top controversial new old
[-] markstos@lemmy.world 2 points 1 month ago

Here's a better method for Helix: Bind a key to open a file picker relative to the current buffer. This useful command does not seem to be bound to a key by default. Choosing "%" may be memorable because % is a reminder of the current file. Add this to ~/.config/helix/config.toml:

[keys.normal.space]
"%" = "file_picker_in_current_buffer_directory"
[-] Deebster@programming.dev 1 points 3 weeks ago

% makes sense. I went with space+o for easier typing but it's hardly unambiguous.

this post was submitted on 23 May 2024
6 points (100.0% liked)

Helix Editor

148 readers
1 users here now

About

Post-modern community focused on post-modern editor.

Rules

Instance rules apply here.

founded 10 months ago
MODERATORS