Skip to content

Commit 94b7aa9

Browse files
committed
Update README and vimdoc
1 parent 03a9bb6 commit 94b7aa9

File tree

2 files changed

+91
-151
lines changed

2 files changed

+91
-151
lines changed

README.md

-7
Original file line numberDiff line numberDiff line change
@@ -372,13 +372,6 @@ The installer takes the following steps when installing/updating a plugin:
372372

373373
The commands with the `!` suffix ensure that all steps are run unconditionally.
374374

375-
### Articles
376-
377-
- [Writing my own Vim plugin manager](http://junegunn.kr/2013/09/writing-my-own-vim-plugin-manager)
378-
- [Vim plugins and startup time](http://junegunn.kr/2014/07/vim-plugins-and-startup-time)
379-
- ~~[Thoughts on Vim plugin dependency](http://junegunn.kr/2013/09/thoughts-on-vim-plugin-dependency)~~
380-
- *Support for Plugfile has been removed since 0.5.0*
381-
382375
### Collaborators
383376

384377
- [Jan Edmund Lazo](https://github.com/janlazo) - Windows support

doc/plug.txt

+91-144
Original file line numberDiff line numberDiff line change
@@ -2,131 +2,57 @@ plug.txt plug Last change: March 7 2024
22
PLUG - TABLE OF CONTENTS *plug* *plug-toc*
33
==============================================================================
44

5-
vim-plug
6-
Pros.
7-
Installation
8-
Vim
9-
Unix
10-
Windows (PowerShell)
11-
Neovim
12-
Unix
13-
Windows (PowerShell)
14-
Getting Help
15-
Usage
16-
Example
17-
Commands
18-
Plug options
19-
Global options
20-
Keybindings
21-
Example: A small sensible Vim configuration
22-
On-demand loading of plugins
23-
Post-update hooks
24-
PlugInstall! and PlugUpdate!
25-
Articles
26-
Collaborators
27-
License
5+
vim-plug |vim-plug|
6+
Getting Help |plug-getting-help|
7+
Usage |plug-usage|
8+
Example |plug-example|
9+
Example (Lua configuration for Neovim) |plug-examplelua-configuration-for-neovim|
10+
Commands |plug-commands|
11+
Plug options |plug-options|
12+
Global options |plug-global-options|
13+
Keybindings |plug-keybindings|
14+
Example: A small sensible Vim configuration |plug-example-a-small-sensible-vim-configuration|
15+
On-demand loading of plugins |plug-on-demand-loading-of-plugins|
16+
Post-update hooks |plug-post-update-hooks|
17+
PlugInstall! and PlugUpdate! |pluginstall-and-plugupdate|
18+
License |plug-license|
2819

2920
VIM-PLUG *vim-plug*
3021
==============================================================================
3122

3223
A minimalist Vim plugin manager.
3324

34-
https://raw.githubusercontent.com/junegunn/i/master/vim-plug/installer.gif
35-
36-
37-
< Pros. >_____________________________________________________________________~
38-
*plug-pros*
39-
40-
- Easy to set up: Single file. No boilerplate code required.
41-
- Easy to use: Concise, intuitive syntax
42-
- {Super-fast}{1} parallel installation/update (with any of `+job`, `+python`,
43-
`+python3`, `+ruby`, or {Neovim}{2})
44-
- Creates shallow clones to minimize disk space usage and download time
45-
- On-demand loading for {faster startup time}{3}
46-
- Can review and rollback updates
47-
- Branch/tag/commit support
48-
- Post-update hooks
49-
- Support for externally managed plugins
50-
51-
{1} https://raw.githubusercontent.com/junegunn/i/master/vim-plug/40-in-4.gif
52-
{2} http://neovim.org/
53-
{3} https://github.com/junegunn/vim-startuptime-benchmark#result
54-
55-
56-
< Installation >______________________________________________________________~
57-
*plug-installation*
58-
59-
{Download plug.vim}{4} and put it in the "autoload" directory.
60-
61-
{4} https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
62-
63-
64-
Vim~
65-
*plug-vim*
66-
67-
68-
>> Unix~
69-
>
70-
curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
71-
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
72-
<
73-
You can automate the process by putting the command in your Vim configuration
74-
file as suggested {here}{5}.
75-
76-
{5} https://github.com/junegunn/vim-plug/wiki/tips#automatic-installation
77-
78-
79-
>> Windows (PowerShell)~
80-
>
81-
iwr -useb https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim |`
82-
ni $HOME/vimfiles/autoload/plug.vim -Force
83-
<
84-
85-
Neovim~
86-
*plug-neovim*
87-
88-
89-
>> Unix~
90-
>
91-
sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \
92-
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
93-
<
94-
95-
>> Windows (PowerShell)~
96-
>
97-
iwr -useb https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim |`
98-
ni "$(@($env:XDG_DATA_HOME, $env:LOCALAPPDATA)[$null -eq $env:XDG_DATA_HOME])/nvim-data/site/autoload/plug.vim" -Force
99-
<
10025

10126
< Getting Help >______________________________________________________________~
10227
*plug-getting-help*
10328

104-
- See {tutorial}{6} page to learn the basics of vim-plug
105-
- See {tips}{7} and {FAQ}{8} pages for common problems and questions
106-
- See {requirements}{9} page for debugging information & tested configurations
107-
- Create an {issue}{10}
29+
- See {tutorial}{1} page to learn the basics of vim-plug
30+
- See {tips}{2} and {FAQ}{3} pages for common problems and questions
31+
- See {requirements}{4} page for debugging information & tested configurations
32+
- Create an {issue}{5}
10833

109-
{6} https://github.com/junegunn/vim-plug/wiki/tutorial
110-
{7} https://github.com/junegunn/vim-plug/wiki/tips
111-
{8} https://github.com/junegunn/vim-plug/wiki/faq
112-
{9} https://github.com/junegunn/vim-plug/wiki/requirements
113-
{10} https://github.com/junegunn/vim-plug/issues/new
34+
{1} https://github.com/junegunn/vim-plug/wiki/tutorial
35+
{2} https://github.com/junegunn/vim-plug/wiki/tips
36+
{3} https://github.com/junegunn/vim-plug/wiki/faq
37+
{4} https://github.com/junegunn/vim-plug/wiki/requirements
38+
{5} https://github.com/junegunn/vim-plug/issues/new
11439

11540

11641
< Usage >_____________________________________________________________________~
11742
*plug-usage*
11843

119-
Add a vim-plug section to your `~/.vimrc` (or `stdpath('config') . '/init.vim'` for
120-
Neovim)
44+
Add a vim-plug section to your `~/.vimrc` (or
45+
`stdpath('config') . '/init.vim'` for Neovim)
12146

12247
*plug#begin* *plug#end*
12348

124-
1. Begin the section with `callplug#begin([PLUGIN_DIR])`
49+
1. Begin the section with `call plug#begin([PLUGIN_DIR])`
12550
2. List the plugins with `Plug` commands
126-
3. `callplug#end()` to update 'runtimepath' and initialize plugin system
127-
- Automatically executes `filetypepluginindenton` and `syntaxenable`.
128-
You can revert the settings after the call. e.g. `filetypeindentoff`,
129-
`syntaxoff`, etc.
51+
3. `call plug#end()` to update 'runtimepath' and initialize plugin system
52+
- Automatically executes `filetype plugin indent on` and `syntax enable`.
53+
You can revert the settings after the call. e.g. `filetype indent off`,
54+
`syntax off`, etc.
55+
4. Reload the file or restart Vim and run `:PlugInstall` to install plugins.
13056

13157

13258
Example~
@@ -178,30 +104,77 @@ Example~
178104
" filetype indent off " Disable file-type-specific indentation
179105
" syntax off " Disable syntax highlighting
180106
<
181-
*:PlugInstall*
182107

183-
Reload .vimrc and `:PlugInstall` to install plugins.
108+
Example (Lua configuration for Neovim)~
109+
*plug-example-lua-configuration-for-neovim*
110+
111+
In Neovim, you can write your configuration in a Lua script file named
112+
`init.lua`. The following code is the Lua script equivalent to the VimScript
113+
example above.
114+
>
115+
local vim = vim
116+
local Plug = vim.fn['plug#']
117+
118+
vim.call('plug#begin')
119+
120+
-- Shorthand notation; fetches https://github.com/junegunn/vim-easy-align
121+
Plug('junegunn/vim-easy-align')
122+
123+
-- Any valid git URL is allowed
124+
Plug('https://github.com/junegunn/vim-github-dashboard.git')
125+
126+
-- Multiple Plug commands can be written in a single line using ; separators
127+
Plug('SirVer/ultisnips'); Plug('honza/vim-snippets')
128+
129+
-- On-demand loading
130+
Plug('preservim/nerdtree', { ['on'] = 'NERDTreeToggle' })
131+
Plug('tpope/vim-fireplace', { ['for'] = 'clojure' })
132+
133+
-- Using a non-default branch
134+
Plug('rdnetto/YCM-Generator', { ['branch'] = 'stable' })
135+
136+
-- Using a tagged release; wildcard allowed (requires git 1.9.2 or above)
137+
Plug('fatih/vim-go', { ['tag'] = '*' })
138+
139+
-- Plugin options
140+
Plug('nsf/gocode', { ['tag'] = 'v.20150303', ['rtp'] = 'vim' })
141+
142+
-- Plugin outside ~/.vim/plugged with post-update hook
143+
Plug('junegunn/fzf', { ['dir'] = '~/.fzf', ['do'] = './install --all' })
144+
145+
-- Unmanaged plugin (manually installed and updated)
146+
Plug('~/my-prototype-plugin')
147+
148+
vim.call('plug#end')
149+
<
150+
More examples can be found in:
151+
152+
- https://gitlab.com/sultanahamer/dotfiles/-/blob/master/nvim/lua/plugins.lua?ref_type=heads
184153

185154

186155
< Commands >__________________________________________________________________~
187156
*plug-commands*
188157

189-
------------------------------------+-------------------------------------------------------------------
190-
Command | Description ~
191-
------------------------------------+-------------------------------------------------------------------
192-
`PlugInstall [name ...] [#threads]` | Install plugins
193-
`PlugUpdate [name ...] [#threads]` | Install or update plugins
158+
*:PlugInstall* *:PlugUpdate* *:PlugClean* *:PlugUpgrade* *:PlugStatus* *:PlugDiff*
159+
*:PlugSnapshot*
160+
161+
-------------------------------------+------------------------------------------------------------------
162+
Command | Description ~
163+
-------------------------------------+------------------------------------------------------------------
164+
`PlugInstall [name ...] [#threads]` | Install plugins
165+
`PlugUpdate [name ...] [#threads]` | Install or update plugins
194166
`PlugClean[!]` | Remove unlisted plugins (bang version will clean without prompt)
195167
`PlugUpgrade` | Upgrade vim-plug itself
196168
`PlugStatus` | Check the status of plugins
197169
`PlugDiff` | Examine changes from the previous update and the pending changes
198-
`PlugSnapshot[!][outputpath]` | Generate script for restoring the current snapshot of the plugins
199-
------------------------------------+-------------------------------------------------------------------
170+
`PlugSnapshot[!] [output path]` | Generate script for restoring the current snapshot of the plugins
171+
-------------------------------------+------------------------------------------------------------------
200172

201173

202174
< Plug options >______________________________________________________________~
203175
*plug-options*
204-
*:Plug*
176+
177+
*<Plug>-mappings*
205178

206179
------------------------+-----------------------------------------------
207180
Option | Description ~
@@ -239,8 +212,6 @@ Reload .vimrc and `:PlugInstall` to install plugins.
239212
< Keybindings >_______________________________________________________________~
240213
*plug-keybindings*
241214

242-
*:PlugStatus* *:PlugDiff*
243-
244215
- `D` - `PlugDiff`
245216
- `S` - `PlugStatus`
246217
- `R` - Retry failed update or installation tasks
@@ -284,7 +255,7 @@ Reload .vimrc and `:PlugInstall` to install plugins.
284255
<
285256
The `for` option is generally not needed as most plugins for specific file
286257
types usually don't have too much code in the `plugin` directory. You might
287-
want to examine the output of `vim--startuptime` before applying the option.
258+
want to examine the output of `vim --startuptime` before applying the option.
288259

289260

290261
< Post-update hooks >_________________________________________________________~
@@ -343,8 +314,8 @@ variable (or any Vimscript expression) as follows:
343314

344315
The installer takes the following steps when installing/updating a plugin:
345316

346-
1. `gitclone` or `gitfetch` from its origin
347-
2. Check out branch, tag, or commit and optionally `gitmerge` remote branch
317+
1. `git clone` or `git fetch` from its origin
318+
2. Check out branch, tag, or commit and optionally `git merge` remote branch
348319
3. If the plugin was updated (or installed for the first time)
349320
1. Update submodules
350321
2. Execute post-update hooks
@@ -353,34 +324,10 @@ The commands with the `!` suffix ensure that all steps are run
353324
unconditionally.
354325

355326

356-
< Articles >__________________________________________________________________~
357-
*plug-articles*
358-
359-
- {Writing my own Vim plugin manager}{11}
360-
- {Vim plugins and startup time}{12}
361-
- ~~{Thoughts on Vim plugin dependency}{13}~~
362-
- Support for Plugfile has been removed since 0.5.0
363-
364-
{11} http://junegunn.kr/2013/09/writing-my-own-vim-plugin-manager
365-
{12} http://junegunn.kr/2014/07/vim-plugins-and-startup-time
366-
{13} http://junegunn.kr/2013/09/thoughts-on-vim-plugin-dependency
367-
368-
369-
< Collaborators >_____________________________________________________________~
370-
*plug-collaborators*
371-
372-
- {Jan Edmund Lazo}{14} - Windows support
373-
- {Jeremy Pallats}{15} - Python installer
374-
375-
{14} https://github.com/janlazo
376-
{15} https://github.com/starcraftman
377-
378-
379327
< License >___________________________________________________________________~
380328
*plug-license*
381329

382330
MIT
383331

384-
385332
==============================================================================
386333
vim:tw=78:sw=2:ts=2:ft=help:norl:nowrap:

0 commit comments

Comments
 (0)