Ⅰ. 插件描述
Key bindings from fzf wikiⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'atweiden/fzf-extras'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'atweiden/fzf-extras'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'atweiden/fzf-extras'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/atweiden/fzf-extras
Ⅳ. 文档说明
# fzf-extras
Additional key bindings for fzf, primarily Bash.
Usage
Bash
directory
| bash cmdline | description |
|---|---|
zd | 'fuzzy-finder' + 'cd' = 'zd', the super function of _fd, _fda, _fdr, _fst, _cdf, _zz |
_cdf | cd into the directory of the selected file |
_fd | cd into selected directory |
_fda | cd into selected directory, including hidden directories |
_fdr | cd into selected parent directory |
_fst | cd into the directory from stack |
_zz | Selectable cd to 'frecency' directory |
file
| bash cmdline | description |
|---|---|
e | Open 'frecency' files with $VISUAL editor |
fe [FUZZY PATTERN] | Open selected file with $EDITOR |
fo | Equivalent to fe, but opens file with $OPENER (default: xdg-open) if you press Ctrl+O |
v | Open selected files from ~/.viminfo with $EDITOR |
git
| bash cmdline | description |
|---|---|
fbr | Checkout Git branch (including remote branches) |
fco | Checkout Git branch/tag |
fcoc | Checkout Git commit |
fcs | Get Git commit SHA hash |
fshow | Git commit browser |
fstash | Git stash management (Enter to show contents of the stash, Ctrl+D to show a diff of the stash against your current HEAD, Ctrl+B to check the stash out as a branch, for easier merging) |
fzf-gitlog-multi-widget | Multi-selectable git show |
fzf-gitlog-widget | Git log browser |
history
| bash cmdline | description |
|---|---|
fh | Select line from history, repeat without editing |
fhe | Select line from history, leave for editing |
runcmd | Utility function used to run the command in the shell |
writecmd | Utility function used to write the command in the shell |
pid
| bash cmdline | description |
|---|---|
fkill | Select process to kill (alternatively, type kill˽Tab) |
tags
| bash cmdline | description |
|---|---|
ftags | Search ctags |
tmux
| bash cmdline | description |
|---|---|
fs [FUZZY PATTERN] | Select tmux session |
ftpane | Switch pane |
Zsh
file
| zsh cmdline | description |
|---|---|
| Alt-i | Paste the selected entry from locate output into the command line |
Installation
Install fzf-extras
Arch Linux
Install aur/fzf-extras.
Manual
git clone https://github.com/atweiden/fzf-extras ~/.fzf-extrasConfigure fzf-extras
To make use of function fo, consider setting the $OPENER environment
- If
$OPENERis unset,fowill attempt to open files withxdg-openwhen pressing Ctrl+O.
Arch Linux
cat >> ~/.bashrc <<'EOF'
OPENER=mimeo
EOFMacOS
cat >> ~/.bashrc <<'EOF'
OPENER=open
EOFSource fzf-extras
Arch Linux
# bash users only
cat >> ~/.bashrc <<'EOF'
[[ -e "/usr/share/fzf/fzf-extras.bash" ]] \
&& source /usr/share/fzf/fzf-extras.bash
EOF
# zsh users only
cat >> ~/.zshrc <<'EOF'
[[ -e "/usr/share/fzf/fzf-extras.zsh" ]] \
&& source /usr/share/fzf/fzf-extras.zsh
EOFManual
# bash users only
cat >> ~/.bashrc <<'EOF'
[[ -e "$HOME/.fzf-extras/fzf-extras.sh" ]] \
&& source "$HOME/.fzf-extras/fzf-extras.sh"
EOF
# zsh users only
cat >> ~/.zshrc <<'EOF'
[[ -e "$HOME/.fzf-extras/fzf-extras.zsh" ]] \
&& source "$HOME/.fzf-extras/fzf-extras.zsh"
EOFZsh users should not be sourcing fzf-extras.sh.
The lack of meaningful support for Zsh will be fixed pending suitable
PRs from Zsh-using contributors. Note it is perfectly acceptable
to duplicate code from fzf-extras.sh into fzf-extras.zsh. See:
https://github.com/atweiden/fzf-extras/issues/12.
Dependencies
Required
Optional