helix
helix copied to clipboard
Add default key binding for file_picker_in_current_buffer_directory
Opening the file picker relative the current buffer is a useful command without a default binding.
This PR binds it to
Previously, a default binding for this command was discussed in:
https://github.com/helix-editor/helix/pull/3052
At the bottom, an example of how to bind a key to this feature gained 25 hearts: https://github.com/helix-editor/helix/issues/3052#issuecomment-1509848268
Clearly it's a feature that users are interested in discovering.
While this does at one more item to the popular "space" menu, opening other files is one of the most common editor actions.
This binding arguably adds more value than file_picker_in_current_directory, as the current directory is likely to equal the workspace root, and file_picker seems to fallback to the current directory if there's no LSP root if I understand correctly.
By contrast, the location of the current buffer will vary all over the source tree, it seems fairly common to work wither files nearby in tree.
I agree there should be a shortcut, but I think it should be space .
. means current directory. It seems the perfect choice when opening a buffer in 'the current directory', and as a bonus it is much easier to type.
"." = "file_picker_in_current_buffer_directory"
Space dot works for me, too.