diff options
author | Junegunn Choi <junegunn.c@gmail.com> | 2015-04-19 17:13:07 +0900 |
---|---|---|
committer | Junegunn Choi <junegunn.c@gmail.com> | 2015-04-19 17:13:07 +0900 |
commit | 537d07c1e5133727dddbd6a345f5926719a3d7b4 (patch) | |
tree | b31666cb5273eeae2f1ec2aad6f5863b4f5775ce /plugin | |
parent | d091a2c4bb47b0b9abe52d5941bfbfeb6a8dc644 (diff) |
[vim] Use "system" fzf when available
1. Go binary: ../bin/fzf
2. System fzf: $(which fzf)
3. Download fzf from GitHub or create wrapper script to Ruby version (../fzf)
when the binary for the platform is not available
4. If install script is not found or for some reason failed, try to use Ruby
version in its expected location (../fzf)
5. If fzf is found to be a shell function, use it (type fzf)
Diffstat (limited to 'plugin')
-rw-r--r-- | plugin/fzf.vim | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/plugin/fzf.vim b/plugin/fzf.vim index 7015e28f..8746af09 100644 --- a/plugin/fzf.vim +++ b/plugin/fzf.vim @@ -36,17 +36,17 @@ function! s:fzf_exec() if !exists('s:exec') if executable(s:fzf_go) let s:exec = s:fzf_go - elseif !s:installed && executable(s:install) - echohl WarningMsg - echo 'Downloading fzf binary. Please wait ...' - echohl None - let s:installed = 1 - call system(s:install.' --bin') - return s:fzf_exec() else let path = split(system('which fzf 2> /dev/null'), '\n') if !v:shell_error && !empty(path) let s:exec = path[0] + elseif !s:installed && executable(s:install) + echohl WarningMsg + echo 'Downloading fzf binary. Please wait ...' + echohl None + let s:installed = 1 + call system(s:install.' --bin') + return s:fzf_exec() elseif executable(s:fzf_rb) let s:exec = s:fzf_rb else |