deleted vim-plug
This commit is contained in:
parent
8f7d14d84c
commit
d8294160f0
|
|
@ -1 +0,0 @@
|
||||||
../vim-plug/plug.vim
|
|
||||||
32
.vim/vim-plug/.github/ISSUE_TEMPLATE.md
vendored
32
.vim/vim-plug/.github/ISSUE_TEMPLATE.md
vendored
|
|
@ -1,32 +0,0 @@
|
||||||
<!--
|
|
||||||
### Before Submitting
|
|
||||||
|
|
||||||
- You checked the [faq](https://github.com/junegunn/vim-plug/wiki/faq) for common problems.
|
|
||||||
- Check your [requirements](https://github.com/junegunn/vim-plug/wiki/requirements) are satisfied.
|
|
||||||
- You are not going to suggest vim-plug manage itself like Vundle, see #240, #364, #367 ...
|
|
||||||
-->
|
|
||||||
|
|
||||||
Explain the problem here ...
|
|
||||||
|
|
||||||
------------------------------
|
|
||||||
|
|
||||||
<!-- Put the contents of `:version` below -->
|
|
||||||
```
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
<!-- Check all that apply. -->
|
|
||||||
- Type:
|
|
||||||
- [ ] Bug
|
|
||||||
- [ ] Enhancement
|
|
||||||
- [ ] Feature Request
|
|
||||||
- [ ] Question
|
|
||||||
- OS:
|
|
||||||
- [ ] All/Other
|
|
||||||
- [ ] Linux
|
|
||||||
- [ ] OS X
|
|
||||||
- [ ] Windows
|
|
||||||
- Vim:
|
|
||||||
- [ ] Terminal Vim
|
|
||||||
- [ ] GVim
|
|
||||||
- [ ] Neovim
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
||||||
<!-- ## Before Submitting
|
|
||||||
|
|
||||||
- You made sure the existing tests/travis build works.
|
|
||||||
- You made sure any new features were tested where appropriate.
|
|
||||||
- You checked a similar feature wasn't already turned down by searching issues & PRs.
|
|
||||||
-->
|
|
||||||
|
|
||||||
Describe the details of your PR ...
|
|
||||||
|
|
@ -1,62 +0,0 @@
|
||||||
language: ruby
|
|
||||||
dist: trusty
|
|
||||||
sudo: false
|
|
||||||
env:
|
|
||||||
global:
|
|
||||||
- DEPS=$HOME/deps
|
|
||||||
- PATH=$DEPS/bin:$PATH
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- env: ENV=vim72
|
|
||||||
rvm: 1.8.7
|
|
||||||
addons: { apt: { packages: [vim-nox] } }
|
|
||||||
- env: ENV=python
|
|
||||||
rvm: 1.8.7
|
|
||||||
addons: { apt: { packages: [python2.7-dev] } }
|
|
||||||
- env: ENV=python3
|
|
||||||
rvm: 1.8.7
|
|
||||||
addons: { apt: { packages: [python3-dev] } }
|
|
||||||
- env: ENV=ruby18
|
|
||||||
rvm: 1.8.7
|
|
||||||
- env: ENV=ruby20
|
|
||||||
rvm: 2.0.0
|
|
||||||
- env: ENV=neovim
|
|
||||||
- env: ENV=vim8
|
|
||||||
install: |
|
|
||||||
git config --global user.email "you@example.com"
|
|
||||||
git config --global user.name "Your Name"
|
|
||||||
|
|
||||||
if [ "$ENV" == "vim72" ]; then
|
|
||||||
mkdir -p ${DEPS}/bin
|
|
||||||
ln -s /usr/bin/vim.nox ${DEPS}/bin/vim
|
|
||||||
return
|
|
||||||
elif [ "$ENV" == "neovim" ]; then
|
|
||||||
# https://github.com/neovim/bot-ci#nightly-builds
|
|
||||||
eval "$(curl -Ss https://raw.githubusercontent.com/neovim/bot-ci/master/scripts/travis-setup.sh) nightly-x64"
|
|
||||||
mkdir -p ${DEPS}/bin
|
|
||||||
ln -s $(which nvim) ${DEPS}/bin/vim
|
|
||||||
export VADER_OUTPUT_FILE=/dev/stderr
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
|
|
||||||
C_OPTS="--prefix=$DEPS --with-features=huge --disable-gui "
|
|
||||||
case "$ENV" in
|
|
||||||
python)
|
|
||||||
C_OPTS+=--enable-pythoninterp
|
|
||||||
;;
|
|
||||||
python3)
|
|
||||||
C_OPTS+=--enable-python3interp
|
|
||||||
;;
|
|
||||||
ruby*)
|
|
||||||
C_OPTS+=--enable-rubyinterp
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
git clone --depth 1 https://github.com/vim/vim
|
|
||||||
cd vim
|
|
||||||
export PATH=/usr/bin:$PATH
|
|
||||||
./configure $C_OPTS
|
|
||||||
make
|
|
||||||
make install
|
|
||||||
cd -
|
|
||||||
script: test/run !
|
|
||||||
|
|
@ -1,21 +0,0 @@
|
||||||
MIT License
|
|
||||||
|
|
||||||
Copyright (c) 2017 Junegunn Choi
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
SOFTWARE.
|
|
||||||
|
|
@ -1,306 +0,0 @@
|
||||||
<img src="https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.png" height="75" alt="vim-plug">[](https://travis-ci.org/junegunn/vim-plug)
|
|
||||||
===
|
|
||||||
|
|
||||||
A minimalist Vim plugin manager.
|
|
||||||
|
|
||||||
<img src="https://raw.githubusercontent.com/junegunn/i/master/vim-plug/installer.gif" height="450">
|
|
||||||
|
|
||||||
### Pros.
|
|
||||||
|
|
||||||
- Easier to setup: Single file. No boilerplate code required.
|
|
||||||
- Easier to use: Concise, intuitive syntax
|
|
||||||
- [Super-fast][40/4] parallel installation/update
|
|
||||||
(with any of `+job`, `+python`, `+python3`, `+ruby`, or [Neovim][nv])
|
|
||||||
- Creates shallow clones to minimize disk space usage and download time
|
|
||||||
- On-demand loading for [faster startup time][startup-time]
|
|
||||||
- Can review and rollback updates
|
|
||||||
- Branch/tag/commit support
|
|
||||||
- Post-update hooks
|
|
||||||
- Support for externally managed plugins
|
|
||||||
|
|
||||||
[40/4]: https://raw.githubusercontent.com/junegunn/i/master/vim-plug/40-in-4.gif
|
|
||||||
[nv]: http://neovim.org/
|
|
||||||
[startup-time]: https://github.com/junegunn/vim-startuptime-benchmark#result
|
|
||||||
|
|
||||||
### Installation
|
|
||||||
|
|
||||||
[Download plug.vim](https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim)
|
|
||||||
and put it in the "autoload" directory.
|
|
||||||
|
|
||||||
#### Vim
|
|
||||||
|
|
||||||
###### Unix
|
|
||||||
|
|
||||||
```sh
|
|
||||||
curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
|
|
||||||
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
|
|
||||||
```
|
|
||||||
|
|
||||||
You can automate the process by putting the command in your Vim configuration
|
|
||||||
file as suggested [here][auto].
|
|
||||||
|
|
||||||
[auto]: https://github.com/junegunn/vim-plug/wiki/tips#automatic-installation
|
|
||||||
|
|
||||||
###### Windows (PowerShell)
|
|
||||||
|
|
||||||
```powershell
|
|
||||||
md ~\vimfiles\autoload
|
|
||||||
$uri = 'https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
|
|
||||||
(New-Object Net.WebClient).DownloadFile(
|
|
||||||
$uri,
|
|
||||||
$ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath(
|
|
||||||
"~\vimfiles\autoload\plug.vim"
|
|
||||||
)
|
|
||||||
)
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Neovim
|
|
||||||
|
|
||||||
###### Unix
|
|
||||||
|
|
||||||
```sh
|
|
||||||
curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs \
|
|
||||||
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
|
|
||||||
```
|
|
||||||
|
|
||||||
###### Windows (PowerShell)
|
|
||||||
|
|
||||||
```powershell
|
|
||||||
md ~\AppData\Local\nvim\autoload
|
|
||||||
$uri = 'https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
|
|
||||||
(New-Object Net.WebClient).DownloadFile(
|
|
||||||
$uri,
|
|
||||||
$ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath(
|
|
||||||
"~\AppData\Local\nvim\autoload\plug.vim"
|
|
||||||
)
|
|
||||||
)
|
|
||||||
```
|
|
||||||
|
|
||||||
### Getting Help
|
|
||||||
|
|
||||||
- See [tutorial] page to learn the basics of vim-plug
|
|
||||||
- See [tips] and [FAQ] pages for common problems and questions
|
|
||||||
- See [requirements] page for debugging information & tested configurations
|
|
||||||
- Create an [issue](https://github.com/junegunn/vim-plug/issues/new)
|
|
||||||
|
|
||||||
[tutorial]: https://github.com/junegunn/vim-plug/wiki/tutorial
|
|
||||||
[tips]: https://github.com/junegunn/vim-plug/wiki/tips
|
|
||||||
[FAQ]: https://github.com/junegunn/vim-plug/wiki/faq
|
|
||||||
[requirements]: https://github.com/junegunn/vim-plug/wiki/requirements
|
|
||||||
|
|
||||||
### Usage
|
|
||||||
|
|
||||||
Add a vim-plug section to your `~/.vimrc` (or `~/.config/nvim/init.vim` for Neovim):
|
|
||||||
|
|
||||||
1. Begin the section with `call plug#begin()`
|
|
||||||
1. List the plugins with `Plug` commands
|
|
||||||
1. `call plug#end()` to update `&runtimepath` and initialize plugin system
|
|
||||||
- Automatically executes `filetype plugin indent on` and `syntax enable`.
|
|
||||||
You can revert the settings after the call. e.g. `filetype indent off`, `syntax off`, etc.
|
|
||||||
|
|
||||||
#### Example
|
|
||||||
|
|
||||||
```vim
|
|
||||||
" Specify a directory for plugins
|
|
||||||
" - For Neovim: ~/.local/share/nvim/plugged
|
|
||||||
" - Avoid using standard Vim directory names like 'plugin'
|
|
||||||
call plug#begin('~/.vim/plugged')
|
|
||||||
|
|
||||||
" Make sure you use single quotes
|
|
||||||
|
|
||||||
" Shorthand notation; fetches https://github.com/junegunn/vim-easy-align
|
|
||||||
Plug 'junegunn/vim-easy-align'
|
|
||||||
|
|
||||||
" Any valid git URL is allowed
|
|
||||||
Plug 'https://github.com/junegunn/vim-github-dashboard.git'
|
|
||||||
|
|
||||||
" Multiple Plug commands can be written in a single line using | separators
|
|
||||||
Plug 'SirVer/ultisnips' | Plug 'honza/vim-snippets'
|
|
||||||
|
|
||||||
" On-demand loading
|
|
||||||
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
|
|
||||||
Plug 'tpope/vim-fireplace', { 'for': 'clojure' }
|
|
||||||
|
|
||||||
" Using a non-master branch
|
|
||||||
Plug 'rdnetto/YCM-Generator', { 'branch': 'stable' }
|
|
||||||
|
|
||||||
" Using a tagged release; wildcard allowed (requires git 1.9.2 or above)
|
|
||||||
Plug 'fatih/vim-go', { 'tag': '*' }
|
|
||||||
|
|
||||||
" Plugin options
|
|
||||||
Plug 'nsf/gocode', { 'tag': 'v.20150303', 'rtp': 'vim' }
|
|
||||||
|
|
||||||
" Plugin outside ~/.vim/plugged with post-update hook
|
|
||||||
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
|
|
||||||
|
|
||||||
" Unmanaged plugin (manually installed and updated)
|
|
||||||
Plug '~/my-prototype-plugin'
|
|
||||||
|
|
||||||
" Initialize plugin system
|
|
||||||
call plug#end()
|
|
||||||
```
|
|
||||||
|
|
||||||
Reload .vimrc and `:PlugInstall` to install plugins.
|
|
||||||
|
|
||||||
### Commands
|
|
||||||
|
|
||||||
| Command | Description |
|
|
||||||
| ----------------------------------- | ------------------------------------------------------------------ |
|
|
||||||
| `PlugInstall [name ...] [#threads]` | Install plugins |
|
|
||||||
| `PlugUpdate [name ...] [#threads]` | Install or update plugins |
|
|
||||||
| `PlugClean[!]` | Remove unused directories (bang version will clean without prompt) |
|
|
||||||
| `PlugUpgrade` | Upgrade vim-plug itself |
|
|
||||||
| `PlugStatus` | Check the status of plugins |
|
|
||||||
| `PlugDiff` | Examine changes from the previous update and the pending changes |
|
|
||||||
| `PlugSnapshot[!] [output path]` | Generate script for restoring the current snapshot of the plugins |
|
|
||||||
|
|
||||||
### `Plug` options
|
|
||||||
|
|
||||||
| Option | Description |
|
|
||||||
| ----------------------- | ------------------------------------------------ |
|
|
||||||
| `branch`/`tag`/`commit` | Branch/tag/commit of the repository to use |
|
|
||||||
| `rtp` | Subdirectory that contains Vim plugin |
|
|
||||||
| `dir` | Custom directory for the plugin |
|
|
||||||
| `as` | Use different name for the plugin |
|
|
||||||
| `do` | Post-update hook (string or funcref) |
|
|
||||||
| `on` | On-demand loading: Commands or `<Plug>`-mappings |
|
|
||||||
| `for` | On-demand loading: File types |
|
|
||||||
| `frozen` | Do not update unless explicitly specified |
|
|
||||||
|
|
||||||
### Global options
|
|
||||||
|
|
||||||
| Flag | Default | Description |
|
|
||||||
| ------------------- | --------------------------------- | ------------------------------------------------------ |
|
|
||||||
| `g:plug_threads` | 16 | Default number of threads to use |
|
|
||||||
| `g:plug_timeout` | 60 | Time limit of each task in seconds (*Ruby & Python*) |
|
|
||||||
| `g:plug_retries` | 2 | Number of retries in case of timeout (*Ruby & Python*) |
|
|
||||||
| `g:plug_shallow` | 1 | Use shallow clone |
|
|
||||||
| `g:plug_window` | `vertical topleft new` | Command to open plug window |
|
|
||||||
| `g:plug_pwindow` | `above 12new` | Command to open preview window in `PlugDiff` |
|
|
||||||
| `g:plug_url_format` | `https://git::@github.com/%s.git` | `printf` format to build repo URL (Only applies to the subsequent `Plug` commands) |
|
|
||||||
|
|
||||||
|
|
||||||
### Keybindings
|
|
||||||
|
|
||||||
- `D` - `PlugDiff`
|
|
||||||
- `S` - `PlugStatus`
|
|
||||||
- `R` - Retry failed update or installation tasks
|
|
||||||
- `U` - Update plugins in the selected range
|
|
||||||
- `q` - Close the window
|
|
||||||
- `:PlugStatus`
|
|
||||||
- `L` - Load plugin
|
|
||||||
- `:PlugDiff`
|
|
||||||
- `X` - Revert the update
|
|
||||||
|
|
||||||
### Example: A small [sensible](https://github.com/tpope/vim-sensible) Vim configuration
|
|
||||||
|
|
||||||
```vim
|
|
||||||
call plug#begin()
|
|
||||||
Plug 'tpope/vim-sensible'
|
|
||||||
call plug#end()
|
|
||||||
```
|
|
||||||
|
|
||||||
### On-demand loading of plugins
|
|
||||||
|
|
||||||
```vim
|
|
||||||
" NERD tree will be loaded on the first invocation of NERDTreeToggle command
|
|
||||||
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
|
|
||||||
|
|
||||||
" Multiple commands
|
|
||||||
Plug 'junegunn/vim-github-dashboard', { 'on': ['GHDashboard', 'GHActivity'] }
|
|
||||||
|
|
||||||
" Loaded when clojure file is opened
|
|
||||||
Plug 'tpope/vim-fireplace', { 'for': 'clojure' }
|
|
||||||
|
|
||||||
" Multiple file types
|
|
||||||
Plug 'kovisoft/paredit', { 'for': ['clojure', 'scheme'] }
|
|
||||||
|
|
||||||
" On-demand loading on both conditions
|
|
||||||
Plug 'junegunn/vader.vim', { 'on': 'Vader', 'for': 'vader' }
|
|
||||||
|
|
||||||
" Code to execute when the plugin is lazily loaded on demand
|
|
||||||
Plug 'junegunn/goyo.vim', { 'for': 'markdown' }
|
|
||||||
autocmd! User goyo.vim echom 'Goyo is now loaded!'
|
|
||||||
```
|
|
||||||
|
|
||||||
`for` option is generally not needed as most plugins for specific file types
|
|
||||||
usually don't have too much code in `plugin` directory. You might want to
|
|
||||||
examine the output of `vim --startuptime` before applying the option.
|
|
||||||
|
|
||||||
### Post-update hooks
|
|
||||||
|
|
||||||
There are some plugins that require extra steps after installation or update.
|
|
||||||
In that case, use `do` option to describe the task to be performed.
|
|
||||||
|
|
||||||
```vim
|
|
||||||
Plug 'Shougo/vimproc.vim', { 'do': 'make' }
|
|
||||||
Plug 'Valloric/YouCompleteMe', { 'do': './install.py' }
|
|
||||||
```
|
|
||||||
|
|
||||||
If the value starts with `:`, it will be recognized as a Vim command.
|
|
||||||
|
|
||||||
```vim
|
|
||||||
Plug 'fatih/vim-go', { 'do': ':GoInstallBinaries' }
|
|
||||||
```
|
|
||||||
|
|
||||||
If you need more control, you can pass a reference to a Vim function that
|
|
||||||
takes a single argument.
|
|
||||||
|
|
||||||
```vim
|
|
||||||
function! BuildYCM(info)
|
|
||||||
" info is a dictionary with 3 fields
|
|
||||||
" - name: name of the plugin
|
|
||||||
" - status: 'installed', 'updated', or 'unchanged'
|
|
||||||
" - force: set on PlugInstall! or PlugUpdate!
|
|
||||||
if a:info.status == 'installed' || a:info.force
|
|
||||||
!./install.py
|
|
||||||
endif
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
Plug 'Valloric/YouCompleteMe', { 'do': function('BuildYCM') }
|
|
||||||
```
|
|
||||||
|
|
||||||
Both forms of post-update hook are executed inside the directory of the plugin
|
|
||||||
and only run when the repository has changed, but you can force it to run
|
|
||||||
unconditionally with the bang-versions of the commands: `PlugInstall!` and
|
|
||||||
`PlugUpdate!`.
|
|
||||||
|
|
||||||
Make sure to escape BARs and double-quotes when you write `do` option inline
|
|
||||||
as they are mistakenly recognized as command separator or the start of the
|
|
||||||
trailing comment.
|
|
||||||
|
|
||||||
```vim
|
|
||||||
Plug 'junegunn/fzf', { 'do': 'yes \| ./install' }
|
|
||||||
```
|
|
||||||
|
|
||||||
But you can avoid the escaping if you extract the inline specification using a
|
|
||||||
variable (or any Vimscript expression) as follows:
|
|
||||||
|
|
||||||
```vim
|
|
||||||
let g:fzf_install = 'yes | ./install'
|
|
||||||
Plug 'junegunn/fzf', { 'do': g:fzf_install }
|
|
||||||
```
|
|
||||||
|
|
||||||
### `PlugInstall!` and `PlugUpdate!`
|
|
||||||
|
|
||||||
The installer takes the following steps when installing/updating a plugin:
|
|
||||||
|
|
||||||
1. `git clone` or `git fetch` from its origin
|
|
||||||
2. Check out branch, tag, or commit and optionally `git merge` remote branch
|
|
||||||
3. If the plugin was updated (or installed for the first time)
|
|
||||||
1. Update submodules
|
|
||||||
2. Execute post-update hooks
|
|
||||||
|
|
||||||
The commands with `!` suffix ensure that all steps are run unconditionally.
|
|
||||||
|
|
||||||
### Articles
|
|
||||||
|
|
||||||
- [Writing my own Vim plugin manager](http://junegunn.kr/2013/09/writing-my-own-vim-plugin-manager)
|
|
||||||
- [Vim plugins and startup time](http://junegunn.kr/2014/07/vim-plugins-and-startup-time)
|
|
||||||
- ~~[Thoughts on Vim plugin dependency](http://junegunn.kr/2013/09/thoughts-on-vim-plugin-dependency)~~
|
|
||||||
- *Support for Plugfile has been removed since 0.5.0*
|
|
||||||
|
|
||||||
### License
|
|
||||||
|
|
||||||
MIT
|
|
||||||
|
|
||||||
|
|
@ -1,376 +0,0 @@
|
||||||
plug.txt plug Last change: November 27 2017
|
|
||||||
PLUG - TABLE OF CONTENTS *plug* *plug-toc*
|
|
||||||
==============================================================================
|
|
||||||
|
|
||||||
vim-plug
|
|
||||||
Pros.
|
|
||||||
Installation
|
|
||||||
Vim
|
|
||||||
Unix
|
|
||||||
Windows (PowerShell)
|
|
||||||
Neovim
|
|
||||||
Unix
|
|
||||||
Windows (PowerShell)
|
|
||||||
Getting Help
|
|
||||||
Usage
|
|
||||||
Example
|
|
||||||
Commands
|
|
||||||
Plug options
|
|
||||||
Global options
|
|
||||||
Keybindings
|
|
||||||
Example: A small sensible Vim configuration
|
|
||||||
On-demand loading of plugins
|
|
||||||
Post-update hooks
|
|
||||||
PlugInstall! and PlugUpdate!
|
|
||||||
Articles
|
|
||||||
License
|
|
||||||
|
|
||||||
VIM-PLUG *vim-plug*
|
|
||||||
==============================================================================
|
|
||||||
|
|
||||||
A minimalist Vim plugin manager.
|
|
||||||
|
|
||||||
https://raw.githubusercontent.com/junegunn/i/master/vim-plug/installer.gif
|
|
||||||
|
|
||||||
|
|
||||||
< Pros. >_____________________________________________________________________~
|
|
||||||
*plug-pros*
|
|
||||||
|
|
||||||
- Easier to setup: Single file. No boilerplate code required.
|
|
||||||
- Easier to use: Concise, intuitive syntax
|
|
||||||
- {Super-fast}{1} parallel installation/update (with any of `+job`, `+python`,
|
|
||||||
`+python3`, `+ruby`, or {Neovim}{2})
|
|
||||||
- Creates shallow clones to minimize disk space usage and download time
|
|
||||||
- On-demand loading for {faster startup time}{3}
|
|
||||||
- Can review and rollback updates
|
|
||||||
- Branch/tag/commit support
|
|
||||||
- Post-update hooks
|
|
||||||
- Support for externally managed plugins
|
|
||||||
|
|
||||||
{1} https://raw.githubusercontent.com/junegunn/i/master/vim-plug/40-in-4.gif
|
|
||||||
{2} http://neovim.org/
|
|
||||||
{3} https://github.com/junegunn/vim-startuptime-benchmark#result
|
|
||||||
|
|
||||||
|
|
||||||
< Installation >______________________________________________________________~
|
|
||||||
*plug-installation*
|
|
||||||
|
|
||||||
{Download plug.vim}{4} and put it in the "autoload" directory.
|
|
||||||
|
|
||||||
{4} https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
|
|
||||||
|
|
||||||
|
|
||||||
Vim~
|
|
||||||
*plug-vim*
|
|
||||||
|
|
||||||
|
|
||||||
>> Unix~
|
|
||||||
>
|
|
||||||
curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
|
|
||||||
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
|
|
||||||
<
|
|
||||||
You can automate the process by putting the command in your Vim configuration
|
|
||||||
file as suggested {here}{5}.
|
|
||||||
|
|
||||||
{5} https://github.com/junegunn/vim-plug/wiki/tips#automatic-installation
|
|
||||||
|
|
||||||
|
|
||||||
>> Windows (PowerShell)~
|
|
||||||
>
|
|
||||||
md ~\vimfiles\autoload
|
|
||||||
$uri = 'https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
|
|
||||||
(New-Object Net.WebClient).DownloadFile(
|
|
||||||
$uri,
|
|
||||||
$ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath(
|
|
||||||
"~\vimfiles\autoload\plug.vim"
|
|
||||||
)
|
|
||||||
)
|
|
||||||
<
|
|
||||||
|
|
||||||
Neovim~
|
|
||||||
*plug-neovim*
|
|
||||||
|
|
||||||
|
|
||||||
>> Unix~
|
|
||||||
>
|
|
||||||
curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs \
|
|
||||||
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
|
|
||||||
<
|
|
||||||
|
|
||||||
>> Windows (PowerShell)~
|
|
||||||
>
|
|
||||||
md ~\AppData\Local\nvim\autoload
|
|
||||||
$uri = 'https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
|
|
||||||
(New-Object Net.WebClient).DownloadFile(
|
|
||||||
$uri,
|
|
||||||
$ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath(
|
|
||||||
"~\AppData\Local\nvim\autoload\plug.vim"
|
|
||||||
)
|
|
||||||
)
|
|
||||||
<
|
|
||||||
|
|
||||||
< Getting Help >______________________________________________________________~
|
|
||||||
*plug-getting-help*
|
|
||||||
|
|
||||||
- See {tutorial}{6} page to learn the basics of vim-plug
|
|
||||||
- See {tips}{7} and {FAQ}{8} pages for common problems and questions
|
|
||||||
- See {requirements}{9} page for debugging information & tested configurations
|
|
||||||
- Create an {issue}{10}
|
|
||||||
|
|
||||||
{6} https://github.com/junegunn/vim-plug/wiki/tutorial
|
|
||||||
{7} https://github.com/junegunn/vim-plug/wiki/tips
|
|
||||||
{8} https://github.com/junegunn/vim-plug/wiki/faq
|
|
||||||
{9} https://github.com/junegunn/vim-plug/wiki/requirements
|
|
||||||
{10} https://github.com/junegunn/vim-plug/issues/new
|
|
||||||
|
|
||||||
|
|
||||||
< Usage >_____________________________________________________________________~
|
|
||||||
*plug-usage*
|
|
||||||
|
|
||||||
Add a vim-plug section to your `~/.vimrc` (or `~/.config/nvim/init.vim` for
|
|
||||||
Neovim):
|
|
||||||
|
|
||||||
*plug#begin* *plug#end*
|
|
||||||
|
|
||||||
1. Begin the section with `call plug#begin()`
|
|
||||||
2. List the plugins with `Plug` commands
|
|
||||||
3. `call plug#end()` to update 'runtimepath' and initialize plugin system
|
|
||||||
- Automatically executes `filetype plugin indent on` and `syntax enable`.
|
|
||||||
You can revert the settings after the call. e.g. `filetype indent off`,
|
|
||||||
`syntax off`, etc.
|
|
||||||
|
|
||||||
|
|
||||||
Example~
|
|
||||||
*plug-example*
|
|
||||||
>
|
|
||||||
" Specify a directory for plugins
|
|
||||||
" - For Neovim: ~/.local/share/nvim/plugged
|
|
||||||
" - Avoid using standard Vim directory names like 'plugin'
|
|
||||||
call plug#begin('~/.vim/plugged')
|
|
||||||
|
|
||||||
" Make sure you use single quotes
|
|
||||||
|
|
||||||
" Shorthand notation; fetches https://github.com/junegunn/vim-easy-align
|
|
||||||
Plug 'junegunn/vim-easy-align'
|
|
||||||
|
|
||||||
" Any valid git URL is allowed
|
|
||||||
Plug 'https://github.com/junegunn/vim-github-dashboard.git'
|
|
||||||
|
|
||||||
" Multiple Plug commands can be written in a single line using | separators
|
|
||||||
Plug 'SirVer/ultisnips' | Plug 'honza/vim-snippets'
|
|
||||||
|
|
||||||
" On-demand loading
|
|
||||||
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
|
|
||||||
Plug 'tpope/vim-fireplace', { 'for': 'clojure' }
|
|
||||||
|
|
||||||
" Using a non-master branch
|
|
||||||
Plug 'rdnetto/YCM-Generator', { 'branch': 'stable' }
|
|
||||||
|
|
||||||
" Using a tagged release; wildcard allowed (requires git 1.9.2 or above)
|
|
||||||
Plug 'fatih/vim-go', { 'tag': '*' }
|
|
||||||
|
|
||||||
" Plugin options
|
|
||||||
Plug 'nsf/gocode', { 'tag': 'v.20150303', 'rtp': 'vim' }
|
|
||||||
|
|
||||||
" Plugin outside ~/.vim/plugged with post-update hook
|
|
||||||
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
|
|
||||||
|
|
||||||
" Unmanaged plugin (manually installed and updated)
|
|
||||||
Plug '~/my-prototype-plugin'
|
|
||||||
|
|
||||||
" Initialize plugin system
|
|
||||||
call plug#end()
|
|
||||||
<
|
|
||||||
*:PlugInstall*
|
|
||||||
|
|
||||||
Reload .vimrc and `:PlugInstall` to install plugins.
|
|
||||||
|
|
||||||
|
|
||||||
< Commands >__________________________________________________________________~
|
|
||||||
*plug-commands*
|
|
||||||
|
|
||||||
------------------------------------+-------------------------------------------------------------------
|
|
||||||
Command | Description ~
|
|
||||||
------------------------------------+-------------------------------------------------------------------
|
|
||||||
`PlugInstall [name ...] [#threads]` | Install plugins
|
|
||||||
`PlugUpdate [name ...] [#threads]` | Install or update plugins
|
|
||||||
`PlugClean[!]` | Remove unused directories (bang version will clean without prompt)
|
|
||||||
`PlugUpgrade` | Upgrade vim-plug itself
|
|
||||||
`PlugStatus` | Check the status of plugins
|
|
||||||
`PlugDiff` | Examine changes from the previous update and the pending changes
|
|
||||||
`PlugSnapshot[!] [output path]` | Generate script for restoring the current snapshot of the plugins
|
|
||||||
------------------------------------+-------------------------------------------------------------------
|
|
||||||
|
|
||||||
|
|
||||||
< Plug options >______________________________________________________________~
|
|
||||||
*plug-options*
|
|
||||||
|
|
||||||
------------------------+-----------------------------------------------
|
|
||||||
Option | Description ~
|
|
||||||
------------------------+-----------------------------------------------
|
|
||||||
`branch` / `tag` / `commit` | Branch/tag/commit of the repository to use
|
|
||||||
`rtp` | Subdirectory that contains Vim plugin
|
|
||||||
`dir` | Custom directory for the plugin
|
|
||||||
`as` | Use different name for the plugin
|
|
||||||
`do` | Post-update hook (string or funcref)
|
|
||||||
`on` | On-demand loading: Commands or <Plug>-mappings
|
|
||||||
`for` | On-demand loading: File types
|
|
||||||
`frozen` | Do not update unless explicitly specified
|
|
||||||
------------------------+-----------------------------------------------
|
|
||||||
|
|
||||||
|
|
||||||
< Global options >____________________________________________________________~
|
|
||||||
*plug-global-options*
|
|
||||||
|
|
||||||
*g:plug_threads* *g:plug_timeout* *g:plug_retries* *g:plug_shallow* *g:plug_window*
|
|
||||||
*g:plug_pwindow* *g:plug_url_format*
|
|
||||||
|
|
||||||
--------------------+-----------------------------------+-----------------------------------------------------------------------------------
|
|
||||||
Flag | Default | Description ~
|
|
||||||
--------------------+-----------------------------------+-----------------------------------------------------------------------------------
|
|
||||||
`g:plug_threads` | 16 | Default number of threads to use
|
|
||||||
`g:plug_timeout` | 60 | Time limit of each task in seconds (Ruby & Python)
|
|
||||||
`g:plug_retries` | 2 | Number of retries in case of timeout (Ruby & Python)
|
|
||||||
`g:plug_shallow` | 1 | Use shallow clone
|
|
||||||
`g:plug_window` | `vertical topleft new` | Command to open plug window
|
|
||||||
`g:plug_pwindow` | `above 12new` | Command to open preview window in `PlugDiff`
|
|
||||||
`g:plug_url_format` | `https://git::@github.com/%s.git` | `printf` format to build repo URL (Only applies to the subsequent `Plug` commands)
|
|
||||||
--------------------+-----------------------------------+-----------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
|
|
||||||
< Keybindings >_______________________________________________________________~
|
|
||||||
*plug-keybindings*
|
|
||||||
|
|
||||||
*:PlugStatus* *:PlugDiff*
|
|
||||||
|
|
||||||
- `D` - `PlugDiff`
|
|
||||||
- `S` - `PlugStatus`
|
|
||||||
- `R` - Retry failed update or installation tasks
|
|
||||||
- `U` - Update plugins in the selected range
|
|
||||||
- `q` - Close the window
|
|
||||||
- `:PlugStatus`
|
|
||||||
- `L` - Load plugin
|
|
||||||
- `:PlugDiff`
|
|
||||||
- `X` - Revert the update
|
|
||||||
|
|
||||||
|
|
||||||
< Example: A small sensible Vim configuration >_______________________________~
|
|
||||||
*plug-example-a-small-sensible-vim-configuration*
|
|
||||||
>
|
|
||||||
call plug#begin()
|
|
||||||
Plug 'tpope/vim-sensible'
|
|
||||||
call plug#end()
|
|
||||||
<
|
|
||||||
|
|
||||||
< On-demand loading of plugins >______________________________________________~
|
|
||||||
*plug-on-demand-loading-of-plugins*
|
|
||||||
>
|
|
||||||
" NERD tree will be loaded on the first invocation of NERDTreeToggle command
|
|
||||||
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
|
|
||||||
|
|
||||||
" Multiple commands
|
|
||||||
Plug 'junegunn/vim-github-dashboard', { 'on': ['GHDashboard', 'GHActivity'] }
|
|
||||||
|
|
||||||
" Loaded when clojure file is opened
|
|
||||||
Plug 'tpope/vim-fireplace', { 'for': 'clojure' }
|
|
||||||
|
|
||||||
" Multiple file types
|
|
||||||
Plug 'kovisoft/paredit', { 'for': ['clojure', 'scheme'] }
|
|
||||||
|
|
||||||
" On-demand loading on both conditions
|
|
||||||
Plug 'junegunn/vader.vim', { 'on': 'Vader', 'for': 'vader' }
|
|
||||||
|
|
||||||
" Code to execute when the plugin is lazily loaded on demand
|
|
||||||
Plug 'junegunn/goyo.vim', { 'for': 'markdown' }
|
|
||||||
autocmd! User goyo.vim echom 'Goyo is now loaded!'
|
|
||||||
<
|
|
||||||
`for` option is generally not needed as most plugins for specific file types
|
|
||||||
usually don't have too much code in `plugin` directory. You might want to
|
|
||||||
examine the output of `vim --startuptime` before applying the option.
|
|
||||||
|
|
||||||
|
|
||||||
< Post-update hooks >_________________________________________________________~
|
|
||||||
*plug-post-update-hooks*
|
|
||||||
|
|
||||||
There are some plugins that require extra steps after installation or update.
|
|
||||||
In that case, use `do` option to describe the task to be performed.
|
|
||||||
>
|
|
||||||
Plug 'Shougo/vimproc.vim', { 'do': 'make' }
|
|
||||||
Plug 'Valloric/YouCompleteMe', { 'do': './install.py' }
|
|
||||||
<
|
|
||||||
If the value starts with `:`, it will be recognized as a Vim command.
|
|
||||||
|
|
||||||
*:GoInstallBinaries*
|
|
||||||
>
|
|
||||||
Plug 'fatih/vim-go', { 'do': ':GoInstallBinaries' }
|
|
||||||
<
|
|
||||||
If you need more control, you can pass a reference to a Vim function that
|
|
||||||
takes a single argument.
|
|
||||||
>
|
|
||||||
function! BuildYCM(info)
|
|
||||||
" info is a dictionary with 3 fields
|
|
||||||
" - name: name of the plugin
|
|
||||||
" - status: 'installed', 'updated', or 'unchanged'
|
|
||||||
" - force: set on PlugInstall! or PlugUpdate!
|
|
||||||
if a:info.status == 'installed' || a:info.force
|
|
||||||
!./install.py
|
|
||||||
endif
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
Plug 'Valloric/YouCompleteMe', { 'do': function('BuildYCM') }
|
|
||||||
<
|
|
||||||
Both forms of post-update hook are executed inside the directory of the plugin
|
|
||||||
and only run when the repository has changed, but you can force it to run
|
|
||||||
unconditionally with the bang-versions of the commands: `PlugInstall!` and
|
|
||||||
`PlugUpdate!`.
|
|
||||||
|
|
||||||
Make sure to escape BARs and double-quotes when you write `do` option inline
|
|
||||||
as they are mistakenly recognized as command separator or the start of the
|
|
||||||
trailing comment.
|
|
||||||
>
|
|
||||||
Plug 'junegunn/fzf', { 'do': 'yes \| ./install' }
|
|
||||||
<
|
|
||||||
But you can avoid the escaping if you extract the inline specification using a
|
|
||||||
variable (or any Vimscript expression) as follows:
|
|
||||||
|
|
||||||
*g:fzf_install*
|
|
||||||
>
|
|
||||||
let g:fzf_install = 'yes | ./install'
|
|
||||||
Plug 'junegunn/fzf', { 'do': g:fzf_install }
|
|
||||||
<
|
|
||||||
|
|
||||||
< PlugInstall! and PlugUpdate! >______________________________________________~
|
|
||||||
*pluginstall-and-plugupdate*
|
|
||||||
|
|
||||||
The installer takes the following steps when installing/updating a plugin:
|
|
||||||
|
|
||||||
1. `git clone` or `git fetch` from its origin
|
|
||||||
2. Check out branch, tag, or commit and optionally `git merge` remote branch
|
|
||||||
3. If the plugin was updated (or installed for the first time)
|
|
||||||
1. Update submodules
|
|
||||||
2. Execute post-update hooks
|
|
||||||
|
|
||||||
The commands with `!` suffix ensure that all steps are run unconditionally.
|
|
||||||
|
|
||||||
|
|
||||||
< Articles >__________________________________________________________________~
|
|
||||||
*plug-articles*
|
|
||||||
|
|
||||||
- {Writing my own Vim plugin manager}{11}
|
|
||||||
- {Vim plugins and startup time}{12}
|
|
||||||
- ~~{Thoughts on Vim plugin dependency}{13}~~
|
|
||||||
- Support for Plugfile has been removed since 0.5.0
|
|
||||||
|
|
||||||
{11} http://junegunn.kr/2013/09/writing-my-own-vim-plugin-manager
|
|
||||||
{12} http://junegunn.kr/2014/07/vim-plugins-and-startup-time
|
|
||||||
{13} http://junegunn.kr/2013/09/thoughts-on-vim-plugin-dependency
|
|
||||||
|
|
||||||
|
|
||||||
< License >___________________________________________________________________~
|
|
||||||
*plug-license*
|
|
||||||
|
|
||||||
MIT
|
|
||||||
|
|
||||||
|
|
||||||
==============================================================================
|
|
||||||
vim:tw=78:sw=2:ts=2:ft=help:norl:nowrap:
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 23 KiB |
File diff suppressed because it is too large
Load Diff
|
|
@ -1,25 +0,0 @@
|
||||||
Test cases for vim-plug
|
|
||||||
=======================
|
|
||||||
|
|
||||||
### Prerequisite
|
|
||||||
|
|
||||||
- [Vader.vim](https://github.com/junegunn/vader.vim)
|
|
||||||
|
|
||||||
### Run
|
|
||||||
|
|
||||||
```
|
|
||||||
./run
|
|
||||||
|
|
||||||
./run !
|
|
||||||
```
|
|
||||||
|
|
||||||
### TODO
|
|
||||||
|
|
||||||
Test cases for the following features are currently missing:
|
|
||||||
|
|
||||||
- Output formatting
|
|
||||||
- Timeout or interrupt cleaning up git processes
|
|
||||||
- User prompt in PlugClean command
|
|
||||||
- Single-threaded installer
|
|
||||||
- Windows support
|
|
||||||
|
|
||||||
|
|
@ -1,374 +0,0 @@
|
||||||
**********************************************************************
|
|
||||||
Execute (#112 On-demand loading should not suppress messages from ftplugin):
|
|
||||||
call ResetPlug()
|
|
||||||
call plug#begin('$PLUG_FIXTURES')
|
|
||||||
Plug '$PLUG_FIXTURES/ftplugin-msg', { 'for': 'c' }
|
|
||||||
call plug#end()
|
|
||||||
|
|
||||||
redir => out
|
|
||||||
tabnew a.c
|
|
||||||
redir END
|
|
||||||
Assert stridx(out, 'ftplugin-c') >= 0, 'Unexpected output (1): '.out
|
|
||||||
|
|
||||||
* The same applies to plug#load())
|
|
||||||
call ResetPlug()
|
|
||||||
redir => out
|
|
||||||
call plug#load('ftplugin-msg')
|
|
||||||
redir END
|
|
||||||
Assert stridx(out, 'ftplugin-c') >= 0, 'Unexpected output (2): '.out
|
|
||||||
q
|
|
||||||
|
|
||||||
|
|
||||||
**********************************************************************
|
|
||||||
Execute (#114 Should not contain empty path in &rtp):
|
|
||||||
call plug#begin('/tmp/vim-plug-test/plugged')
|
|
||||||
call plug#end()
|
|
||||||
|
|
||||||
Log &rtp
|
|
||||||
Assert &rtp !~ ',,', 'Commas'
|
|
||||||
Assert &rtp !~ '^,', 'Comma prefix'
|
|
||||||
Assert &rtp !~ ',$', 'Comma suffix'
|
|
||||||
|
|
||||||
**********************************************************************
|
|
||||||
Execute (#130 Proper cleanup of on-demand loading triggers):
|
|
||||||
augroup PlugLOD
|
|
||||||
autocmd!
|
|
||||||
augroup END
|
|
||||||
|
|
||||||
" Cleared on command
|
|
||||||
call ReloadPlug()
|
|
||||||
call plug#begin('/tmp/vim-plug-test/plugged')
|
|
||||||
Plug 'junegunn/vim-emoji', { 'on': ['EmojiCommand', 'EmojiCommand2', '<Plug>(EmojiMapping)'] }
|
|
||||||
call plug#end()
|
|
||||||
PlugInstall | q
|
|
||||||
|
|
||||||
Assert exists(':EmojiCommand'), 'EmojiCommand not defined'
|
|
||||||
Assert exists(':EmojiCommand2'), 'EmojiCommand2 not defined'
|
|
||||||
Assert !empty(mapcheck('<Plug>(EmojiMapping)')), '<Plug>(EmojiMapping) not defined'
|
|
||||||
|
|
||||||
silent! EmojiCommand
|
|
||||||
|
|
||||||
Assert !exists(':EmojiCommand'), 'EmojiCommand defined'
|
|
||||||
Assert !exists(':EmojiCommand2'), 'EmojiCommand2 defined'
|
|
||||||
Assert empty(mapcheck('<Plug>(EmojiMapping)')), '<Plug>(EmojiMapping) defined'
|
|
||||||
|
|
||||||
" Cleared on FileType
|
|
||||||
call ReloadPlug()
|
|
||||||
call plug#begin('/tmp/vim-plug-test/plugged')
|
|
||||||
Plug 'junegunn/vim-emoji', { 'on': ['EmojiCommandExtra', '<Plug>(EmojiMappingExtra)'], 'for': ['emoji'] }
|
|
||||||
call plug#end()
|
|
||||||
|
|
||||||
Assert exists(':EmojiCommandExtra'), 'EmojiCommandExtra not defined'
|
|
||||||
Assert !empty(mapcheck('<Plug>(EmojiMappingExtra)')), '<Plug>(EmojiMappingExtra) not defined'
|
|
||||||
|
|
||||||
setf emoji
|
|
||||||
|
|
||||||
Assert !exists(':EmojiCommandExtra'), 'EmojiCommandExtra defined'
|
|
||||||
Assert empty(mapcheck('<Plug>(EmojiMappingExtra)')), '<Plug>(EmojiMappingExtra) defined'
|
|
||||||
|
|
||||||
**********************************************************************
|
|
||||||
Execute (#131 Syntax error):
|
|
||||||
call plug#begin('/proc/no-permission')
|
|
||||||
Plug 'junegunn/vim-emoji'
|
|
||||||
call plug#end()
|
|
||||||
|
|
||||||
redir => out
|
|
||||||
silent PlugInstall
|
|
||||||
redir END
|
|
||||||
Assert out =~ 'Invalid plug directory: /proc/no-permission', out
|
|
||||||
|
|
||||||
**********************************************************************
|
|
||||||
Execute (#139-1 Using new remote branch):
|
|
||||||
" Make sure to remove the clone
|
|
||||||
call plug#begin('/tmp/vim-plug-test/plugged')
|
|
||||||
call plug#end()
|
|
||||||
PlugClean!
|
|
||||||
|
|
||||||
" Install master branch
|
|
||||||
call plug#begin('/tmp/vim-plug-test/plugged')
|
|
||||||
Plug expand('file:////tmp/vim-plug-test/new-branch')
|
|
||||||
call plug#end()
|
|
||||||
PlugUpdate
|
|
||||||
|
|
||||||
unlet! g:foo g:bar g:baz
|
|
||||||
call ResetPlug()
|
|
||||||
call plug#load('new-branch')
|
|
||||||
Assert exists('g:foo'), 'g:foo should be found (1)'
|
|
||||||
Assert !exists('g:bar'), 'g:bar should not be found (1)'
|
|
||||||
Assert !exists('g:baz'), 'g:baz should not be found (1)'
|
|
||||||
|
|
||||||
" Create a new branch on origin
|
|
||||||
call system('cd /tmp/vim-plug-test/new-branch && git checkout -b new &&'
|
|
||||||
\. 'echo "let g:bar = 1" > plugin/bar.vim && git add plugin/bar.vim &&'
|
|
||||||
\. 'git commit -m second')
|
|
||||||
|
|
||||||
" We're setting up two plugins so that parallel installer is used
|
|
||||||
call plug#begin('/tmp/vim-plug-test/plugged')
|
|
||||||
Plug 'junegunn/seoul256.vim'
|
|
||||||
Plug expand('file:////tmp/vim-plug-test/new-branch'), { 'branch': 'new' }
|
|
||||||
call plug#end()
|
|
||||||
PlugUpdate
|
|
||||||
silent %y
|
|
||||||
Log @"
|
|
||||||
Assert @" !~? 'error', 'Should be able to use new remote branch: ' . @"
|
|
||||||
|
|
||||||
unlet! g:foo g:bar g:baz
|
|
||||||
call ResetPlug()
|
|
||||||
call plug#load('new-branch')
|
|
||||||
Assert exists('g:foo'), 'g:foo should be found (2)'
|
|
||||||
Assert exists('g:bar'), 'g:bar should be found (2)'
|
|
||||||
Assert !exists('g:baz'), 'g:baz should not be found (2)'
|
|
||||||
|
|
||||||
call PlugStatusSorted()
|
|
||||||
|
|
||||||
Expect:
|
|
||||||
- new-branch: OK
|
|
||||||
- seoul256.vim: OK
|
|
||||||
Finished. 0 error(s).
|
|
||||||
[==]
|
|
||||||
|
|
||||||
Execute (#139-2 Using yet another new remote branch):
|
|
||||||
" Create another branch on origin
|
|
||||||
call system('cd /tmp/vim-plug-test/new-branch && git checkout master &&'
|
|
||||||
\. 'git checkout -b brand-new &&'
|
|
||||||
\. 'echo "let g:baz = 1" > plugin/baz.vim && git add plugin/baz.vim &&'
|
|
||||||
\. 'git commit -m third')
|
|
||||||
|
|
||||||
" Test Vim installer here
|
|
||||||
call plug#begin('/tmp/vim-plug-test/plugged')
|
|
||||||
Plug expand('file:////tmp/vim-plug-test/new-branch'), { 'branch': 'brand-new' }
|
|
||||||
call plug#end()
|
|
||||||
PlugUpdate
|
|
||||||
silent %y
|
|
||||||
Log @"
|
|
||||||
Assert @" !~? 'error', 'Should be able to use new remote branch: ' . @"
|
|
||||||
|
|
||||||
unlet! g:foo g:bar g:baz
|
|
||||||
call ResetPlug()
|
|
||||||
call plug#load('new-branch')
|
|
||||||
Assert exists('g:foo'), 'g:foo should be found'
|
|
||||||
Assert !exists('g:bar'), 'g:bar should not be found'
|
|
||||||
Assert exists('g:baz'), 'g:baz should be found'
|
|
||||||
|
|
||||||
call PlugStatusSorted()
|
|
||||||
|
|
||||||
Expect:
|
|
||||||
- new-branch: OK
|
|
||||||
Finished. 0 error(s).
|
|
||||||
[=]
|
|
||||||
|
|
||||||
Execute (#139-3 Should fail when not possible to fast-forward):
|
|
||||||
" Commit on cloned repo
|
|
||||||
call system('cd /tmp/vim-plug-test/plugged/new-branch && git checkout master &&'
|
|
||||||
\. 'touch foobar && git add foobar && git commit -m foobar')
|
|
||||||
|
|
||||||
" Different commit on remote
|
|
||||||
call system('cd /tmp/vim-plug-test/new-branch && git checkout master &&'
|
|
||||||
\. 'touch foobaz && git add foobaz && git commit -m foobaz')
|
|
||||||
|
|
||||||
for multi in [0, 1]
|
|
||||||
call plug#begin('/tmp/vim-plug-test/plugged')
|
|
||||||
if multi
|
|
||||||
Plug 'junegunn/seoul256.vim'
|
|
||||||
endif
|
|
||||||
Plug expand('file:////tmp/vim-plug-test/new-branch')
|
|
||||||
call plug#end()
|
|
||||||
PlugUpdate
|
|
||||||
silent %y
|
|
||||||
Assert @" =~ 'Not possible to fast-forward', @"
|
|
||||||
endfor
|
|
||||||
q
|
|
||||||
|
|
||||||
**********************************************************************
|
|
||||||
Execute (#145: Merging on-demand loading triggers - cmd):
|
|
||||||
unlet! g:xxx g:yyy
|
|
||||||
call plug#begin()
|
|
||||||
Plug '$PLUG_FIXTURES/xxx', { 'on': 'XXX' }
|
|
||||||
Plug '$PLUG_FIXTURES/yyy', { 'on': ['XXX', 'YYY'] }
|
|
||||||
call plug#end()
|
|
||||||
|
|
||||||
silent! XXX
|
|
||||||
|
|
||||||
Assert exists('g:xxx'), 'xxx is not loaded'
|
|
||||||
Assert exists('g:yyy'), 'yyy is not loaded'
|
|
||||||
Assert !exists(':YYY')
|
|
||||||
|
|
||||||
Execute (#145: Merging on-demand loading triggers - map):
|
|
||||||
unlet! g:xxx g:yyy
|
|
||||||
|
|
||||||
call ReloadPlug()
|
|
||||||
call plug#begin()
|
|
||||||
Plug '$PLUG_FIXTURES/xxx', { 'on': '<Plug>(xxx)' }
|
|
||||||
Plug '$PLUG_FIXTURES/yyy', { 'on': ['<Plug>(xxx)' ,'<Plug>(yyy)' ] }
|
|
||||||
call plug#end()
|
|
||||||
|
|
||||||
Assert !empty(mapcheck("<Plug>(xxx)"))
|
|
||||||
Assert !empty(mapcheck("<Plug>(yyy)"))
|
|
||||||
|
|
||||||
# FIXME feedkeys() cannot be tested with Vader
|
|
||||||
call plug#load('xxx', 'yyy')
|
|
||||||
Assert empty(mapcheck("<Plug>(xxx)"))
|
|
||||||
Assert empty(mapcheck("<Plug>(yyy)"))
|
|
||||||
|
|
||||||
**********************************************************************
|
|
||||||
Execute (#159: shell=/bin/tcsh):
|
|
||||||
let org = &shell
|
|
||||||
try
|
|
||||||
set shell=/bin/tcsh
|
|
||||||
call plug#begin('/tmp/vim-plug-test/plugged')
|
|
||||||
Plug 'junegunn/seoul256.vim'
|
|
||||||
call plug#end()
|
|
||||||
|
|
||||||
PlugStatus
|
|
||||||
Log getline(1, '$')
|
|
||||||
q
|
|
||||||
AssertEqual '/bin/tcsh', &shell
|
|
||||||
finally
|
|
||||||
let &shell = org
|
|
||||||
endtry
|
|
||||||
|
|
||||||
**********************************************************************
|
|
||||||
Execute (#154: Spaces in &rtp should not be escaped):
|
|
||||||
call plug#begin('/tmp/vim-plug-test/plug it')
|
|
||||||
Plug 'foo/seoul256 vim'
|
|
||||||
call plug#end()
|
|
||||||
Log &rtp
|
|
||||||
Assert stridx(&rtp, 'plug it/seoul256 vim') >= 0
|
|
||||||
|
|
||||||
**********************************************************************
|
|
||||||
Execute (#184: Duplicate entries in &rtp):
|
|
||||||
call plug#begin('/tmp/vim-plug-test/plugged')
|
|
||||||
Plug 'foo/plugin1'
|
|
||||||
\| Plug 'foo/plugin0'
|
|
||||||
|
|
||||||
Plug 'foo/plugin2'
|
|
||||||
\| Plug 'foo/plugin0'
|
|
||||||
\| Plug 'foo/plugin1'
|
|
||||||
call plug#end()
|
|
||||||
|
|
||||||
Log &rtp
|
|
||||||
AssertEqual 3, len(filter(split(&rtp, ','), 'stridx(v:val, "plugged") >= 0'))
|
|
||||||
|
|
||||||
**********************************************************************
|
|
||||||
Execute (#236: Plugin removed from &rtp when .vimrc is reloaded):
|
|
||||||
unlet! g:loaded_easy_align_plugin
|
|
||||||
silent! delc EasyAlign
|
|
||||||
|
|
||||||
call ReloadPlug()
|
|
||||||
call plug#begin('/tmp/vim-plug-test/plugged')
|
|
||||||
Plug 'junegunn/vim-easy-align', { 'on': 'EasyAlign' }
|
|
||||||
call plug#end()
|
|
||||||
PlugInstall | q
|
|
||||||
|
|
||||||
Assert &rtp !~ '/vim-easy-align', 'Plugin should not be in &rtp'
|
|
||||||
%EasyAlign=
|
|
||||||
Assert &rtp =~ '/vim-easy-align', 'Plugin should be in &rtp'
|
|
||||||
|
|
||||||
call plug#begin('/tmp/vim-plug-test/plugged')
|
|
||||||
Plug 'junegunn/vim-easy-align', { 'on': 'EasyAlign' }
|
|
||||||
call plug#end()
|
|
||||||
Assert &rtp =~ '/vim-easy-align', 'Plugin should still be in &rtp'
|
|
||||||
|
|
||||||
**********************************************************************
|
|
||||||
Execute (#350: Ruby installer failed to unshallow tagged plugin on update):
|
|
||||||
call plug#begin('/tmp/vim-plug-test/plugged')
|
|
||||||
call plug#end()
|
|
||||||
PlugClean!
|
|
||||||
|
|
||||||
" Shallow clone. We should have at least 2 plugins to enable parallel installer.
|
|
||||||
call plug#begin('/tmp/vim-plug-test/plugged')
|
|
||||||
Plug 'junegunn/vim-easy-align'
|
|
||||||
Plug 'junegunn/seoul256.vim'
|
|
||||||
call plug#end()
|
|
||||||
PlugUpdate
|
|
||||||
Assert filereadable(g:plugs['vim-easy-align'].dir.'/.git/shallow')
|
|
||||||
|
|
||||||
" Now unshallowed
|
|
||||||
call plug#begin('/tmp/vim-plug-test/plugged')
|
|
||||||
Plug 'junegunn/vim-easy-align', { 'tag': '2.9.0' }
|
|
||||||
Plug 'junegunn/seoul256.vim'
|
|
||||||
call plug#end()
|
|
||||||
PlugUpdate
|
|
||||||
Assert !filereadable(g:plugs['vim-easy-align'].dir.'/.git/shallow')
|
|
||||||
q
|
|
||||||
|
|
||||||
**********************************************************************
|
|
||||||
Execute (#474: Load ftdetect files in filetypedetect augroup):
|
|
||||||
call plug#begin('/tmp/vim-plug-test/plugged')
|
|
||||||
Plug 'junegunn/rust.vim', { 'for': 'rust', 'commit': '115d321d383eb96d438466c56cc871fcc1bd0faa' }
|
|
||||||
call plug#end()
|
|
||||||
PlugInstall!
|
|
||||||
q
|
|
||||||
|
|
||||||
tabnew /tmp/vim-plug-test/any.rs
|
|
||||||
AssertEqual 'rust', &filetype
|
|
||||||
Log &filetype
|
|
||||||
filetype detect
|
|
||||||
AssertEqual 'rust', &filetype
|
|
||||||
Log &filetype
|
|
||||||
bd
|
|
||||||
|
|
||||||
**********************************************************************
|
|
||||||
Execute (#489/#587 On-demand loading with 'on' option should trigger BufRead autocmd w/o nomodeline):
|
|
||||||
call plug#begin('$PLUG_FIXTURES')
|
|
||||||
Plug 'foo/ftplugin-msg', { 'on': 'XXX' }
|
|
||||||
call plug#end()
|
|
||||||
|
|
||||||
tabnew a.java
|
|
||||||
call setline(1, '// vim: set filetype=lava:')
|
|
||||||
redir => out
|
|
||||||
silent! XXX
|
|
||||||
redir END
|
|
||||||
Assert stridx(out, 'ftplugin-java') >= 0
|
|
||||||
AssertEqual 'lava', &filetype
|
|
||||||
q!
|
|
||||||
|
|
||||||
**********************************************************************
|
|
||||||
Execute (Cursor moved to another window during post-update hook):
|
|
||||||
function! DoSplit(...)
|
|
||||||
new
|
|
||||||
call setline(1, 'empty')
|
|
||||||
endfunction
|
|
||||||
call plug#begin('/tmp/vim-plug-test/plugged')
|
|
||||||
Plug 'junegunn/rust.vim', { 'do': function('DoSplit') }
|
|
||||||
call plug#end()
|
|
||||||
PlugInstall!
|
|
||||||
AssertEqual 1, line('$')
|
|
||||||
AssertEqual 'empty', getline(1)
|
|
||||||
q!
|
|
||||||
q
|
|
||||||
|
|
||||||
**********************************************************************
|
|
||||||
Execute (#593 Add plugin to &rtp before running post-update hook with : prefix):
|
|
||||||
call ReloadPlug()
|
|
||||||
call plug#begin()
|
|
||||||
Plug 'junegunn/vim-pseudocl', { 'on': 'XXX', 'do': ':let g:bar = pseudocl#complete#extract_words(''a b'')' }
|
|
||||||
call plug#end()
|
|
||||||
PlugInstall!
|
|
||||||
AssertEqual ['a', 'b'], g:bar
|
|
||||||
|
|
||||||
**********************************************************************
|
|
||||||
Execute (#602 Confusion with branch name and path name):
|
|
||||||
call plug#begin()
|
|
||||||
Plug expand('file:////tmp/vim-plug-test/new-branch'), { 'branch': 'plugin' }
|
|
||||||
call plug#end()
|
|
||||||
PlugUpdate
|
|
||||||
call PlugStatusSorted()
|
|
||||||
|
|
||||||
Expect:
|
|
||||||
- new-branch: OK
|
|
||||||
Finished. 0 error(s).
|
|
||||||
[=]
|
|
||||||
|
|
||||||
**********************************************************************
|
|
||||||
Execute (PlugStatus showed error with wildcard tag):
|
|
||||||
call plug#begin()
|
|
||||||
Plug 'junegunn/vim-easy-align', { 'tag': '*' }
|
|
||||||
call plug#end()
|
|
||||||
PlugUpdate
|
|
||||||
call PlugStatusSorted()
|
|
||||||
|
|
||||||
Expect:
|
|
||||||
- vim-easy-align: OK
|
|
||||||
Finished. 0 error(s).
|
|
||||||
[=]
|
|
||||||
|
|
@ -1,130 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# Privileged mode, ignores $CDPATH etc.
|
|
||||||
set -p
|
|
||||||
set -eu
|
|
||||||
|
|
||||||
cd "$(dirname "${BASH_SOURCE[0]}")"
|
|
||||||
|
|
||||||
export BASE="$PWD"
|
|
||||||
export PLUG_SRC="$PWD/../plug.vim"
|
|
||||||
export PLUG_FIXTURES="$PWD/fixtures"
|
|
||||||
mkdir -p "$PLUG_FIXTURES"
|
|
||||||
export TEMP=/tmp/vim-plug-test
|
|
||||||
rm -rf "$TEMP"
|
|
||||||
mkdir -p "$TEMP"
|
|
||||||
|
|
||||||
cat > $TEMP/mini-vimrc << VIMRC
|
|
||||||
set rtp+=$TEMP/junegunn/vader.vim
|
|
||||||
set shell=/bin/bash
|
|
||||||
VIMRC
|
|
||||||
|
|
||||||
clone() {
|
|
||||||
if [ ! -d "$2" ]; then
|
|
||||||
git clone "$1" "$2"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
clone_repos() (
|
|
||||||
cd $TEMP
|
|
||||||
mkdir -p junegunn vim-scripts jg
|
|
||||||
for repo in vader.vim goyo.vim rust.vim seoul256.vim vim-easy-align vim-fnr \
|
|
||||||
vim-oblique vim-pseudocl vim-redis vim-emoji; do
|
|
||||||
clone https://github.com/junegunn/${repo}.git junegunn/$repo &
|
|
||||||
done
|
|
||||||
clone https://github.com/vim-scripts/beauty256.git vim-scripts/beauty256 &
|
|
||||||
clone https://github.com/junegunn/fzf.git fzf &
|
|
||||||
clone https://github.com/yous/subsubmodule.git yous/subsubmodule && \
|
|
||||||
(cd yous/subsubmodule && git submodule update --init --recursive &) &
|
|
||||||
wait
|
|
||||||
|
|
||||||
clone junegunn/vim-emoji jg/vim-emoji
|
|
||||||
cd junegunn/seoul256.vim && git checkout no-t_co && git checkout master
|
|
||||||
)
|
|
||||||
|
|
||||||
make_dirs() (
|
|
||||||
rm -rf "$PLUG_FIXTURES/$1"
|
|
||||||
mkdir -p "$PLUG_FIXTURES/$1"
|
|
||||||
cd "$PLUG_FIXTURES/$1"
|
|
||||||
mkdir -p autoload colors ftdetect ftplugin indent plugin syntax
|
|
||||||
for d in *; do
|
|
||||||
[ -d "$d" ] || continue
|
|
||||||
cat > "$d/xxx.vim" << EOF
|
|
||||||
" echom expand('<sfile>')
|
|
||||||
let g:total_order = get(g:, 'total_order', [])
|
|
||||||
let g:$2 = get(g:, '$2', [])
|
|
||||||
let s:name = join(filter(['$2', '${1:4}', '$d'], '!empty(v:val)'), '/')
|
|
||||||
call add(g:$2, s:name)
|
|
||||||
call add(g:total_order, s:name)
|
|
||||||
EOF
|
|
||||||
done
|
|
||||||
)
|
|
||||||
|
|
||||||
gitinit() (
|
|
||||||
cd "$PLUG_FIXTURES/$1"
|
|
||||||
git init
|
|
||||||
git commit -m 'commit' --allow-empty
|
|
||||||
)
|
|
||||||
|
|
||||||
prepare() {
|
|
||||||
make_dirs xxx/ xxx
|
|
||||||
make_dirs xxx/after xxx
|
|
||||||
mkdir -p "$PLUG_FIXTURES/xxx/doc"
|
|
||||||
cat > "$PLUG_FIXTURES/xxx/doc/xxx.txt" << DOC
|
|
||||||
hello *xxx*
|
|
||||||
DOC
|
|
||||||
gitinit xxx
|
|
||||||
|
|
||||||
make_dirs yyy/ yyy
|
|
||||||
make_dirs yyy/after yyy
|
|
||||||
mkdir -p "$PLUG_FIXTURES/yyy/rtp/doc"
|
|
||||||
cat > "$PLUG_FIXTURES/yyy/rtp/doc/yyy.txt" << DOC
|
|
||||||
hello *yyy*
|
|
||||||
DOC
|
|
||||||
gitinit yyy
|
|
||||||
|
|
||||||
make_dirs z1/ z1
|
|
||||||
make_dirs z2/ z2
|
|
||||||
|
|
||||||
rm -rf "$PLUG_FIXTURES/ftplugin-msg"
|
|
||||||
mkdir -p "$PLUG_FIXTURES/ftplugin-msg/ftplugin"
|
|
||||||
echo "echomsg 'ftplugin-c'" > "$PLUG_FIXTURES/ftplugin-msg/ftplugin/c.vim"
|
|
||||||
echo "echomsg 'ftplugin-java'" > "$PLUG_FIXTURES/ftplugin-msg/ftplugin/java.vim"
|
|
||||||
|
|
||||||
rm -rf $TEMP/new-branch
|
|
||||||
cd $TEMP
|
|
||||||
git init new-branch
|
|
||||||
cd new-branch
|
|
||||||
mkdir plugin
|
|
||||||
echo 'let g:foo = 1' > plugin/foo.vim
|
|
||||||
git add plugin/foo.vim
|
|
||||||
git commit -m initial
|
|
||||||
git checkout -b plugin
|
|
||||||
git checkout master
|
|
||||||
|
|
||||||
cd "$BASE"
|
|
||||||
}
|
|
||||||
|
|
||||||
select_vim() {
|
|
||||||
local vim=/usr/bin/vim
|
|
||||||
if [ -n "${DEPS:-}" ] && [ -e "${DEPS}/bin/vim" ]; then
|
|
||||||
vim="${DEPS}/bin/vim"
|
|
||||||
elif [ -e "/usr/local/bin/vim" ]; then
|
|
||||||
vim=/usr/local/bin/vim
|
|
||||||
fi
|
|
||||||
echo $vim
|
|
||||||
}
|
|
||||||
|
|
||||||
clone_repos
|
|
||||||
prepare
|
|
||||||
|
|
||||||
git --version
|
|
||||||
vim=$(select_vim)
|
|
||||||
echo "Selected Vim: $vim"
|
|
||||||
if [ "${1:-}" = '!' ]; then
|
|
||||||
$vim -Nu $TEMP/mini-vimrc -c 'Vader! test.vader' > /dev/null &&
|
|
||||||
prepare &&
|
|
||||||
$vim -Nu $TEMP/mini-vimrc -c 'let g:plug_threads = 1 | Vader! test.vader' > /dev/null
|
|
||||||
else
|
|
||||||
$vim -Nu $TEMP/mini-vimrc -c 'Vader test.vader'
|
|
||||||
fi
|
|
||||||
|
|
@ -1,108 +0,0 @@
|
||||||
Execute (Initialize test environment):
|
|
||||||
Save &rtp, g:plugs, g:plug_home, g:plug_window
|
|
||||||
unlet! g:plugs g:plug_home g:plug_window
|
|
||||||
|
|
||||||
let g:plug_url_format = 'file:///tmp/vim-plug-test/%s'
|
|
||||||
let g:base_rtp = &rtp
|
|
||||||
let g:first_rtp = split(&rtp, ',')[0]
|
|
||||||
let g:last_rtp = split(&rtp, ',')[-1]
|
|
||||||
let g:temp_plugged = tempname()
|
|
||||||
if !exists('$PLUG_SRC')
|
|
||||||
let $PLUG_SRC = globpath(&rtp, 'autoload/plug.vim')
|
|
||||||
endif
|
|
||||||
let $PLUG_TMP = fnamemodify(tempname(), ':h').'/plug.vim'
|
|
||||||
|
|
||||||
" Temporarily patch plug.vim
|
|
||||||
call system('cp "$PLUG_SRC" "$PLUG_TMP"')
|
|
||||||
let patch =
|
|
||||||
\ ['function! ResetPlug()', 'let s:loaded = {}', 'endfunction',
|
|
||||||
\ 'function! CompareURI(a, b)', 'return s:compare_git_uri(a:a, a:b)', 'endfunction']
|
|
||||||
|
|
||||||
if $ENV != 'vim8'
|
|
||||||
call add(patch, 'let s:vim8 = 0')
|
|
||||||
endif
|
|
||||||
|
|
||||||
call writefile(extend(readfile($PLUG_TMP), patch), $PLUG_TMP)
|
|
||||||
|
|
||||||
set t_Co=256
|
|
||||||
colo default
|
|
||||||
pclose
|
|
||||||
|
|
||||||
function! PlugStatusSorted()
|
|
||||||
PlugStatus
|
|
||||||
%y
|
|
||||||
q
|
|
||||||
normal! P
|
|
||||||
%sort
|
|
||||||
g/^$/d
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! AssertExpect(bang, pat, cnt)
|
|
||||||
let op = a:bang ? '==#' : '=~#'
|
|
||||||
AssertEqual a:cnt, len(filter(getline(1, '$'), "v:val ".op." '".a:pat."'"))
|
|
||||||
endfunction
|
|
||||||
command! -nargs=+ -bang AssertExpect call AssertExpect('<bang>' == '!', <args>)
|
|
||||||
|
|
||||||
function! EnsureLoaded()
|
|
||||||
if has('vim_starting')
|
|
||||||
runtime! plugin/**/*.vim
|
|
||||||
endif
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! RmRf(file)
|
|
||||||
call system(printf('rm -rf "%s"', a:file))
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! ReloadPlug()
|
|
||||||
call ResetPlug()
|
|
||||||
source $PLUG_TMP
|
|
||||||
let &rtp = g:base_rtp
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! GitBranch(repo)
|
|
||||||
return system(printf('cd %s && git rev-parse --abbrev-ref HEAD', g:plugs[a:repo].dir))[:-2]
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! GitTag(repo)
|
|
||||||
return system(printf('cd %s && git describe --tags', g:plugs[a:repo].dir))[:-2]
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! GitCommit(repo)
|
|
||||||
return system(printf('cd %s && git rev-parse HEAD', g:plugs[a:repo].dir))[:-2]
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
source $PLUG_TMP
|
|
||||||
|
|
||||||
Execute (Print Interpreter Version):
|
|
||||||
redir => out
|
|
||||||
if has('ruby')
|
|
||||||
silent! ruby puts 'Ruby: ' + RUBY_VERSION
|
|
||||||
endif
|
|
||||||
if has('python')
|
|
||||||
silent! python import sys; svi = sys.version_info; print 'Python: {}.{}.{}'.format(svi[0], svi[1], svi[2])
|
|
||||||
endif
|
|
||||||
if has('python3')
|
|
||||||
silent! python3 import sys; svi = sys.version_info; print('Python: {}.{}.{}'.format(svi[0], svi[1], svi[2]))
|
|
||||||
endif
|
|
||||||
redir END
|
|
||||||
Log split(out, '\n')
|
|
||||||
|
|
||||||
Include: workflow.vader
|
|
||||||
Include: regressions.vader
|
|
||||||
|
|
||||||
Execute (Cleanup):
|
|
||||||
silent! call RmRf(g:temp_plugged)
|
|
||||||
silent! unlet g:plugs g:plug_home g:plug_url_format
|
|
||||||
silent! unlet g:temp_plugged g:first_rtp g:last_rtp g:base_rtp out
|
|
||||||
silent! delf PlugStatusSorted
|
|
||||||
silent! delf AssertExpect
|
|
||||||
silent! delf PlugUpdated
|
|
||||||
silent! delf EnsureLoaded
|
|
||||||
silent! delf ReloadPlug
|
|
||||||
silent! delc AssertExpect
|
|
||||||
silent! unmap /
|
|
||||||
silent! unmap ?
|
|
||||||
call delete($PLUG_TMP)
|
|
||||||
|
|
||||||
Restore
|
|
||||||
|
|
||||||
File diff suppressed because it is too large
Load Diff
1
.vimrc
1
.vimrc
|
|
@ -122,7 +122,6 @@ if ! &diff
|
||||||
endif
|
endif
|
||||||
|
|
||||||
"tweaking my statusline
|
"tweaking my statusline
|
||||||
|
|
||||||
function! GitBranch()
|
function! GitBranch()
|
||||||
return system("git rev-parse --abbrev-ref HEAD 2>/dev/null | tr -d '\n'")
|
return system("git rev-parse --abbrev-ref HEAD 2>/dev/null | tr -d '\n'")
|
||||||
endfunction
|
endfunction
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user