https://github.com/calleluks/pick.vim
Functions for using pick from within Vim.
https://github.com/calleluks/pick.vim
fuzzy-search pick vim
Last synced: 6 months ago
JSON representation
Functions for using pick from within Vim.
- Host: GitHub
- URL: https://github.com/calleluks/pick.vim
- Owner: calleluks
- License: mit
- Created: 2015-03-05T15:28:49.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2018-09-24T06:26:44.000Z (about 7 years ago)
- Last Synced: 2025-04-13T22:12:52.990Z (6 months ago)
- Topics: fuzzy-search, pick, vim
- Language: Vim script
- Homepage:
- Size: 26.4 KB
- Stars: 40
- Watchers: 15
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# 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.[pick]: https://github.com/calleerlandsson/pick/
## Installation
Recommended installation with [Vundle]:
```viml
Plugin 'calleerlandsson/pick.vim'
```[Vundle]: https://github.com/gmarik/Vundle.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:
```viml
call PickCommand("find * -type f", "", ":edit", 1)
```### Configuration
Add your preferred key mappings to your `.vimrc` file:
```viml
nnoremap p :call PickFile()
nnoremap s :call PickFileSplit()
nnoremap v :call PickFileVerticalSplit()
nnoremap t :call PickFileTab()
nnoremap b :call PickBuffer()
nnoremap ] :call PickTag()
```The name of the pick executable can be configured with:
```viml
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:
```viml
let g:pick_height = 10
```## Copyright
Copyright (c) 2017 Calle Erlandsson, Teo Ljungberg & thoughtbot.