aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src
diff options
context:
space:
mode:
Diffstat (limited to 'helix-term/src')
-rw-r--r--helix-term/src/commands.rs7
-rw-r--r--helix-term/src/keymap/default.rs1
2 files changed, 8 insertions, 0 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs
index 3757912a..886ee62d 100644
--- a/helix-term/src/commands.rs
+++ b/helix-term/src/commands.rs
@@ -259,6 +259,7 @@ impl MappableCommand {
append_mode, "Insert after selection (append)",
command_mode, "Enter command mode",
file_picker, "Open file picker",
+ file_picker_in_current_directory, "Open file picker at current working directory",
code_action, "Perform code action",
buffer_picker, "Open buffer picker",
symbol_picker, "Open symbol picker",
@@ -2047,6 +2048,12 @@ fn file_picker(cx: &mut Context) {
cx.push_layer(Box::new(overlayed(picker)));
}
+fn file_picker_in_current_directory(cx: &mut Context) {
+ let cwd = std::env::current_dir().unwrap_or_else(|_| PathBuf::from("./"));
+ let picker = ui::file_picker(cwd, &cx.editor.config());
+ cx.push_layer(Box::new(picker));
+}
+
fn buffer_picker(cx: &mut Context) {
let current = view!(cx.editor).doc;
diff --git a/helix-term/src/keymap/default.rs b/helix-term/src/keymap/default.rs
index a8144ebc..18ebbcfe 100644
--- a/helix-term/src/keymap/default.rs
+++ b/helix-term/src/keymap/default.rs
@@ -196,6 +196,7 @@ pub fn default() -> HashMap<Mode, Keymap> {
"space" => { "Space"
"f" => file_picker,
+ "F" => file_picker_in_current_directory,
"b" => buffer_picker,
"s" => symbol_picker,
"S" => workspace_symbol_picker,