rlivings39 / vscode-fzf-quick-open Goto Github PK
View Code? Open in Web Editor NEWvscode extension providing quick file/folder open and searching using fzf
License: MIT License
vscode extension providing quick file/folder open and searching using fzf
License: MIT License
Thank you for implementing #6 it works great on my x86 64 bit Arch Linux system, but not on my Debian 9 ARM Pinebook Pro system.
rg slider --vimgrep --color ansi | fzf --ansi --print0 | cut - d : -f 1-3 | xargs -r -I {} code -g {}
log:
ERR Manifest is not found rlivings39.fzf-quick-open
Video:
I have this weird behaviour that when I search for a term with rg with this extension I get multiple results that are basically the same, but somehow are separated by different column number of the cursor. See the screenshot provided.
In StudentController.java
there is only one result for List<Student>
at line 37, but it finds it multiple times - what's wrong? I do not pass any options to rg.
I identified the culprit:
The way I like to search is not through the input box that opens up, rather, I press enter without entering any terms, and then search in the interactive panel that opens up in the terminal inside vscode. If I search with the input box, this problem is not occurring. I also found out that that the default command of rg has --vimgrep
which actually might cause this behaviour as described in the man rg
docs. Is there something I can do to search the way I want and not through the input box?
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:
It would be cool to be able to go straight to fzf with no pre-entered text. Any idea?
Would be awesome if there was support for the fzf clone called "skim
", written in rust.
Run a search and leave fzf open. Then run another search from VSCode and note that this doesn't cancel the running search. Reported in #13
Hi, thx for this great plugin, I really like it.
Could you please also implement file content search?
Open file using fzf
fzf --print0 | xargs -0 -r code
xargs: illegal option -- r
usage: xargs [-0opt] [-E eofstr] [-I replstr [-R replacements]] [-J replstr]
[-L number] [-n number [-x]] [-P maxprocs] [-s size]
[utility [argument ...]]
ProductName: Mac OS X
ProductVersion: 10.15.3
BuildVersion: 19D76
Currently this extension uses the terminal for results, but if there's a way to make them appear in a regular webview like how VSCode already does it for Ctrl+P commands, that would be good.
Example extension that's similar: https://marketplace.visualstudio.com/items?itemName=tatosjb.fuzzy-search
Hi,
Thanks for making such a useful extension!
I want to ask how I can make it automatically close the terminal panel that runs fzf
after completing or canceling a search session?
Currently, when I cancel a search (by Esc
) or visit a searched pattern (by Enter
), the terminal panel that runs fzf
still open.
FYI, I notice that in another extension https://github.com/tomrijndorp/vscode-finditfaster, it can automatically close the terminal when I press Esc
or Enter
.
Thank you!
Same error as in issue #23, now caused by using terminal profiles instead of the deprecated terminal.integrated.shell
config.
The fix is straightforward, if the old term shell value is not set just query for the new default profile and check for cmd.exe there.
I will add a pull request.
It's a feature request. Please add case-insensitive search for the word under the cursor
Thanks for the extension. Have couple of suggestions to make it easier to find the extension on vscode:
fuzzy
in title/tags/description.search
more. This extension stands out for fuzzy keyword search. Native support for fuzzy file search is quite OK on vscode.Hi @rlivings39!
Very nice extension!
Could it be possible to implement the command "File: open folder..."?
I know that the extension already support "fzf: Add workspace folder using fzf...", but this is slightly different from simply opening the folder.
I'm no expert in TS and VSCode extension, but if you don't have time for that I will try to create a PR for this.
Thanks in advance!
Luca
Currently, every command executed by the extension goes to bash history.
If I'm investigation my code, that means a lot of commands.
I suggest that the commands from the extension skip the history.
I found two approaches for this:
https://stackoverflow.com/a/29188490
https://unix.stackexchange.com/a/10923
The first one looks simpler but it's dependent of the system settings.
cut
on MacOS X is rather more limited than gnu cut, and so cut -z is invalid, producing cut: illegal option -- z
If gcut
is installed through brew install coreutils
then that works as expected, and either OS detection in the extension or a configuration option for the name of the cut
binary could be used. Inserting | tr '\n' '\0'
to nul-terminate the string instead also works.
I'm happy to put a PR in, once I've heard if there's a strong preference one way or the other.
Hello, thanks for the extension.
We have some ideas to improve the workflow using the extension, just like the CTRL+P works.
I want to know if you are accepting PR or should we fork it and work in another rep?
Thanks!
About the ideas:
&& exit
at the end of the command, so you dont have to close de terminal manually after opening a file.I'm thinking in a lot of features xD
If I run one of the commands that uses the current working directory, then the terminal used for fzf is changed to that directory, but runFzfFile
and runFzfAddWorkspaceFolder
run in the same terminal and don't reset the directory to the current workspace, meaning that runFzfFilePwd causes runFzfFile to have the same behaviour if it's run afterwards.
Wrapping the command in a subshell, such as (cd whatever/cwd/is; cmd)
will ensure that the cwd is reset after each command, which is probably cleanest.
Hi
On windows, everything is looking fine: I have fzf and fd; they are working fine together. Until I actually select a file/dir. Then, all the backslashes seem to be quotation characters, thus leaving just one long string. The file/dir, of course, cannot be found by vscode.
Regards
Adam
$ find -type d
find: illegal option -- t
usage: find [-H | -L | -P] [-EXdsx] [-f path] path ... [expression]
find [-H | -L | -P] [-EXdsx] -f path [path ...] [expression]
Using fd
works fine on Mac
Search using rg
and fzf
does not use the codeCmd
.
The code command put on the path doesn't support -a
.
$ fd --type d -I | fzf | xargs -r code -a
Ignoring option a: not supported for code.
At least one file or folder must be provided.
It would be very helpful if the extension commands (runFzfSearch etc) will allow to search across all the projects/folders which belong to the vs-code workspace.
I know that there is an option to search in the project root when using with vim, where "project root" being found by the folder that has .git
folder (basically the repo home upper most directory). Is there a possibility to add this here as well?
Currently if I search in a subfolder, then the search is only within that subfolder, not taking into account files in the project that are found in upper directories.
I'm working on Windows. I found that using fzf: Open file using fzf
the fzf runs well but when I selected the file, vscode dosen't open the file. Also, I got a error message said "The specified path is invalid." on cmd.
After reading the code, I tried the following operations on cmd:
C:\Users\my_username>echo open $$ F:\Path\To\Workspace $$ server\bin\start.bat > "\\?\pipe\fzf-pipe-21160"
C:\Users\my_username>echo open $$ F:\\Path\\To\\Workspace $$ server\bin\start.bat > "\\?\pipe\fzf-pipe-21160"
C:\Users\my_username>echo open $$ F:\\Path\\To\\Workspace $$ server\bin\start.bat > "\\\\?\\pipe\\fzf-pipe-21160"
The specified path is invalid.
C:\Users\my_username>
It shows that, the first 2 command did work and my vscode opened that start.bat
, however, the 3rd one echos an error. But now
what the extension produces is like the 3rd one.
I tried modifying function escapeWinPath
to make it just return origPath;
, and it seems everything works well.
Is it truly necessary to use escapeWinPath
on the named pipe and the path to scripts\topipe.bat
?
PS: I think this extension will really save my time! ๐ vscode's Ctrl+P
can be very slow when I'm working on a large project.
I use Xonsh on Windows and unless I set "terminal.integrated.defaultProfile.windows": "Command Prompt"
(or Powershell) the program behaves as if it is on Linux, however this causes a The specified path is invalid.
fzf | c:\\Users\\XXXXXX\\.vscode\\extensions\\rlivings39.fzf-quick-open-0.5.1\\scripts\\topipe.bat open \\\\?\\pipe\\fzf-pipe-51676
The specified path is invalid.
#42 added some highly requested features. However it relies on $(cmd)
for command substitution. Fish shell users (like me) hit errors because the syntax for fish is (cmd)
. Making an issue to sort this out. Maybe we can just check the terminal settings to craft the right command?
dd90b93 added a setting fzf-quick-open.codeCmd
to handle using code-insiders
for the command rather than code
. We should be able to programmatically determine this.
For example someone saw that the path ~/.vscode-server-insiders/bin/1c36d747fbf113144d3bf82b0aa3cbd290714e38/bin/code-insiders
gets set up with remote ssh. Can we find that and use it?
Hi, just started using and it's a great extension.
I miss being able to set ripgrep options. I have some generated files that are ignored by the default config and it would be nice to be able to set ripgrep flags to not ignore them.
I'm using latest VSCode on latest Windows 10.
Whenever I try to run a fzf-quick-open
command, I get the following error:
I have all three of fd
, rg
, and fzf
in my path, and I'm not sure what else I might have done wrong. Weirdly, the "feature contributions" tab of this extension on VSCode seems to indicate that several commands are added by this plugin, but I can't use any of them.
The initialWorkingDirectory
gave me some weird results.
Looks like it sets to the folder where the last open file but I'm not sure.
For me, this setting worked best
"fzf-quick-open.initialWorkingDirectory": "${workspaceFolder}"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.