From 8372d831ee5db4e9b9981095befa8ed707bb688b Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Thu, 21 Jul 2016 01:54:20 +0900 Subject: [PATCH] Updated Configuring FZF command (vim) (markdown) --- Configuring-FZF-command-(vim).md | 33 +++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/Configuring-FZF-command-(vim).md b/Configuring-FZF-command-(vim).md index 3526611..3f4e8bc 100644 --- a/Configuring-FZF-command-(vim).md +++ b/Configuring-FZF-command-(vim).md @@ -1,29 +1,32 @@ If you set up Vim plugin for fzf, `:FZF` command will become available. The following variables are used to configure its behavior. - `g:fzf_action` -- `g:fzf_height` + - Customizable extra key bindings for opening selected files in different ways +- ~~`g:fzf_height`~~ (deprecated, use `g:fzf_layout` instead) +- `g:fzf_layout` + - Determines the size and position of fzf window (tmux pane or Neovim split) - `g:fzf_launcher` + - (Only in GVim) Terminal emulator to open fzf with - `g:Fzf_launcher` for function reference -### Key bindings +### Examples ```vim -" ctrl-[a-z], alt-[a-z], f[1-4], or any single character +" This is the default extra key bindings let g:fzf_action = { - \ 'ctrl-m': 'e', - \ 'ctrl-t': 'tabedit', - \ 'alt-j': 'botright split', - \ 'alt-k': 'topleft split', - \ 'alt-h': 'vertical topleft split', - \ 'alt-l': 'vertical botright split' } + \ 'ctrl-t': 'tab split', + \ 'ctrl-x': 'split', + \ 'ctrl-v': 'vsplit' } + +" Default fzf layout +" - down / up / left / right +let g:fzf_layout = { 'down': '~40%' } + +" In Neovim, you can set up fzf window using a Vim command +let g:fzf_layout = { 'window': 'enew' } +let g:fzf_layout = { 'window': '-tabnew' } ``` -### Window size - -If you're on a tmux session or using Neovim, `:FZF` will launch fzf in a -split-window whose height can be adjusted with `g:fzf_height` (default: -'40%'). However, the bang version (`:FZF!`) will always start in fullscreen. - ### GVim In GVim, you need an external terminal emulator to start fzf with. `xterm`