Update installation instruction

This commit is contained in:
Junegunn Choi
2020-03-17 14:29:57 +09:00
parent 7ccecee77d
commit d4d36b412b
2 changed files with 27 additions and 39 deletions

View File

@@ -41,17 +41,12 @@ repository][fzf-main], which means you need to **set up both "fzf" and
### Using [vim-plug](https://github.com/junegunn/vim-plug) ### Using [vim-plug](https://github.com/junegunn/vim-plug)
```vim ```vim
Plug 'junegunn/fzf', { 'do': './install --bin' } Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim' Plug 'junegunn/fzf.vim'
``` ```
- Make sure to use Vim 7.4 or above `fzf#install()` makes sure that you have the latest binary, but it's optional,
- The `do` option makes sure that you have the latest version of fzf binary so you can omit it if you use a plugin manager that doesn't support hooks.
- If you have already installed fzf using [Homebrew](https://brew.sh/), and do
not wish to have another copy on your system, replace the first line with
`Plug '/usr/local/opt/fzf'`
- If you want to set up fzf globally on your system only using vim-plug, you
can write `Plug 'junegunn/fzf', { 'do': './install --all' }`
Commands Commands
-------- --------

View File

@@ -1,4 +1,4 @@
fzf-vim.txt fzf-vim Last change: March 15 2020 fzf-vim.txt fzf-vim Last change: March 17 2020
FZF-VIM - TABLE OF CONTENTS *fzf-vim* *fzf-vim-toc* FZF-VIM - TABLE OF CONTENTS *fzf-vim* *fzf-vim-toc*
============================================================================== ==============================================================================
@@ -79,25 +79,18 @@ fzf/Vim integration, see {README-VIM}{4}.
< Using vim-plug >____________________________________________________________~ < Using vim-plug >____________________________________________________________~
*fzf-vim-using-vim-plug* *fzf-vim-using-vim-plug*
> >
Plug 'junegunn/fzf', { 'do': './install --bin' } Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim' Plug 'junegunn/fzf.vim'
< <
- Make sure to use Vim 7.4 or above `fzf#install()` makes sure that you have the latest binary, but it's optional,
- The `do` option makes sure that you have the latest version of fzf binary so you can omit it if you use a plugin manager that doesn't support hooks.
- If you have already installed fzf using {Homebrew}{5}, and do not wish to have
another copy on your system, replace the first line with
`Plug '/usr/local/opt/fzf'`
- If you want to set up fzf globally on your system only using vim-plug, you can
write `Plug 'junegunn/fzf', { 'do': './install --all' }`
{5} https://brew.sh/
COMMANDS *fzf-vim-commands* COMMANDS *fzf-vim-commands*
============================================================================== ==============================================================================
*:Files* *:GFiles* *:Buffers* *:Colors* *:Ag* *:Rg* *:Lines* *:BLines* *:Tags* *:BTags* *:Files* *:GFiles* *:Buffers* *:Colors* *:Ag* *:Rg* *:Lines* *:BLines* *:Tags* *:BTags* *:Marks*
*:Marks* *:Windows* *:Locate* *:History* *:Snippets* *:Commits* *:BCommits* *:Commands* *:Maps* *:Windows* *:Locate* *:History* *:Snippets* *:Commits* *:BCommits* *:Commands* *:Maps*
*:Helptags* *:Filetypes* *:Helptags* *:Filetypes*
------------------+----------------------------------------------------------------------- ------------------+-----------------------------------------------------------------------
@@ -108,8 +101,8 @@ COMMANDS *fzf-vim-commands*
`:GFiles?` | Git files ( `gitstatus` ) `:GFiles?` | Git files ( `gitstatus` )
`:Buffers` | Open buffers `:Buffers` | Open buffers
`:Colors` | Color schemes `:Colors` | Color schemes
`:Ag[PATTERN]` | {ag}{6} search result ( `ALT-A` to select all, `ALT-D` to deselect all) `:Ag[PATTERN]` | {ag}{5} search result ( `ALT-A` to select all, `ALT-D` to deselect all)
`:Rg[PATTERN]` | {rg}{7} search result ( `ALT-A` to select all, `ALT-D` to deselect all) `:Rg[PATTERN]` | {rg}{6} search result ( `ALT-A` to select all, `ALT-D` to deselect all)
`:Lines[QUERY]` | Lines in loaded buffers `:Lines[QUERY]` | Lines in loaded buffers
`:BLines[QUERY]` | Lines in the current buffer `:BLines[QUERY]` | Lines in the current buffer
`:Tags[QUERY]` | Tags in the project ( `ctags-R` ) `:Tags[QUERY]` | Tags in the project ( `ctags-R` )
@@ -120,8 +113,8 @@ COMMANDS *fzf-vim-commands*
`:History` | `v:oldfiles` and open buffers `:History` | `v:oldfiles` and open buffers
`:History:` | Command history `:History:` | Command history
`:History/` | Search history `:History/` | Search history
`:Snippets` | Snippets ({UltiSnips}{8}) `:Snippets` | Snippets ({UltiSnips}{7})
`:Commits` | Git commits (requires {fugitive.vim}{9}) `:Commits` | Git commits (requires {fugitive.vim}{8})
`:BCommits` | Git commits for the current buffer `:BCommits` | Git commits for the current buffer
`:Commands` | Commands `:Commands` | Commands
`:Maps` | Normal mode mappings `:Maps` | Normal mode mappings
@@ -137,14 +130,14 @@ COMMANDS *fzf-vim-commands*
- You can set `g:fzf_command_prefix` to give the same prefix to the commands - You can set `g:fzf_command_prefix` to give the same prefix to the commands
- e.g. `letg:fzf_command_prefix='Fzf'` and you have `FzfFiles`, etc. - e.g. `letg:fzf_command_prefix='Fzf'` and you have `FzfFiles`, etc.
(1: `Helptags` will shadow the command of the same name from {pathogen}{10}. (1: `Helptags` will shadow the command of the same name from {pathogen}{9}.
But its functionality is still available via `call pathogen#helptags()`.) But its functionality is still available via `call pathogen#helptags()`.)
{6} https://github.com/ggreer/the_silver_searcher {5} https://github.com/ggreer/the_silver_searcher
{7} https://github.com/BurntSushi/ripgrep {6} https://github.com/BurntSushi/ripgrep
{8} https://github.com/SirVer/ultisnips {7} https://github.com/SirVer/ultisnips
{9} https://github.com/tpope/vim-fugitive {8} https://github.com/tpope/vim-fugitive
{10} https://github.com/tpope/vim-pathogen {9} https://github.com/tpope/vim-pathogen
CUSTOMIZATION *fzf-vim-customization* CUSTOMIZATION *fzf-vim-customization*
@@ -252,8 +245,8 @@ Want a preview window?
\ call fzf#vim#files(<q-args>, {'options': ['--layout=reverse', '--info=inline', '--preview', 'cat {}']}, <bang>0) \ call fzf#vim#files(<q-args>, {'options': ['--layout=reverse', '--info=inline', '--preview', 'cat {}']}, <bang>0)
< <
It kind of works, but you probably want a nicer previewer program than `cat`. It kind of works, but you probably want a nicer previewer program than `cat`.
fzf.vim ships {a versatile preview script}{11} you can readily use. It fzf.vim ships {a versatile preview script}{10} you can readily use. It
internally executes {bat}{12} for syntax highlighting, so make sure to install internally executes {bat}{11} for syntax highlighting, so make sure to install
it. it.
> >
command! -bang -nargs=? -complete=dir Files command! -bang -nargs=? -complete=dir Files
@@ -273,8 +266,8 @@ You can just omit the spec argument if you only want the previewer.
command! -bang -nargs=? -complete=dir Files command! -bang -nargs=? -complete=dir Files
\ call fzf#vim#files(<q-args>, fzf#vim#with_preview(), <bang>0) \ call fzf#vim#files(<q-args>, fzf#vim#with_preview(), <bang>0)
< <
{11} bin/preview.sh {10} bin/preview.sh
{12} https://github.com/sharkdp/bat {11} https://github.com/sharkdp/bat
Example: git grep wrapper~ Example: git grep wrapper~
@@ -287,7 +280,7 @@ predefined `Ag` or `Rg` using `fzf#vim#grep`.
not print column numbers. not print column numbers.
- We set the base directory to git root by setting `dir` attribute in spec - We set the base directory to git root by setting `dir` attribute in spec
dictionary. dictionary.
- {The preview script}{11} supports `grep` format (`FILE_PATH:LINE_NO:...`), so - {The preview script}{10} supports `grep` format (`FILE_PATH:LINE_NO:...`), so
we can just wrap the spec with `fzf#vim#with_preview` as before to enable we can just wrap the spec with `fzf#vim#with_preview` as before to enable
previewer. previewer.
> >
@@ -296,7 +289,7 @@ predefined `Ag` or `Rg` using `fzf#vim#grep`.
\ 'git grep --line-number '.shellescape(<q-args>), 0, \ 'git grep --line-number '.shellescape(<q-args>), 0,
\ fzf#vim#with_preview({'dir': systemlist('git rev-parse --show-toplevel')[0]}), <bang>0) \ fzf#vim#with_preview({'dir': systemlist('git rev-parse --show-toplevel')[0]}), <bang>0)
< <
{11} bin/preview.sh {10} bin/preview.sh
Example: Rg command with preview window~ Example: Rg command with preview window~
@@ -429,10 +422,10 @@ Reducer example~
STATUS LINE OF TERMINAL BUFFER *fzf-vim-status-line-of-terminal-buffer* STATUS LINE OF TERMINAL BUFFER *fzf-vim-status-line-of-terminal-buffer*
============================================================================== ==============================================================================
When fzf starts in a terminal buffer (see {fzf/README-VIM.md}{13}), you may When fzf starts in a terminal buffer (see {fzf/README-VIM.md}{12}), you may
want to customize the statusline of the containing buffer. want to customize the statusline of the containing buffer.
{13} https://github.com/junegunn/fzf/blob/master/README-VIM.md#fzf-inside-terminal-buffer {12} https://github.com/junegunn/fzf/blob/master/README-VIM.md#fzf-inside-terminal-buffer
< Hide statusline >___________________________________________________________~ < Hide statusline >___________________________________________________________~