diff options
author | Junegunn Choi <junegunn.c@gmail.com> | 2020-02-16 12:32:20 +0900 |
---|---|---|
committer | Junegunn Choi <junegunn.c@gmail.com> | 2020-02-16 12:32:20 +0900 |
commit | b57e6cff7e54bd8dfcb60b2917ffe53d67507046 (patch) | |
tree | 30054f8768cf5530d39d304d42c72e666e0944b8 /plugin | |
parent | 5b99f19dac5dfcdf1cbb322a73406e1edeb9ae23 (diff) |
[vim] Pick up fzf-tmux on $PATH when bin/fzf-tmux is not found
Close #1874
Diffstat (limited to 'plugin')
-rw-r--r-- | plugin/fzf.vim | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/plugin/fzf.vim b/plugin/fzf.vim index 0f7a5be4..17d1dce1 100644 --- a/plugin/fzf.vim +++ b/plugin/fzf.vim @@ -164,7 +164,7 @@ function! s:fzf_exec() endfunction function! s:tmux_enabled() - if has('gui_running') + if has('gui_running') || !exists('$TMUX') return 0 endif @@ -173,10 +173,16 @@ function! s:tmux_enabled() endif let s:tmux = 0 - if exists('$TMUX') && executable(s:fzf_tmux) - let output = system('tmux -V') - let s:tmux = !v:shell_error && output >= 'tmux 1.7' + if !executable(s:fzf_tmux) + if executable('fzf-tmux') + let s:fzf_tmux = 'fzf-tmux' + else + return 0 + endif endif + + let output = system('tmux -V') + let s:tmux = !v:shell_error && output >= 'tmux 1.7' return s:tmux endfunction |