rlivings39 / vscode-fzf-quick-open

vscode extension providing quick file/folder open and searching using fzf
MIT License
77 stars 17 forks source link

custom shortcuts #22

Closed runbmp closed 4 years ago

runbmp commented 4 years ago

Hello, I would like to replace the original "Cmd+P" shortcut like this in keybindings.json:

{
    "key": "cmd+p",
    "command": "fzf-quick-open.runFzfSearch"
  }

However, when I do this, it prompts me to enter a starting pattern or it copies the pattern in from under my cursor: image

It would be cool to be able to go straight to fzf with no pre-entered text. Any idea?

rlivings39 commented 4 years ago

Could you elaborate on what you'd expect the search to do in this case? Namely, where is fzf getting its information to filter?

The command runFzfSearch is meant to pass a pattern to ripgrep and then filter the results through fzf. Is that what you're looking for?

runbmp commented 4 years ago

sorry for being unclear, I am simply hoping to jump straight to the terminal with no pre-entered text so I can start my fzf query from scratch.

rlivings39 commented 4 years ago

Edit Ignore this...I misunderstood the request. See the next reply.

The bit I still don't understand in this proposal is what input the extension would pass to rg for the search pattern. fzf-quick-open.runFzfSearch is computing a shell command:

https://github.com/rlivings39/vscode-fzf-quick-open/blob/master/src/extension.ts#L289

that first runs rg using a search pattern (from the prompt) and then feeds those ripgrep results to fzf. In the proposed workflow if we don't have the pattern for rg, what should ripgrep search for?

Note: I just feel like I don't understand the desired workflow here so thanks in advance for helping me out!

rlivings39 commented 4 years ago

Oh duh, I'm being slow. For replacing Cmd+P try the command fzf-quick-open.runFzfFile. That'll drop straight to the fzf shell searching just file names.