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
65c1b532
Commit
65c1b532
authored
10 years ago
by
Junegunn Choi
Browse files
Options
Downloads
Patches
Plain Diff
[vim] Options to xterm command
parent
0b43f988
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
README.md
+23
-14
23 additions, 14 deletions
README.md
plugin/fzf.vim
+3
-1
3 additions, 1 deletion
plugin/fzf.vim
with
26 additions
and
15 deletions
README.md
+
23
−
14
View file @
65c1b532
...
...
@@ -287,7 +287,7 @@ TODO :smiley:
Usage as Vim plugin
-------------------
Note: To use fzf in GVim, bash and xterm are required.
(
Note: To use fzf in GVim, bash and xterm are required.
)
### `:FZF[!]`
...
...
@@ -311,6 +311,13 @@ If you're on a tmux session, `:FZF` will launch fzf in a new split-window whose
height can be adjusted with
`g:fzf_tmux_height`
(default: '40%'). However, the
bang version (
`:FZF!`
) will always start in fullscreen.
In GVim,
`xterm`
command will be used to launch fzf. You can set options to
`xterm`
command with
`g:fzf_xterm_options`
. For example,
```
vim
let
g:fzf_xterm_options
=
'-geometry 120x30'
```
### `fzf#run([options])`
For more advanced uses, you can call
`fzf#run()`
function which returns the list
...
...
@@ -318,16 +325,17 @@ of the selected items.
`fzf#run()`
may take an options-dictionary:
| Option name | Type | Description |
| ------------- | ------------- | ------------------------------------------------------------------ |
|
`source`
| string | External command to generate input to fzf (e.g.
`find .`
) |
|
`source`
| list | Vim list as input to fzf |
|
`sink`
| string | Vim command to handle the selected item (e.g.
`e`
,
`tabe`
) |
|
`sink`
| funcref | Reference to function to process each selected item |
|
`options`
| string | Options to fzf |
|
`dir`
| string | Working directory |
|
`tmux_width`
| number/string | Use tmux vertical split with the given height (e.g.
`20`
,
`50%`
) |
|
`tmux_height`
| number/string | Use tmux horizontal split with the given height (e.g.
`20`
,
`50%`
) |
| Option name | Type | Description |
| --------------- | ------------- | ------------------------------------------------------------------ |
|
`source`
| string | External command to generate input to fzf (e.g.
`find .`
) |
|
`source`
| list | Vim list as input to fzf |
|
`sink`
| string | Vim command to handle the selected item (e.g.
`e`
,
`tabe`
) |
|
`sink`
| funcref | Reference to function to process each selected item |
|
`options`
| string | Options to fzf |
|
`dir`
| string | Working directory |
|
`tmux_width`
| number/string | Use tmux vertical split with the given height (e.g.
`20`
,
`50%`
) |
|
`tmux_height`
| number/string | Use tmux horizontal split with the given height (e.g.
`20`
,
`50%`
) |
|
`xterm_options`
| string | Options to
`xterm`
command (Only used in GVim) |
#### Examples
...
...
@@ -353,9 +361,10 @@ nnoremap <silent> <Leader>C :call fzf#run({
\
'source'
:
\
map
(
split
(
globpath
(
&
rtp
,
"colors/*.vim"
),
"\n"
),
\
"substitute(fnamemodify(v:val, ':t'), '\\..\\{-}$', '', '')"
),
\
'sink'
:
'colo'
,
\
'options'
:
'+m'
,
\
'tmux_width'
:
20
\
'sink'
:
'colo'
,
\
'options'
:
'+m'
,
\
'tmux_width'
:
20
,
\
'xterm_options'
:
'-geometry 20x30'
\
})<
CR
>
```
...
...
This diff is collapsed.
Click to expand it.
plugin/fzf.vim
+
3
−
1
View file @
65c1b532
...
...
@@ -125,7 +125,9 @@ function! s:execute(dict, command, temps)
call
s:pushd
(
a:dict
)
silent
!
clear
if
has
(
'gui_running'
)
execute
"silent !xterm -e bash -ic '"
.
substitute
(
a:command
,
"'"
,
"'\"'\"'"
,
'g'
).
"'"
let
xterm_options
=
get
(
a:dict
,
'xterm_options'
,
get
(
g
:,
'fzf_xterm_options'
,
''
))
execute
"silent !xterm "
.
xterm_options
.
\
" -e bash -ic '"
.
substitute
(
a:command
,
"'"
,
"'\"'\"'"
,
'g'
).
"'"
else
execute
'silent !'
.
a:command
endif
...
...
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