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

Question: Why use CtrlP when FZF can do the same? #124

Closed
rakr opened this issue Apr 1, 2017 · 9 comments
Closed

Question: Why use CtrlP when FZF can do the same? #124

rakr opened this issue Apr 1, 2017 · 9 comments

Comments

@rakr
Copy link
Contributor

rakr commented Apr 1, 2017

Hi,

Both FZF and CtrlP are part of space-vim packages. Both of do fuzzy finding searches.
Typing :Files triggers the search using FZF, CtrlP triggers the search using CtrlP.
It seems like there is one too many, my opinion would be to keep FZF and remove CtrlP.

Would love to hear your thoughts on this.

@liuchengxu
Copy link
Owner

liuchengxu commented Apr 1, 2017

A command-line fuzzy finder written in Go -- fzf

fzf is definitely an amazing command-line tool for terminal guys, whereas not everyone lives in the terminal. I know fzf now also works in GVim, but it's not so perfect in that case personally, so I remain the similar plugin ctrlp. Please let me know if I miss something.

2017-04-01 3 27 22

@rakr
Copy link
Contributor Author

rakr commented Apr 1, 2017

Spot on, I never use gvim, so I do live in the terminal, so I never realised that FZF did not work in graphical vim.

I'm seeing different options:

  • do nothing, and leave it to the user to configure FZF instead of CtrlP (that's what I've done so far)
  • In space-vim, if terminal then use FZF if gvim use CtrlP

Both of these options have pros and cons, so probably worth getting other people's opinion.

@tracyone
Copy link
Contributor

tracyone commented Apr 1, 2017

unite has same function of ctrlp and fzf too

@liuchengxu
Copy link
Owner

liuchengxu commented Apr 1, 2017

@tracyone Since the active development on unite.vim has stopped, I think we should put it on a low priority, at least with regard to fuzzy searching. What's more, I have tried to avoid letting unite.vim play an important role in space-vim :).

@liuchengxu
Copy link
Owner

liuchengxu commented Apr 2, 2017

@rakr Or we could have another option: keep both of them. Here are my thoughts:

  • Ctrlp.vim is usually invoked via intuitive C-p. I think it has no conflicts with key bindings from fzf, which is invoked by <Leader> related mappings.
  • Ctrlp.vim has little impact on the performance of startup and the speed of searching is also acceptable. What we have to pay are just some bits in the disk :).

@rakr
Copy link
Contributor Author

rakr commented Apr 3, 2017

I gave up on CtrlP a long time ago, especially if you are like me and fire Vim in your home directory and then you look for a file. with CtrlP it takes ages, so I quickly added the silver searcher to the mix and when I found FZF that was a revelation.

I don't have any issue with keeping them both, but I think that having two tools to do the same thing is on too many.

I also recognise the fact that people do have different preferences and work differently. Some prefer GUI over terminal while others have the opposite preference.

The solution I've used (to remap C-p to FZF works perfectly for me as it avoids my silly mistake. I'll document this in the readme if you wish.

@liuchengxu
Copy link
Owner

Yes, I also intend to write a tutorial about the plugins used in space-vim. Maybe we could put the tutorial in wiki and add this into it.

@liuchengxu
Copy link
Owner

liuchengxu commented Oct 15, 2017

Thanks to great junegunn, now fzf can also run inside GVim using the new builtin terminal emulator of Vim 🎉 , see this post. Thus, now only when users use gui Vim without the terminal feature, space-vim start to use LeaderF instead, which is also a nice option. CtrlP has been separated out as a single layer already.

2017-10-15 9 35 00

@liuchengxu
Copy link
Owner

Two years later, I create another brand new similar plugin vim-clap which is in pure vimscirpt and the minimal dependency. It's not for replacing the others completely but merely a new option, especially good for the windows users in my opinion. You can enable it by adding let g:spacevim_enable_clap = 1 to your .spacevim.

substring

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

No branches or pull requests

3 participants