-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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 command for picking files from CWD #1600
Add command for picking files from CWD #1600
Conversation
Demo file_picker_at_cwd.mp4In the above demo I remapped I haven't included that keymapping change in this PR due to ongoing discussion in #1352 about the best way to keymap new file picker type commands. |
There is an interesting interaction here with some of the logic inside the |
There's also #1066 that gives higher precedence to files in the CWD in the default file picker itself. |
Thanks, the issue is that if there are a large number of directories/files in the root of a project, they will clutter up the list of results. |
helix-term/src/commands.rs
Outdated
@@ -3258,6 +3259,12 @@ fn file_picker(cx: &mut Context) { | |||
cx.push_layer(Box::new(picker)); | |||
} | |||
|
|||
fn file_picker_at_cwd(cx: &mut Context) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about mapping this to space F
by default? Would complement space f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's also rename it file_picker_in_current_directory
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I've renamed the function, added a keymap bound to space F
, rebased onto the latest master and pushed the updated changes into this PR
Resolves #1860 |
The `file_picker_at_current_directory` command opens the file picker at the current working directory (CWD). This can be useful when paired with the built-in `:cd` command which changes the CWD. It has been mapped to `space F` by default.
b61e216
to
e55f3af
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
If I open Helix in a directory and If I cd into a subdirectory
The menu says "f Open file picker", but open it where? Is this known as the There is now two distinct types of directory for the file picker, and the PS I am not saying it needs to be called |
I think "workspace directory" would be an improvement, but that might start to cross terminology with LSP. |
We need to clarify what is:
I am confused myself. |
I usually refer to it as "project root", which jives with the |
|
The
file_picker_at_cwd
command opens the file picker at the currentworking directory (CWD). This can be useful when paired with the
built-in
:cd
command which changes the CWD.