Open global search on the current buffer directory #8193
-
Hi, There is a way to open file_picker_in_current_buffer_directory which I mapped to fb and is very helpful because it loads faster than f/F if I know I want a file from the very same dir. This is specially powerful in the situation like: cd
~$/ helix ~/.config/helix/config.toml In the above example the CWD is with that file opened if I do / to open global_search an type a very common token such as Helix hangs for almost 10 minutes (in my system) because it tries to fuzzy find on my entire What I wanted?Ability to map WorkaroundI tried to map a chain of commands like
However I don´t know how to fill CURRENT_BUFFER_DIR and RESTORE_LATEST_CWD I appreciate any suggestion |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
[keys.normal.space]
"." = "file_picker_in_current_buffer_directory" |
Beta Was this translation helpful? Give feedback.
@pascalkuthe and I chatted about this and we don't want to end up with a bunch of variants of each picker command per-scope (i.e.
global_search_in_workspace
,global_search_in_current_working_directory
,global_search_in_current_buffer_directory
). Rather we think variables and typable commands are probably the best way to handle this, so we would have:global-search
in the workspace,:global-search %{cwd}
for current working directory and:global-search %{dirname}
to handle these cases with variable expansions, which should be keymappable. We will need variable expansion and, for global_search specifically, the refactor for #196 to make this possible.