Skip to content
Myr

[vim] Enable fzf in GVim using xterm

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Junegunn Choi · committed by Junegunn Choi · parent f8e357f · Browse files · 2 files+14 added−4 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+14 added−4 removed

  • other:+14 added−4 removed

2 files+14 added−4 removed

modified:plugin/fzf.vim+13 added-3 removed
22 unmodified lines
2324let s:min_tmux_width = 1025let s:min_tmux_height = 326let s:default_tmux_height = '40%'27let s:gui_supported = executable('bash') && executable('xterm')2829let s:cpo_save = &cpo30set cpo&vim31
10 unmodified lines
42 let s:exec = 'fzf'43endif4445function! s:tmux_enabled()46 if has('gui_running')47 return 048 endif4950 if exists('s:tmux')51 return s:tmux52 endif53
13 unmodified lines
67 return substitute(a:path, ' ', '\\ ', 'g')68endfunction6970function! fzf#run(...) abort66 if has('gui_running')71 if has('gui_running') && !s:gui_supported72 echohl Error68 echo 'GVim is not supported'73 echo 'bash and xterm required to run fzf in GVim'74 return []75 endif7677 let dict = exists('a:1') ? a:1 : {}78 let temps = { 'result': tempname() }79 let optstr = get(dict, 'options', '')80
42 unmodified lines
123124function! s:execute(dict, command, temps)125 call s:pushd(a:dict)126 silent !clear127 if has('gui_running')128 execute "silent !xterm -e bash -ic '".substitute(a:command, "'", "'\"'\"'", 'g')."'"129 else121 execute 'silent !'.a:command130 execute 'silent !'.a:command131 endif132 redraw!133 if v:shell_error134 return []135 else
96 unmodified lines
modified:README.md+1 added-1 removed
285 unmodified lines
286287Usage as Vim plugin288-------------------289290(fzf is a command-line utility, naturally it is only accessible in terminal Vim)290Note: To use fzf in GVim, bash and xterm are required.291292### `:FZF[!]`293294If you have set up fzf for Vim, `:FZF` command will be added.
244 unmodified lines