From 3001fd3d6596c85c17dc5f32b9dfb983081932e2 Mon Sep 17 00:00:00 2001 From: Stephanie Viccari Date: Fri, 12 Jul 2019 17:09:20 -0400 Subject: [PATCH] Replace CtrlP with FZF Summary: Using CtrlP has proven to be slower and has fewer features. We've been switching over to FZF on a frequent enough basis that it feels appropriate to make FZF the new default for fuzzy searching. By swapping out Ctrlp in favor of FZF, this should not break anyone's fuzzy search but it will replace the tool that executes the search. Co-authored-by: Chris Toomey --- README-ES.md | 2 +- README.md | 2 +- vimrc | 10 +++++----- vimrc.bundles | 7 ++++++- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/README-ES.md b/README-ES.md index 1009cb2..6b301e6 100644 --- a/README-ES.md +++ b/README-ES.md @@ -182,7 +182,7 @@ sin importar de nombre del archivo: ConfiguraciĆ³n [vim](http://www.vim.org/): -* [Ctrl-P](https://github.com/ctrlpvim/ctrlp.vim) para hallazgo difuso de archivos/buffer/tags. +* [fzf](https://github.com/junegunn/fzf.vim) para hallazgo difuso de archivos/buffer/tags. * [Rails.vim](https://github.com/tpope/vim-rails) para una mejor navegaciĆ³n de la estructura de archivos de Rails via `gf` y `:A` (alterno), `:Rextract` parciales,`:Rinvert` migraciones, etc. * Ejecuta muchos tipos de pruebas [desde vim]([https://github.com/janko-m/vim-test) diff --git a/README.md b/README.md index 3d9a6b9..b8c5b50 100644 --- a/README.md +++ b/README.md @@ -181,7 +181,7 @@ What's in it? [vim](http://www.vim.org/) configuration: -* [Ctrl-P](https://github.com/ctrlpvim/ctrlp.vim) for fuzzy file/buffer/tag finding. +* [fzf](https://github.com/junegunn/fzf.vim) for fuzzy file/buffer/tag finding. * [Rails.vim](https://github.com/tpope/vim-rails) for enhanced navigation of Rails file structure via `gf` and `:A` (alternate), `:Rextract` partials, `:Rinvert` migrations, etc. diff --git a/vimrc b/vimrc index 216e63e..b2a05a8 100644 --- a/vimrc +++ b/vimrc @@ -91,11 +91,8 @@ if executable('ag') " Use Ag over Grep set grepprg=ag\ --nogroup\ --nocolor - " Use ag in CtrlP for listing files. Lightning fast and respects .gitignore - let g:ctrlp_user_command = 'ag --literal --files-with-matches --nocolor --hidden -g "" %s' - - " ag is fast enough that CtrlP doesn't need to cache - let g:ctrlp_use_caching = 0 + " Use ag in fzf for listing files. Lightning fast and respects .gitignore + let $FZF_DEFAULT_COMMAND = 'ag --literal --files-with-matches --nocolor --hidden -g ""' if !exists(":Ag") command -nargs=+ -complete=file -bar Ag silent! grep! |cwindow|redraw! @@ -162,6 +159,9 @@ nnoremap l nnoremap ]r :ALENextWrap nnoremap [r :ALEPreviousWrap +" Map Ctrl + p to open fuzzy find (FZF) +nnoremap :Files + " Set spellfile to location that is guaranteed to exist, can be symlinked to " Dropbox or kept in Git and managed outside of thoughtbot/dotfiles using rcm. set spellfile=$HOME/.vim-spell-en.utf-8.add diff --git a/vimrc.bundles b/vimrc.bundles index 7b6e710..8c87f35 100644 --- a/vimrc.bundles +++ b/vimrc.bundles @@ -16,7 +16,12 @@ call plug#begin('~/.vim/bundle') " Define bundles via Github repos Plug 'christoomey/vim-run-interactive' -Plug 'ctrlpvim/ctrlp.vim' +if executable('fzf') + Plug '/usr/local/opt/fzf' +else + Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } +endif +Plug 'junegunn/fzf.vim' Plug 'elixir-lang/vim-elixir' Plug 'fatih/vim-go' Plug 'janko-m/vim-test'