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

Suggestion: bind helm-find or ag/ack/pt equivalent #3108

Closed
bmag opened this issue Sep 23, 2015 · 10 comments
Closed

Suggestion: bind helm-find or ag/ack/pt equivalent #3108

bmag opened this issue Sep 23, 2015 · 10 comments
Labels
Discussion Key Bindings stale marked as a stale issue/pr (usually by a bot)

Comments

@bmag
Copy link
Collaborator

bmag commented Sep 23, 2015

Sometimes I want to search for a file in directory, and I find that SPC p f (projectile) and SPC f L (locate) just aren't good enough. This usually happens when I want to search a directory that isn't part of a project, or to search a specific sub-directory in a large project.

I found two ways to accomplish this specific task: 1) helm-find. 2) invoke helm-ag and pass -g when prompted for a pattern argument.

I propose we (possibly me) write a function that uses ag, ack, pt or find (according to dotspacemacs-search-tools or a new variable) to search for files in a directory, similar to what is done in spacemacs/helm-files-smart-do-search (SPC s f). The new function will be bound to SPC f F instead of helm-find-files, since it is a good mnemonic and we already have spacemacs/helm-find-files on SPC f f.

@justbur
Copy link
Contributor

justbur commented Sep 23, 2015

Using helm ag to do this shouldn't be hard. I can throw something together

@syl20bnr
Copy link
Owner

We have to find another key binding than SPC f F because this one is consistent with the other bindings SPC s F, SPC s P etc.... Which search for things under point. Maybe SPC f d for find file in a directory ? I cannot verify if this key binding is free for now but I believe it is.

@bmag
Copy link
Collaborator Author

bmag commented Sep 23, 2015

@justbur I opened a related issue in helm-ag: emacsorphanage/helm-ag#172

@syl20bnr SPC f d sounds good to me, I wasn't aware that SPC f F uses the file at point.

@justbur
Copy link
Contributor

justbur commented Sep 23, 2015

I was avoiding helm-find because it wasn't working for me on windows, but I just needed to set find-program to a suitable unix version of find and everything works great now. Maybe we should just use helm-find?

@justbur
Copy link
Contributor

justbur commented Sep 23, 2015

On the key bindings SPC f d is fine with me too, but I was thinking of maybe SPC f l for helm-find and SPC f L for helm-locate (as it is now), the idea being that you are looking locally or globally, based on capitalization. Would have to move find-file-literally then (how useful is that command?)

@bmag
Copy link
Collaborator Author

bmag commented Sep 23, 2015

I don't really know what works better on windows, so I thought we could give the user the option to use what he/she prefers. I'm also not sure about all the differences between find and ag, I was hoping someone here would know more. If you say it is easy to set up find on Windows, then using helm-find is definitely an option.

@justbur
Copy link
Contributor

justbur commented Sep 23, 2015

The advantage of ag for windows is the ability to use pt actually. I think (but I'm not sure) that regex would be easier with helm-ag if you want that.

@bmag
Copy link
Collaborator Author

bmag commented Sep 26, 2015

In response to my question about a helm-ag command for finding files. the maintainer of helm-ag says in emacsorphanage/helm-ag#172 (comment):

Is there a chance you will implement such a command?

No. You want to use such command, please add it to your init.el.

Which means we either implement it in Spacemacs, or just use helm-find. From a stability point of view, implementing our own means we need to synchronize it with the original package, or use a fork. I think it would require more effort than it's worth, so I'm in favour of just using helm-find, as implemented in @justbur's PR.

@justbur
Copy link
Contributor

justbur commented Nov 18, 2015

@StreakyCobra #3114

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid!

@github-actions github-actions bot added the stale marked as a stale issue/pr (usually by a bot) label Feb 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Discussion Key Bindings stale marked as a stale issue/pr (usually by a bot)
Projects
None yet
Development

No branches or pull requests

4 participants