Compare commits
164 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
425ef39db2 | ||
|
|
bd2cb9d2de | ||
|
|
0263370bd1 | ||
|
|
4b3fbd1592 | ||
|
|
396a534a0a | ||
|
|
a45c3834f8 | ||
|
|
a5c3952380 | ||
|
|
60bda7322f | ||
|
|
05008e7a82 | ||
|
|
2889cb4739 | ||
|
|
61b21068ee | ||
|
|
15da7eb78a | ||
|
|
385a1eb350 | ||
|
|
8c915a5271 | ||
|
|
ee9f0e55b8 | ||
|
|
018adb2aef | ||
|
|
da47e6ee56 | ||
|
|
662274e617 | ||
|
|
4eeff535fa | ||
|
|
c3669836d3 | ||
|
|
eb38fe3d32 | ||
|
|
e7704e6cb3 | ||
|
|
e1e04cabd5 | ||
|
|
afc20ecff3 | ||
|
|
38510a8788 | ||
|
|
a34b06dd54 | ||
|
|
5d910fc9ea | ||
|
|
f31477407a | ||
|
|
0e907d4f38 | ||
|
|
cb08d6036b | ||
|
|
9d63fe6aeb | ||
|
|
0489b5deed | ||
|
|
cac2f9f439 | ||
|
|
115a25de79 | ||
|
|
a64b156682 | ||
|
|
a9fa8f44e5 | ||
|
|
d6590fa883 | ||
|
|
cabaf7b431 | ||
|
|
6e509db6ff | ||
|
|
7b7778d5ba | ||
|
|
f3e2d214df | ||
|
|
5ec1faefab | ||
|
|
6406d73c9a | ||
|
|
ff4cbe23c0 | ||
|
|
681ca2d43a | ||
|
|
adb2413f0d | ||
|
|
dda21b50bf | ||
|
|
537a5321aa | ||
|
|
99f6f36b69 | ||
|
|
3f82808bea | ||
|
|
7474edf13f | ||
|
|
25b0fb7583 | ||
|
|
a868ee4c11 | ||
|
|
49851436ff | ||
|
|
2f9a94e8c0 | ||
|
|
ab3bd3b17c | ||
|
|
3572ffde79 | ||
|
|
18c8b54793 | ||
|
|
1752de5b7c | ||
|
|
2f3225fc60 | ||
|
|
1022acad0b | ||
|
|
68c7fbbf9d | ||
|
|
da24f714e0 | ||
|
|
c1bbbaf3ef | ||
|
|
f7ebba7b9e | ||
|
|
6272f5e289 | ||
|
|
f43067c7a5 | ||
|
|
e6cba28997 | ||
|
|
f1b8832a13 | ||
|
|
d0c94a9b08 | ||
|
|
3a2e406cd0 | ||
|
|
84cdf61730 | ||
|
|
0aeea1db08 | ||
|
|
8289477d18 | ||
|
|
19b12e2216 | ||
|
|
4c9ebe9c31 | ||
|
|
74dcd13575 | ||
|
|
518f20652f | ||
|
|
665ec057d7 | ||
|
|
bc212dca77 | ||
|
|
8da7b50fb2 | ||
|
|
4ae2e879e1 | ||
|
|
93628b1c3d | ||
|
|
01e126469b | ||
|
|
a7477f04b7 | ||
|
|
0fdb56ba72 | ||
|
|
d89949f16c | ||
|
|
19b8221c14 | ||
|
|
336fadd236 | ||
|
|
a216e38a59 | ||
|
|
d930594686 | ||
|
|
f4261711ae | ||
|
|
61b77bc8e8 | ||
|
|
fe7c7e7b40 | ||
|
|
25afdf138c | ||
|
|
b36fd34da0 | ||
|
|
7e55690f19 | ||
|
|
30ef53d832 | ||
|
|
f58d090bb2 | ||
|
|
eeef77e9c8 | ||
|
|
6af2cd8946 | ||
|
|
878cdd5309 | ||
|
|
9bb2da53a0 | ||
|
|
58c06ed77e | ||
|
|
2e691c6feb | ||
|
|
a18087610a | ||
|
|
276106d987 | ||
|
|
d499fc311a | ||
|
|
c4b4aa8f07 | ||
|
|
d690f8d576 | ||
|
|
8738341ad0 | ||
|
|
5ab2024fbb | ||
|
|
300176ba9f | ||
|
|
da7d6bd58b | ||
|
|
b651558c63 | ||
|
|
2d815ad2f0 | ||
|
|
3af4079179 | ||
|
|
e6a594f1ad | ||
|
|
e741d02ad0 | ||
|
|
b2208640d4 | ||
|
|
aa49c38586 | ||
|
|
b6b10ac17e | ||
|
|
706f7e00ea | ||
|
|
6ff1031339 | ||
|
|
0936877399 | ||
|
|
d956e16f15 | ||
|
|
f98c8456fa | ||
|
|
5b2c03d3a8 | ||
|
|
0b31be49cf | ||
|
|
74fa6ab9df | ||
|
|
0d7e20c984 | ||
|
|
e2714fb56e | ||
|
|
3b83a22ea4 | ||
|
|
cd418369bc | ||
|
|
279a334c8b | ||
|
|
9132e9d50d | ||
|
|
3323163e04 | ||
|
|
e4671eaf9e | ||
|
|
9afa356fb3 | ||
|
|
e04f696682 | ||
|
|
4cb5fd04a6 | ||
|
|
c16743e8fc | ||
|
|
46a6e8441f | ||
|
|
466d1839b3 | ||
|
|
c3cf35abb5 | ||
|
|
344f80aedb | ||
|
|
dae0540a11 | ||
|
|
af89938633 | ||
|
|
35c5f2830b | ||
|
|
60b907c87f | ||
|
|
9ceb9caa09 | ||
|
|
42a42e7e71 | ||
|
|
8885b1086f | ||
|
|
90c07f269c | ||
|
|
f1c5157e35 | ||
|
|
7f1ec7b12b | ||
|
|
f90afc9081 | ||
|
|
612b9b3afd | ||
|
|
58891e05be | ||
|
|
baf7b18f73 | ||
|
|
cc37ed48be | ||
|
|
afe7dc6f8f | ||
|
|
8863a3a53c | ||
|
|
ee04a646d3 |
15
.travis.yml
Normal file
@@ -0,0 +1,15 @@
|
||||
language: ruby
|
||||
rvm:
|
||||
- 1.8.7
|
||||
- 2.0.0
|
||||
|
||||
before_script: |
|
||||
hg clone https://code.google.com/p/vim/
|
||||
cd vim
|
||||
./configure --with-features=huge --enable-rubyinterp
|
||||
make
|
||||
sudo make install
|
||||
cd -
|
||||
|
||||
script: |
|
||||
test/run !
|
||||
245
README.md
@@ -1,34 +1,33 @@
|
||||

