[vim] Update README-VIM

This commit is contained in:
Junegunn Choi 2021-05-19 14:43:34 +09:00
parent 85ae745910
commit 9ef825d2fd
No known key found for this signature in database
GPG Key ID: 254BC280FEF9C627
2 changed files with 91 additions and 27 deletions

View File

@ -399,15 +399,41 @@ Tips
### fzf inside terminal buffer ### fzf inside terminal buffer
The latest versions of Vim and Neovim include builtin terminal emulator On the latest versions of Vim and Neovim, fzf will start in a terminal buffer.
(`:terminal`) and fzf will start in a terminal buffer in the following cases: If you find the default ANSI colors to be different, consider configuring the
colors using `g:terminal_ansi_colors` in regular Vim or `g:terminal_color_x`
in Neovim.
- On Neovim ```vim
- On GVim " Terminal colors for seoul256 color scheme
- On Terminal Vim with a non-default layout if has('nvim')
- `call fzf#run({'left': '30%'})` or `let g:fzf_layout = {'left': '30%'}` let g:terminal_color_0 = '#4e4e4e'
let g:terminal_color_1 = '#d68787'
let g:terminal_color_2 = '#5f865f'
let g:terminal_color_3 = '#d8af5f'
let g:terminal_color_4 = '#85add4'
let g:terminal_color_5 = '#d7afaf'
let g:terminal_color_6 = '#87afaf'
let g:terminal_color_7 = '#d0d0d0'
let g:terminal_color_8 = '#626262'
let g:terminal_color_9 = '#d75f87'
let g:terminal_color_10 = '#87af87'
let g:terminal_color_11 = '#ffd787'
let g:terminal_color_12 = '#add4fb'
let g:terminal_color_13 = '#ffafaf'
let g:terminal_color_14 = '#87d7d7'
let g:terminal_color_15 = '#e4e4e4'
else
let g:terminal_ansi_colors = [
\ '#4e4e4e', '#d68787', '#5f865f', '#d8af5f',
\ '#85add4', '#d7afaf', '#87afaf', '#d0d0d0',
\ '#626262', '#d75f87', '#87af87', '#ffd787',
\ '#add4fb', '#ffafaf', '#87d7d7', '#e4e4e4'
\ ]
endif
```
#### Starting fzf in a popup window ### Starting fzf in a popup window
```vim ```vim
" Required: " Required:
@ -435,21 +461,21 @@ else
endif endif
``` ```
#### Hide statusline ### Hide statusline
When fzf starts in a terminal buffer, the file type of the buffer is set to When fzf starts in a terminal buffer, the file type of the buffer is set to
`fzf`. So you can set up `FileType fzf` autocmd to customize the settings of `fzf`. So you can set up `FileType fzf` autocmd to customize the settings of
the window. the window.
For example, if you use a non-popup layout (e.g. `{'down': '40%'}`) on Neovim, For example, if you open fzf on the bottom on the screen (e.g. `{'down':
you might want to temporarily disable the statusline for a cleaner look. '40%'}`), you might want to temporarily disable the statusline for a cleaner
look.
```vim ```vim
if has('nvim') && !exists('g:fzf_layout') let g:fzf_layout = { 'down': '30%' }
autocmd! FileType fzf autocmd! FileType fzf
autocmd FileType fzf set laststatus=0 noshowmode noruler autocmd FileType fzf set laststatus=0 noshowmode noruler
\| autocmd BufLeave <buffer> set laststatus=2 showmode ruler \| autocmd BufLeave <buffer> set laststatus=2 showmode ruler
endif
``` ```
[License](LICENSE) [License](LICENSE)

View File

@ -1,4 +1,4 @@
fzf.txt fzf Last change: April 17 2021 fzf.txt fzf Last change: May 19 2021
FZF - TABLE OF CONTENTS *fzf* *fzf-toc* FZF - TABLE OF CONTENTS *fzf* *fzf-toc*
============================================================================== ==============================================================================
@ -419,8 +419,46 @@ The latest versions of Vim and Neovim include builtin terminal emulator
- On Terminal Vim with a non-default layout - On Terminal Vim with a non-default layout
- `callfzf#run({'left':'30%'})` or `letg:fzf_layout={'left':'30%'}` - `callfzf#run({'left':'30%'})` or `letg:fzf_layout={'left':'30%'}`
On the latest versions of Vim and Neovim, fzf will start in a terminal buffer.
If you find the default ANSI colors to be different, consider configuring the
colors using `g:terminal_ansi_colors` in regular Vim or `g:terminal_color_x`
in Neovim.
Starting fzf in a popup window~ *g:terminal_color_15* *g:terminal_color_14* *g:terminal_color_13*
*g:terminal_color_12* *g:terminal_color_11* *g:terminal_color_10* *g:terminal_color_9*
*g:terminal_color_8* *g:terminal_color_7* *g:terminal_color_6* *g:terminal_color_5*
*g:terminal_color_4* *g:terminal_color_3* *g:terminal_color_2* *g:terminal_color_1*
*g:terminal_color_0*
>
" Terminal colors for seoul256 color scheme
if has('nvim')
let g:terminal_color_0 = '#4e4e4e'
let g:terminal_color_1 = '#d68787'
let g:terminal_color_2 = '#5f865f'
let g:terminal_color_3 = '#d8af5f'
let g:terminal_color_4 = '#85add4'
let g:terminal_color_5 = '#d7afaf'
let g:terminal_color_6 = '#87afaf'
let g:terminal_color_7 = '#d0d0d0'
let g:terminal_color_8 = '#626262'
let g:terminal_color_9 = '#d75f87'
let g:terminal_color_10 = '#87af87'
let g:terminal_color_11 = '#ffd787'
let g:terminal_color_12 = '#add4fb'
let g:terminal_color_13 = '#ffafaf'
let g:terminal_color_14 = '#87d7d7'
let g:terminal_color_15 = '#e4e4e4'
else
let g:terminal_ansi_colors = [
\ '#4e4e4e', '#d68787', '#5f865f', '#d8af5f',
\ '#85add4', '#d7afaf', '#87afaf', '#d0d0d0',
\ '#626262', '#d75f87', '#87af87', '#ffd787',
\ '#add4fb', '#ffafaf', '#87d7d7', '#e4e4e4'
\ ]
endif
<
< Starting fzf in a popup window >____________________________________________~
*fzf-starting-fzf-in-a-popup-window* *fzf-starting-fzf-in-a-popup-window*
> >
" Required: " Required:
@ -446,21 +484,21 @@ or above) by putting fzf-tmux options in `tmux` key.
endif endif
< <
Hide statusline~ < Hide statusline >___________________________________________________________~
*fzf-hide-statusline* *fzf-hide-statusline*
When fzf starts in a terminal buffer, the file type of the buffer is set to When fzf starts in a terminal buffer, the file type of the buffer is set to
`fzf`. So you can set up `FileTypefzf` autocmd to customize the settings of `fzf`. So you can set up `FileTypefzf` autocmd to customize the settings of
the window. the window.
For example, if you use a non-popup layout (e.g. `{'down':'40%'}`) on Neovim, For example, if you open fzf on the bottom on the screen (e.g. `{'down':
you might want to temporarily disable the statusline for a cleaner look. '40%'}`), you might want to temporarily disable the statusline for a cleaner
look.
> >
if has('nvim') && !exists('g:fzf_layout') let g:fzf_layout = { 'down': '30%' }
autocmd! FileType fzf autocmd! FileType fzf
autocmd FileType fzf set laststatus=0 noshowmode noruler autocmd FileType fzf set laststatus=0 noshowmode noruler
\| autocmd BufLeave <buffer> set laststatus=2 showmode ruler \| autocmd BufLeave <buffer> set laststatus=2 showmode ruler
endif
< <
LICENSE *fzf-license* LICENSE *fzf-license*