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

counsel-dired #1993

Closed
seagle0128 opened this issue Apr 1, 2019 · 9 comments
Closed

counsel-dired #1993

seagle0128 opened this issue Apr 1, 2019 · 9 comments

Comments

@seagle0128
Copy link
Contributor

@seagle0128 seagle0128 commented Apr 1, 2019

Maybe I was missing something. I am just wondering why there is no implementation for dired. It's easy to implement, but I don't know if there is any side-effects or other issues?

If NO, I'd happy to make a PR.

(defun counsel-dired (&optional initial-input)
  "Forward to `dired'.
When INITIAL-INPUT is non-nil, use it in the minibuffer during completion."
  (interactive)
  (ivy-read "Dired (directory): " #'read-file-name-internal
            :matcher #'counsel--find-file-matcher
            :initial-input initial-input
            :action (lambda (d) (dired (expand-file-name d)))
            :preselect (counsel--preselect-file)
            :require-match 'confirm-after-completion
            :history 'file-name-history
            :keymap counsel-find-file-map
            :caller 'counsel-dired))
@jixiuf
Copy link
Contributor

@jixiuf jixiuf commented Apr 1, 2019

try https://github.com/jixiuf/ivy-dired-history
it is integrated with dired dired-do-copy and dired-do-rename. when you press C (copy) or R (rename) , it allow users to select a directory from the recent dired history .

Loading

@seagle0128
Copy link
Contributor Author

@seagle0128 seagle0128 commented Apr 1, 2019

@jixiuf Thank you! But I don't think they have the same purpose.

Loading

@CeleritasCelery
Copy link
Contributor

@CeleritasCelery CeleritasCelery commented Apr 2, 2019

rather then creating a new ivy function, why not just add the dired actions to the counsel-find-file action list.

Loading

@seagle0128
Copy link
Contributor Author

@seagle0128 seagle0128 commented Apr 2, 2019

@CeleritasCelery that's fine. But how to remap C-x d?

Loading

@CeleritasCelery
Copy link
Contributor

@CeleritasCelery CeleritasCelery commented Apr 2, 2019

Are you asking how to map counsel-find-file to C-x d?

Loading

@seagle0128
Copy link
Contributor Author

@seagle0128 seagle0128 commented Apr 3, 2019

@CeleritasCelery find-file is different from dired, right? The behavior is not quite same.

Loading

@CeleritasCelery
Copy link
Contributor

@CeleritasCelery CeleritasCelery commented Apr 3, 2019

Right, but if you navigate to a directory it opens it in dired. So seems to serve the same purpose. Unless I misunderstood something.

Loading

@seagle0128
Copy link
Contributor Author

@seagle0128 seagle0128 commented Apr 3, 2019

@CeleritasCelery Yes, for directory (., ..) they have the same functionality. But for others, they are different. You should think about it: why vanilla Emacs has find-file and dired?

Loading

@abo-abo
Copy link
Owner

@abo-abo abo-abo commented Apr 3, 2019

I think it might be useful to have it. Please PR.

Loading

@abo-abo abo-abo closed this in b34bf45 Apr 3, 2019
astoff added 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
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants