pick.vim


Ⅰ. 插件描述

Functions for using pick from within Vim.

Ⅱ. 基本信息

创建日期:  2015-03-05
使用用户:  23
Github星:  39
插件作者:  Calle Erlandsson

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'thoughtbot/pick-vim'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'thoughtbot/pick-vim'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'thoughtbot/pick-vim'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/thoughtbot/pick.vim

Ⅳ. 文档说明

# pick.vim

Functions for using [pick] from within Vim.

Please note: pick requires a fully functional terminal to run therefore
cannot be run from within gvim or MacVim.

Installation

Recommended installation with [Vundle]:

Plugin 'calleerlandsson/pick.vim'

Usage

pick.vim provides the following functions:

PickFile()

Pick a file to edit.

If you are working from within a git repository, PickFile() will use `git
ls-files to get the files to pick from. If not, it will use find`.

PickFileSplit()

Pick a file to edit in a new split.

PickFileVerticalSplit()

Pick a file to edit in a new vertical split.

PickFileTab()

Pick a file to edit in a new tab.

PickBuffer()

Pick a buffer to edit.

PickTag()

Pick a tag to jump to, open it with :tag

PickSplitTag()

Pick a tag to jump to, open it with :stag

PickCommand(choice_command, pick_args, vim_command, escapable_output)

Run the choice_command in from the shell and pipe the results to pick run with
pick_args and call the vim_command with the selected choice.

For example, you could implement PickFile() like this:

call PickCommand("find * -type f", "", ":edit", 1)

Configuration

Add your preferred key mappings to your .vimrc file:

nnoremap <Leader>p :call PickFile()<CR>
nnoremap <Leader>s :call PickFileSplit()<CR>
nnoremap <Leader>v :call PickFileVerticalSplit()<CR>
nnoremap <Leader>t :call PickFileTab()<CR>
nnoremap <Leader>b :call PickBuffer()<CR>
nnoremap <Leader>] :call PickTag()<CR>

The name of the pick executable can be configured with:

let g:pick_executable = "pick -K"

The -K is useful when running pick(1) from within another interactive
program (like vim(1)) which does not re-enable keyboard transmit mode after
executing an external program.

The maximum number of lines used when drawing the pick interface can be limited:

let g:pick_height = 10

Copyright

Copyright (c) 2017 Calle Erlandsson, Teo Ljungberg & thoughtbot.

添加新评论