Skip to content
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 picker: current view dir #4666

Merged
merged 1 commit into from
Feb 2, 2023

Conversation

mangas
Copy link
Contributor

@mangas mangas commented Nov 8, 2022

Slightly different take for #3014, looking for feedback

@kirawi kirawi added A-helix-term Area: Helix term improvements S-waiting-on-review Status: Awaiting review from a maintainer. labels Nov 8, 2022
Copy link
Member

@dead10ck dead10ck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks fine to me. I have no strong preference for the key binding.

@the-mikedavis
Copy link
Member

Looks like #3063

@mangas
Copy link
Contributor Author

mangas commented Nov 9, 2022

@the-mikedavis seems the other PR is still debating the submenu and such. We could split those topics and just move ahead with a simpler option while the rest is being debated?

helix-term/src/commands.rs Outdated Show resolved Hide resolved
helix-term/src/commands.rs Outdated Show resolved Hide resolved
helix-term/src/commands.rs Outdated Show resolved Hide resolved
helix-term/src/commands.rs Outdated Show resolved Hide resolved
helix-term/src/keymap/default.rs Outdated Show resolved Hide resolved
@mangas mangas force-pushed the add-picker-current-view-dir branch from 9adde76 to 04f3d27 Compare November 9, 2022 19:07
@mangas mangas requested review from the-mikedavis and dead10ck and removed request for the-mikedavis and dead10ck November 9, 2022 19:16
@mangas
Copy link
Contributor Author

mangas commented Nov 9, 2022

I think i've addressed all the comments, please let me know if anything else is missing

helix-term/src/commands.rs Outdated Show resolved Hide resolved
helix-term/src/commands.rs Outdated Show resolved Hide resolved
@therustmonk
Copy link

I've checked the changes - works fine 👍
Also sent a short refactoring for that here: mangas#1 up to you @mangas 👋

@mangas
Copy link
Contributor Author

mangas commented Nov 19, 2022

I've checked the changes - works fine +1 Also sent a short refactoring for that here: mangas#1 up to you @mangas wave

Hey 👋 thanks for the PR, I used most of the suggested change only replaced the if else with a match :)

@mangas mangas requested review from the-mikedavis and removed request for archseer November 19, 2022 19:23
@archseer archseer merged commit 8ba0a46 into helix-editor:master Feb 2, 2023
@mangas mangas deleted the add-picker-current-view-dir branch February 2, 2023 19:55
@Boscop
Copy link

Boscop commented Apr 13, 2023

When I do hx foo/bar/baz.rs and then inside helix I :open asd/sdf/qwert.rs, and then open the file picker, it's still based on foo/bar/baz.rs's current dir, not on the file I was in when I summoned the file picker, is this intended?
(Helix 23.03)

Ideally it should have at least an option (if not the default) to use the current file's dir for the file picker.

@pascalkuthe
Copy link
Member

There are three file picker commands. Check the command picker (space-?), the default keybinding has not/will not be changed but it's easy to change the keybinding yourself.

@Boscop
Copy link

Boscop commented Apr 14, 2023

@pascalkuthe Thanks. But when I do the action to open the file picker in the current buffer's directory, literally nothing happens (the command palette disappears, but no file picker appears).
I tried on Win10 and in Ubuntu inside WSL2, same behavior. Any idea why?

Btw, relative to which dir should the normal file picker (space f) operate?
Also, space f and space F seem to do the same thing (they both open relative to the working dir that the hx process was started from, NOT relative to the path of the file that was given to hx when it was started).
If I open hx /foo/bar from being inside /asd/qwer, shouldn't space f open the picker relative to /foo and space F relative to /asd? Currently both are opening it relative to /asd.

@mlsvrts
Copy link

mlsvrts commented Oct 8, 2024

If anyone is new/dumb at helix like me, you can use the 'buffer directory file picker' by adding a keymap to you config.toml. For instance, to make space + e open the picker, add:

[keys.normal.space]
e = "file_picker_in_current_buffer_directory"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-helix-term Area: Helix term improvements S-waiting-on-review Status: Awaiting review from a maintainer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Requst: File picker based on current buffer's directory
9 participants