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

Added FZF support #20

Merged
merged 1 commit into from
Jun 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ and launch tests at the speed of light!

**Attention:** [ctrlp.vim](https://github.com/ctrlpvim/ctrlp.vim) must be installed.

### FZF

If you are using [FZF](https://github.com/junegunn/fzf.vim), `vim-gtest` extends *FZF* with a google test finder.
Now you can find and launch tests at the speed of light!

### QuickFix

You can tell `vim-gtest` to highlight failing tests using vim's *QuickFix*.
Expand Down
12 changes: 12 additions & 0 deletions after/plugin/fzf.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
let s:old_cpo = &cpo
set cpo&vim

if !exists(':FZF')
finish
endif

command! -bang -nargs=* FZFGTest call fzf#gtest#SelectTest(<q-args>, <bang>0)

let &cpo = s:old_cpo
unlet s:old_cpo

16 changes: 16 additions & 0 deletions autoload/fzf/gtest.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
if exists("loaded_fzf_gtest")
finish
endif
let loaded_fzf_gtest = 1

function! fzf#gtest#SelectTest(...)
if exists(':FZF')
return fzf#run({
\ 'source': gtest#GetAllTests(),
\ 'options': '+m -n 1 --prompt GTest\>\ ',
\ 'down': '30%',
\ 'sink': function('gtest#GTestRunOnly')})
endif
endfunction


5 changes: 5 additions & 0 deletions doc/gtest.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ It's a fantastic fuzzy finder for vim! Try it immediately! https://github.com/ct
This plugin extends *ctrlp.vim* with a google test finder. Now you can find
and launch tests at the speed of light!

FZF *gtest-fzf*

If you are using FZF (https://github.com/junegunn/fzf.vim), this plugin extends *FZF* with a google test finder. Now you can find
and launch tests at the speed of light!

QUICKFIX *gtest-quickfix*

You can tell `vim-gtest` to highlight failing tests using vim's *QuickFix*.
Expand Down