Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
fzf
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to JiHu GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
KMSCAKKSCFKA AKFACAMADCAS
fzf
Commits
3e91c189
Commit
3e91c189
authored
10 years ago
by
Junegunn Choi
Browse files
Options
Downloads
Patches
Plain Diff
[vim] Defer `type fzf` to reduce startup time
parent
b0f80b68
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
plugin/fzf.vim
+21
-11
21 additions, 11 deletions
plugin/fzf.vim
with
21 additions
and
11 deletions
plugin/fzf.vim
+
21
−
11
View file @
3e91c189
...
...
@@ -25,22 +25,27 @@ let s:min_tmux_width = 10
let
s:min_tmux_height
=
3
let
s:default_tmux_height
=
'40%'
let
s:launcher
=
'xterm -e bash -ic %s'
let
s:fzf_rb
=
expand
(
'<sfile>:h:h'
).
'/fzf'
let
s:cpo_save
=
&
cpo
set
cpo
&
vim
call
system
(
'type fzf'
)
if
v
:
shell_error
let
s:fzf_rb
=
expand
(
'<sfile>:h:h'
).
'/fzf'
if
executable
(
s:fzf_rb
)
let
s:exec
=
s:fzf_rb
function
!
s:fzf_exec
()
if
!
exists
(
's:exec'
)
call
system
(
'type fzf'
)
if
v
:
shell_error
let
s:exec
=
executable
(
s:fzf_rb
)
?
s:fzf_rb
:
''
else
let
s:exec
=
'fzf'
endif
return
s:fzf_exec
()
elseif
empty
(
s:exec
)
unlet
s:exec
throw
'fzf executable not found'
else
echoerr
'fzf executable not found'
finish
return
s:exec
endif
else
let
s:exec
=
'fzf'
endif
endfunction
function
!
s:tmux_enabled
()
if
has
(
'gui_running'
)
...
...
@@ -71,6 +76,11 @@ function! fzf#run(...) abort
let
dict
=
exists
(
'a:1'
)
?
a:1
:
{}
let
temps
=
{
'result'
:
tempname
()
}
let
optstr
=
get
(
dict
,
'options'
,
''
)
try
let
fzf_exec
=
s:fzf_exec
()
catch
throw
v
:
exception
endtry
if
has_key
(
dict
,
'source'
)
let
source
=
dict
.
source
...
...
@@ -87,7 +97,7 @@ function! fzf#run(...) abort
else
let
prefix
=
''
endif
let
command
=
prefix
.
s:
exec
.
' '
.
optstr
.
' > '
.
temps
.
result
let
command
=
prefix
.
fzf_
exec
.
' '
.
optstr
.
' > '
.
temps
.
result
if
s:tmux_enabled
()
&&
s:tmux_splittable
(
dict
)
return
s:execute_tmux
(
dict
,
command
,
temps
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment