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

Provide a option to enable CtrlP for file searching #1544

Closed
tuhdo opened this issue May 9, 2015 · 11 comments
Closed

Provide a option to enable CtrlP for file searching #1544

tuhdo opened this issue May 9, 2015 · 11 comments
Labels
Enhancement ☺ Ready for work stale marked as a stale issue/pr (usually by a bot)

Comments

@tuhdo
Copy link
Contributor

tuhdo commented May 9, 2015

I think many Vim users are used to CtrlP plugin. It would be nice if we provide a spacemacs option i.e. spacemacs-enable-ctrl-p to use CtrlP for a combined all in one Spacemacs source for file navigation (Helm Projectile sources can be combined and used outside of any directory fine). Here is an example of such command using helm-multi-files:

(setq helm-for-files-preferred-list '(helm-source-buffers-list
                                      helm-source-buffer-not-found
                                      helm-source-projectile-projects
                                      helm-source-projectile-files-list
                                      helm-source-recentf
                                      helm-source-bookmarks
                                      helm-source-file-cache
                                      ;; helm-source-files-in-current-dir
                                      ))

(define-key evil-normal-state-map (kbd "C-p") 'helm-multi-files)

We can then say to use original CtrlP command in Vim, simply press M-/.

@tuhdo
Copy link
Contributor Author

tuhdo commented May 9, 2015

Or we could just use helm-projectile-sources-list and add the above sources and simply use helm-projectile command. The difference is that you can invoke helm-locate from helm-multi-files with C-c C-p, but then adding Helm Projectile sources to helm-for-files-preferred-list will cause error because Helm Projectile is not yet loaded.

@syl20bnr
Copy link
Owner

syl20bnr commented May 9, 2015

This is interesting, C-S-p could be used as well, I don't think it is used in spacemacs.

@tuhdo
Copy link
Contributor Author

tuhdo commented May 9, 2015

I think we should just use Ctrl-p, since C-S-p won't work in terminal (which many Vim users are accustomed to) and let user choose it. Ctrl-p is easer to press as well.

@syl20bnr
Copy link
Owner

syl20bnr commented May 9, 2015

So we have to find another key for hippie-expand. I know thhere is already one on M- but in Vim style we use C- instead, M- is not really necessary as opposed with Emacs which is modifier driven.

@tuhdo
Copy link
Contributor Author

tuhdo commented May 9, 2015

So how about C-/ (for Vim style only)? C-/ is bond to undo-tree-undo, but it already exists with C-u. And C-/ is symmetric: instead moving your pinky above, you move below the ; key.

@catesandrew
Copy link
Contributor

+1 for C-p even though syl20bnr makes a strong argument against it. Coming from vim this command is so heavily used, it just needs to be C-p. For me, I gave up evil pop but can still use that with M-y, which i'm more used to using anyways with emacs.

@opyate
Copy link

opyate commented Jul 10, 2015

Just my 2 cents from someone coming here having had experience with Ctrl-p under Vim and looking for "open file" functionality. You can open a file using SPC f f. It doesn't search recursively, but then I keep my projects small and don't need it.

@sdwolfz
Copy link
Collaborator

sdwolfz commented May 10, 2017

Also my 2¢, I am a C-p vim user. When switching to Spacemacs I found out about SPC p f which is helm-projectile-find-file. This is the CtrlP equivalent AFAIC.

@thorvn
Copy link

thorvn commented Mar 9, 2018

I am a vim user. When I switching to Spacemacs. I config like this(remember to reload your spacemacs):
(define-key evil-normal-state-map (kbd "C-p") 'helm-projectile-find-file)
So now, you can use like CtrlP.

@dkrieger
Copy link

dkrieger commented Apr 2, 2019

Is there a way to make projectile treat the current directory as if it were a project dynamically, i.e. without actually placing an empty .projectile file in the dir? This is how I have fzf configured to work in vim, and it's extremely useful. If i'm in netrw, it uses '%', if I'm in a file, it uses '%:h'

@github-actions
Copy link

github-actions bot commented Apr 1, 2020

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 Apr 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement ☺ Ready for work stale marked as a stale issue/pr (usually by a bot)
Projects
None yet
Development

No branches or pull requests

9 participants