|
||||

|
||||
[](https://travis-ci.org/junegunn/vim-plug)
|
||||
|
||||
A single-file Vim plugin manager.
|
||||
A minimalist Vim plugin manager.
|
||||
|
||||
Somewhere between [Pathogen](https://github.com/tpope/vim-pathogen) and
|
||||
[Vundle](https://github.com/gmarik/vundle), but with faster parallel installer.
|
||||
|
||||

|
||||

|
||||
|
||||
### Pros.
|
||||
|
||||
- Easier to setup
|
||||
- Parallel installation/update (requires
|
||||
[+ruby](http://junegunn.kr/2013/09/installing-vim-with-ruby-support/))
|
||||
- Smallest possible feature set
|
||||
- Branch/tag support
|
||||
- On-demand loading
|
||||
- Dependency resolution using `Plugfile` (experimental)
|
||||
|
||||
### Cons.
|
||||
|
||||
- Everything else
|
||||
- Easier to setup: Single file. No boilerplate code required.
|
||||
- Easier to use: Concise, intuitive syntax
|
||||
- [Super-fast](https://raw.githubusercontent.com/junegunn/i/master/vim-plug/40-in-4.gif)
|
||||
parallel installation/update (requires
|
||||
[+ruby](https://github.com/junegunn/vim-plug/wiki/ruby) or
|
||||
[Neovim](http://neovim.org/))
|
||||
- On-demand loading to achieve
|
||||
[fast startup time](http://junegunn.kr/images/vim-startup-time.png)
|
||||
- Post-update hooks
|
||||
- Can choose a specific branch or tag for each plugin
|
||||
- Support for externally managed plugins
|
||||
|
||||
### Usage
|
||||
|
||||
[Download plug.vim](https://raw.github.com/junegunn/vim-plug/master/plug.vim)
|
||||
[Download plug.vim](https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim)
|
||||
and put it in ~/.vim/autoload
|
||||
|
||||
```sh
|
||||
mkdir -p ~/.vim/autoload
|
||||
curl -fLo ~/.vim/autoload/plug.vim https://raw.github.com/junegunn/vim-plug/master/plug.vim
|
||||
curl -fLo ~/.vim/autoload/plug.vim \
|
||||
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
|
||||
```
|
||||
|
||||
Edit your .vimrc
|
||||
@@ -36,51 +35,76 @@ Edit your .vimrc
|
||||
```vim
|
||||
call plug#begin('~/.vim/plugged')
|
||||
|
||||
" Make sure you use single quotes
|
||||
Plug 'junegunn/seoul256.vim'
|
||||
Plug 'junegunn/vim-easy-align'
|
||||
|
||||
" On-demand loading
|
||||
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
|
||||
Plug 'tpope/vim-fireplace', { 'for': 'clojure' }
|
||||
" Plug 'user/repo1', 'branch_or_tag'
|
||||
" Plug 'user/repo2', { 'rtp': 'vim/plugin/dir', 'branch': 'devel' }
|
||||
" Plug 'git@github.com:junegunn/vim-github-dashboard.git'
|
||||
" ...
|
||||
|
||||
" Using git URL
|
||||
Plug 'https://github.com/junegunn/vim-github-dashboard.git'
|
||||
|
||||
" Plugin options
|
||||
Plug 'nsf/gocode', { 'tag': 'go.weekly.2012-03-13', 'rtp': 'vim' }
|
||||
|
||||
" Plugin outside ~/.vim/plugged with post-update hook
|
||||
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': 'yes \| ./install' }
|
||||
|
||||
" Unmanaged plugin (manually installed and updated)
|
||||
Plug '~/my-prototype-plugin'
|
||||
|
||||
call plug#end()
|
||||
```
|
||||
|
||||
Reload .vimrc and `:PlugInstall` to install plugins.
|
||||
|
||||
### Plugin directory
|
||||
|
||||
If you omit the path argument to `plug#begin()`, plugins are installed in
|
||||
`plugged` directory under the first path in `runtimepath` at the point when
|
||||
`plug#begin()` is called. This is usually `~/.vim/plugged` (or
|
||||
`$HOME/vimfiles/plugged` on Windows) given that you didn't touch runtimepath
|
||||
before the call.
|
||||
|
||||
### 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 | See the updated changes from the previous PlugUpdate |
|
||||
| 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` | See the updated changes from the previous PlugUpdate |
|
||||
| `PlugSnapshot [output path]` | Generate script for restoring the current snapshot of the plugins |
|
||||
|
||||
### Options for parallel installer
|
||||
### `Plug` 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 |
|
||||
| Option | Description |
|
||||
| -------------- | ------------------------------------------------ |
|
||||
| `branch`/`tag` | Branch or tag of the repository to use |
|
||||
| `rtp` | Subdirectory that contains Vim plugin |
|
||||
| `dir` | Custom directory 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 (*for Ruby installer*) |
|
||||
| `g:plug_retries` | 2 | Number of retries in case of timeout (*for Ruby installer*) |
|
||||
| `g:plug_window` | `vertical topleft new` | Command to open plug window |
|
||||
| `g:plug_url_format` | `https://git::@github.com/%s.git` | `printf` format to build repo URL |
|
||||
|
||||
### 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
|
||||
|
||||
@@ -102,87 +126,76 @@ 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' }
|
||||
```
|
||||
|
||||
### Dependency resolution
|
||||
`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.
|
||||
|
||||
See [Dependency
|
||||
Resolution](https://github.com/junegunn/vim-plug/wiki/Dependency-Resolution).
|
||||
### 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 'Valloric/YouCompleteMe', { 'do': './install.sh' }
|
||||
```
|
||||
|
||||
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.sh
|
||||
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 }
|
||||
```
|
||||
|
||||
### FAQ/Troubleshooting
|
||||
|
||||
See [FAQ/Troubleshooting](https://github.com/junegunn/vim-plug/wiki/faq).
|
||||
|
||||
### Articles
|
||||
|
||||
- [Writing my own Vim plugin manager](http://junegunn.kr/2013/09/writing-my-own-vim-plugin-manager)
|
||||
- [Thoughts on Vim plugin dependency](http://junegunn.kr/2013/09/thoughts-on-vim-plugin-dependency)
|
||||
- [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*
|
||||
|
||||
### FAQ/Troubleshooting
|
||||
### License
|
||||
|
||||
#### Plugins are not installed/updated in parallel
|
||||
|
||||
Your Vim does not support Ruby interface. `:echo has('ruby')` should print 1.
|
||||
In order to setup Vim with Ruby support, you may refer to [this
|
||||
article](http://junegunn.kr/2013/09/installing-vim-with-ruby-support).
|
||||
|
||||
#### *Vim: Caught deadly signal SEGV*
|
||||
|
||||
If your Vim crashes with the above message, first check if its Ruby interface is
|
||||
working correctly with the following command:
|
||||
|
||||
```vim
|
||||
:ruby puts RUBY_VERSION
|
||||
```
|
||||
|
||||
If Vim crashes even with this command, it is likely that Ruby interface is
|
||||
broken, and you have to rebuild Vim with a working version of Ruby.
|
||||
(`brew remove vim && brew install vim` or `./configure && make ...`)
|
||||
|
||||
If you're on OS X, one possibility is that you had installed Vim with
|
||||
[Homebrew](http://brew.sh/) while using a Ruby installed with
|
||||
[RVM](http://rvm.io/) or [rbenv](https://github.com/sstephenson/rbenv) and later
|
||||
removed that version of Ruby.
|
||||
|
||||
[Please let me know](https://github.com/junegunn/vim-plug/issues) if you can't
|
||||
resolve the problem. In the meantime, you can set `g:plug_threads` to 1, so that
|
||||
Ruby installer is not used at all.
|
||||
|
||||
#### Errors on fish shell
|
||||
|
||||
If vim-plug doesn't work correctly on fish shell, you might need to add `set
|
||||
shell=/bin/sh` to your .vimrc.
|
||||
|
||||
Refer to the following links for the details:
|
||||
- http://badsimplicity.com/vim-fish-e484-cant-open-file-tmpvrdnvqe0-error/
|
||||
- https://github.com/junegunn/vim-plug/issues/12
|
||||
|
||||
#### Freezing plugin version with commit hash
|
||||
|
||||
vim-plug does not allow you to freeze the version of a plugin with its commit
|
||||
hash. This is by design. I don't believe a user of a plugin should be looking
|
||||
at its individual commits. Instead, one should be choosing the right version
|
||||
using release tags or versioned branches (e.g. 1.2.3, stable, devel, etc.)
|
||||
|
||||
```vim
|
||||
Plug 'junegunn/vim-easy-align', '2.9.2'
|
||||
```
|
||||
|
||||
If the repository doesn't come with such tags or branches, you should think of
|
||||
it as "unstable" or "in development", and always use its latest revision.
|
||||
|
||||
If you really must choose a certain untagged revision, consider forking the
|
||||
repository.
|
||||
|
||||
### Regarding feature request
|
||||
|
||||
You may submit a request for a new feature by [creating an
|
||||
issue](https://github.com/junegunn/vim-plug/issues). However, please be minded
|
||||
that this is an opinionated software and I want to keep the feature set as small
|
||||
as possible. So I may not agree with you on the necessity of the suggested
|
||||
feature. If that happens, I suggest the following options.
|
||||
|
||||
1. Check out [Vundle](https://github.com/gmarik/vundle) or
|
||||
[NeoBundle](https://github.com/Shougo/neobundle.vim).
|
||||
They offer broader feature sets.
|
||||
2. Create a fork of this project and let it be your own plugin manager.
|
||||
There's no need for us to have a single canonical branch.
|
||||
MIT
|
||||
|
||||
|
||||
BIN
gif/Plugfile.gif
|
Before Width: | Height: | Size: 528 KiB |
BIN
gif/parallel.gif
|
Before Width: | Height: | Size: 306 KiB |
BIN
gif/pi.gif
|
Before Width: | Height: | Size: 922 KiB |
BIN
gif/pu.gif
|
Before Width: | Height: | Size: 247 KiB |
BIN
gif/serial.gif
|
Before Width: | Height: | Size: 650 KiB |
BIN
gif/si.gif
|
Before Width: | Height: | Size: 1.1 MiB |
BIN
gif/su.gif
|
Before Width: | Height: | Size: 521 KiB |
BIN
gif/vim-plug.gif
|
Before Width: | Height: | Size: 2.3 MiB |
@@ -7,8 +7,10 @@ Test cases for vim-plug
|
||||
|
||||
### Run
|
||||
|
||||
```vim
|
||||
:e workflow.vader | Vader
|
||||
```
|
||||
./run
|
||||
|
||||
./run !
|
||||
```
|
||||
|
||||
### TODO
|
||||
@@ -18,7 +20,6 @@ Test cases for the following features are currently missing:
|
||||
- Output formatting
|
||||
- Timeout or interrupt cleaning up git processes
|
||||
- User prompt in PlugClean command
|
||||
- Automatic dependency resolution using Plugfile
|
||||
- Single-threaded installer
|
||||
- Windows support
|
||||
|
||||
|
||||
5
test/fixtures/.gitignore
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
fzf*
|
||||
xxx
|
||||
yyy
|
||||
z1
|
||||
z2
|
||||
1
test/fixtures/ftplugin-msg/ftplugin/c.vim
vendored
Normal file
@@ -0,0 +1 @@
|
||||
echomsg 'ftplugin'
|
||||
68
test/run
@@ -5,15 +5,65 @@ cd ..
|
||||
PLUG_SRC=$(pwd)/plug.vim
|
||||
cd - > /dev/null
|
||||
|
||||
export VADER_RTP=$TMPDIR/vader-rtp
|
||||
vim -e +Vader -c ':call writefile([fnamemodify(globpath(&rtp, "autoload/vader.vim"), ":h:h")], $VADER_RTP)' +q
|
||||
export PLUG_FIXTURES=$(pwd)/fixtures
|
||||
|
||||
MINI_VIMRC=$TMPDIR/mini-vimrc
|
||||
cat > $MINI_VIMRC << EOF
|
||||
let \$MYVIMRC = '$MINI_VIMRC'
|
||||
set nocompatible
|
||||
set rtp=$(cat $VADER_RTP)
|
||||
source $PLUG_SRC
|
||||
if [ ! -d vader.vim ]; then
|
||||
git clone https://github.com/junegunn/vader.vim.git
|
||||
fi
|
||||
|
||||
rm -rf $PLUG_FIXTURES/fzf
|
||||
if [ ! -d fzf-staged ]; then
|
||||
git clone https://github.com/junegunn/fzf.git $PLUG_FIXTURES/fzf-staged
|
||||
fi
|
||||
|
||||
make_dirs() {
|
||||
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
|
||||
cd - > /dev/null
|
||||
}
|
||||
|
||||
init() {
|
||||
rm -rf $PLUG_FIXTURES/{xxx,yyy,z1,z2}
|
||||
|
||||
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
|
||||
|
||||
make_dirs yyy/ yyy
|
||||
make_dirs yyy/after yyy
|
||||
|
||||
make_dirs z1/ z1
|
||||
make_dirs z2/ z2
|
||||
}
|
||||
|
||||
cat > /tmp/mini-vimrc << VIMRC
|
||||
set rtp+=vader.vim
|
||||
set shell=/bin/bash
|
||||
source $PLUG_SRC
|
||||
VIMRC
|
||||
|
||||
[ -z "$TMPDIR" ] && export TMPDIR=/tmp/
|
||||
init
|
||||
if [ "$1" = '!' ]; then
|
||||
/usr/local/bin/vim -Nu /tmp/mini-vimrc -c 'Vader! workflow.vader' > /dev/null &&
|
||||
init &&
|
||||
/usr/local/bin/vim -Nu /tmp/mini-vimrc -c 'let g:plug_threads = 1 | Vader! workflow.vader' > /dev/null
|
||||
else
|
||||
/usr/local/bin/vim -Nu /tmp/mini-vimrc -c 'Vader workflow.vader'
|
||||
fi
|
||||
|
||||
vim -u $MINI_VIMRC +Vader*
|
||||
|
||||