helix icon indicating copy to clipboard operation
helix copied to clipboard

Add default key binding for file_picker_in_current_buffer_directory

Open markstos opened this issue 1 year ago • 2 comments

Opening the file picker relative the current buffer is a useful command without a default binding.

This PR binds it to % by default, where % is a mnemonic to relate the name of the register holding the current file name. This does not conflict with any other default bindings.

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.

markstos avatar May 25 '24 01:05 markstos

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"

David-Else avatar Jun 17 '24 18:06 David-Else

Space dot works for me, too.

markstos avatar Jun 18 '24 02:06 markstos