Skip to content
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

Doesn't fuzzy search file contents with -e option #1

Closed
robdmc opened this issue Apr 14, 2023 · 3 comments
Closed

Doesn't fuzzy search file contents with -e option #1

robdmc opened this issue Apr 14, 2023 · 3 comments

Comments

@robdmc
Copy link

robdmc commented Apr 14, 2023

Hello.

Great tool! I've always wanted something like this. Thanks for writing.

I am on mac-os installed with brew.

When I run with the -e option, it looks like the fuzzy search is looking for file names instead of the contents of the file. Is this expected behavior?

@robdmc robdmc changed the title Doesn't fuzzy search with -e option Doesn't fuzzy search file contents with -e option Apr 14, 2023
@Magnushhoie
Copy link
Owner

Magnushhoie commented Apr 14, 2023

Hi Rob, thanks for the kind words and glad you're finding it useful :)

The -e flag also showing file-names is intended as a convenience feature. The most common usage patterns (in my experience) are 1) Search for specific text using 'fuz' or 2) Add some text to a specific file using 'fuz -e'.

The latter is easier to perform if it defaults to the file list overview, and faster to type if its just 'fuz -e' instead of 'fuz -e -n'.

However, this makes it a bit more difficult to open a file at a specific matched line in vim. I've modified the echo message shown after selecting a match to include also the matched line in a format that can be copy pasted to open in vim.

# Copy this echoed message (shown after selecting a match)
"notes.txt" +622

# Paste after 'vim' to open at specific line 622
vim "notes.txt" +622

@robdmc
Copy link
Author

robdmc commented Jul 1, 2023

just got back to this. Still been using this tool regularly and loving it. Thanks for the updates. That will help.

@robdmc robdmc closed this as completed Jul 1, 2023
@Magnushhoie Magnushhoie reopened this Sep 30, 2023
@Magnushhoie
Copy link
Owner

Have added a fuz --vimsearch option for this in the dev branch. Also sorting results by time and preserving line order, at the cost of single threading. Will merge in a few days to allow for testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants