snippets/old_snippets/vim-fzf-plugin.en.md

36 lines
1.1 KiB
Markdown

---
title: "vim fzf plugin"
date: 2020-01-30T14:57:50+01:00
draft: false
snippet_types: ["vim", "search"]
---
I've used several fuzzy finder utilities in vim over the years like
[Command T](https://github.com/wincent/Command-T) or
[CtrlP](https://github.com/ctrlpvim/ctrlp.vim). They both have there pluses and
minuses but never found them to be that fast especially with large code bases
I'm often working in. Fzf for me is superior so I was excited to see a plugin
that integrates Fzf so well into vim. Its not just useful for finding files but
works great with buffers, files with git changes, commands, marks, and even
lines in open buffers.
My vim config for Fzf is as follows:
```vim script
nnoremap <Leader>pb :Buffers<CR>
nnoremap <Leader>pf :GFiles<CR>
nnoremap <Leader>pg :GFiles?<CR>
nnoremap <Leader>pm :Marks<CR>
nnoremap <Leader>pc :History:<CR>
nnoremap <Leader>pl :Lines<CR>
```
This allows me to easily zip around my code base with speed.
{{< asciicast-with-caption id="296788" title="demo using fzf in vim" >}}
sources:
- https://github.com/wincent/Command-T
- https://github.com/ctrlpvim/ctrlp.vim
- https://github.com/junegunn/fzf.vim