mirror of
https://github.com/junegunn/fzf.vim.git
synced 2025-12-07 13:14:30 +08:00
[Files] Add g:fzf_files_options
This commit is contained in:
11
README.md
11
README.md
@@ -121,11 +121,14 @@ let g:fzf_colors =
|
|||||||
|
|
||||||
#### Command-local options
|
#### Command-local options
|
||||||
|
|
||||||
The right-hand-side values are the default values for the options.
|
|
||||||
|
|
||||||
```vim
|
```vim
|
||||||
|
" [Files] Extra options for fzf
|
||||||
|
" e.g. File preview using CodeRay (http://coderay.rubychan.de/)
|
||||||
|
let g:fzf_files_options =
|
||||||
|
\ '--preview "(coderay {} || cat {}) 2> /dev/null | head -'.&lines.'"'
|
||||||
|
|
||||||
" [Buffers] Jump to the existing window if possible
|
" [Buffers] Jump to the existing window if possible
|
||||||
let g:fzf_buffers_jump = 0
|
let g:fzf_buffers_jump = 1
|
||||||
|
|
||||||
" [[B]Commits] Customize the options used by 'git log':
|
" [[B]Commits] Customize the options used by 'git log':
|
||||||
let g:fzf_commits_log_options = '--graph --color=always --format="%C(auto)%h%d %s %C(black)%C(bold)%cr"'
|
let g:fzf_commits_log_options = '--graph --color=always --format="%C(auto)%h%d %s %C(black)%C(bold)%cr"'
|
||||||
@@ -134,7 +137,7 @@ let g:fzf_commits_log_options = '--graph --color=always --format="%C(auto)%h%d %
|
|||||||
let g:fzf_tags_command = 'ctags -R'
|
let g:fzf_tags_command = 'ctags -R'
|
||||||
|
|
||||||
" [Commands] --expect expression for directly executing the command
|
" [Commands] --expect expression for directly executing the command
|
||||||
let g:fzf_commands_expect = 'ctrl-x'
|
let g:fzf_commands_expect = 'alt-enter,ctrl-x'
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Advanced customization using autoload functions
|
#### Advanced customization using autoload functions
|
||||||
|
|||||||
@@ -191,7 +191,7 @@ endfunction
|
|||||||
" Files
|
" Files
|
||||||
" ------------------------------------------------------------------
|
" ------------------------------------------------------------------
|
||||||
function! fzf#vim#files(dir, ...)
|
function! fzf#vim#files(dir, ...)
|
||||||
let args = {'options': '-m'}
|
let args = {'options': '-m '.get(g:, 'fzf_files_options', '')}
|
||||||
if !empty(a:dir)
|
if !empty(a:dir)
|
||||||
if !isdirectory(expand(a:dir))
|
if !isdirectory(expand(a:dir))
|
||||||
return s:warn('Invalid directory')
|
return s:warn('Invalid directory')
|
||||||
|
|||||||
@@ -151,6 +151,11 @@ Global options~
|
|||||||
Command-local options~
|
Command-local options~
|
||||||
|
|
||||||
>
|
>
|
||||||
|
" [Files] Extra options for fzf
|
||||||
|
" e.g. File preview using coderay (http://coderay.rubychan.de/)
|
||||||
|
let g:fzf_files_options =
|
||||||
|
\ '--preview "(coderay {} || cat {}) 2> /dev/null | head -'.&lines.'"'
|
||||||
|
|
||||||
" [Buffers] Jump to the existing window if possible
|
" [Buffers] Jump to the existing window if possible
|
||||||
let g:fzf_buffers_jump = 1
|
let g:fzf_buffers_jump = 1
|
||||||
|
|
||||||
@@ -162,7 +167,7 @@ Command-local options~
|
|||||||
let g:fzf_tags_command = 'ctags -R'
|
let g:fzf_tags_command = 'ctags -R'
|
||||||
|
|
||||||
" [Commands] --expect expression for directly executing the command
|
" [Commands] --expect expression for directly executing the command
|
||||||
let g:fzf_commands_expect = 'ctrl-x'
|
let g:fzf_commands_expect = 'alt-enter,ctrl-x'
|
||||||
<
|
<
|
||||||
|
|
||||||
Advanced customization using autoload functions~
|
Advanced customization using autoload functions~
|
||||||
|
|||||||
Reference in New Issue
Block a user