Skip to content

Can't get fd working with counsel-file-jump #2196

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

Closed
andreyorst opened this issue Aug 12, 2019 · 3 comments
Closed

Can't get fd working with counsel-file-jump #2196

andreyorst opened this issue Aug 12, 2019 · 3 comments

Comments

@andreyorst
Copy link

andreyorst commented Aug 12, 2019

Not related to #1926.

I've set my find-program to fd like this:

(setq find-program "fd"))

After that I've set up counsel-file-jump-args:

(setq counsel-file-jump-args (split-string "-L --type f --hidden")))

And when I use counsel-file-jump I get truncated names:

image
those are .bashrc, .zshrc, and .gitconfig.

I've inspected the code and saw that counsel--find-return-list truncates the line by 2 characters:

swiper/counsel.el

Lines 2611 to 2612 in 20d604c

(push (buffer-substring
(+ 2 (line-beginning-position)) (line-end-position)) files)

Assuming that input was ./.bashrc, ./.zshrc, and ./.gitconfig truncating will result to proper file names. However fd omits ./ in the beginning of the path, which leads to my problem.

How should I migrate this?

@andreyorst
Copy link
Author

andreyorst commented Aug 12, 2019

I can get it working with ripgrep but since counsel-file-jump-args is now a list, how do I specify --glob '!.git/ argument for rg?

All of these isn't working:

'("." "--files" "--glob '!.git/'")
'("." "--files" "--glob" "'!.git/'")
'("." "--files" "--glob" "\\'!.git/\\'")
'("." "--files" "--glob" "\"!.git/\"")
'("." "--files" "--glob=\\!.git/")

@abo-abo
Copy link
Owner

abo-abo commented Aug 21, 2019

Thanks, please test. The "./" issue should be gone now. If there's still something missing, please open a new issue.

@andreyorst
Copy link
Author

Yes, everything works as expected now

astoff pushed a commit to astoff/swiper that referenced this issue Jan 1, 2021
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