@@ -2,131 +2,57 @@ plug.txt plug Last change: March 7 2024
2
2
PLUG - TABLE OF CONTENTS *plug* *plug-toc*
3
3
==============================================================================
4
4
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 |
28
19
29
20
VIM-PLUG *vim-plug*
30
21
==============================================================================
31
22
32
23
A minimalist Vim plugin manager.
33
24
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
- <
100
25
101
26
< Getting Help >______________________________________________________________~
102
27
*plug-getting-help*
103
28
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 }
108
33
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
114
39
115
40
116
41
< Usage >_____________________________________________________________________~
117
42
*plug-usage*
118
43
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)
121
46
122
47
*plug#begin* *plug#end*
123
48
124
- 1. Begin the section with `call plug#begin ([PLUGIN_DIR])`
49
+ 1. Begin the section with `call plug#begin([PLUGIN_DIR])`
125
50
2. List the plugins with `Plug` commands
126
- 3. `call plug#end ()` to update 'runtimepath' and initialize plugin system
127
- - Automatically executes `filetype plugin indent on ` and `syntax enable ` .
128
- You can revert the settings after the call. e.g. `filetype indent off ` ,
129
- `syntax off ` , 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.
130
56
131
57
132
58
Example~
@@ -178,30 +104,77 @@ Example~
178
104
" filetype indent off " Disable file-type-specific indentation
179
105
" syntax off " Disable syntax highlighting
180
106
<
181
- *:PlugInstall*
182
107
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
184
153
185
154
186
155
< Commands >__________________________________________________________________~
187
156
*plug-commands*
188
157
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
194
166
`PlugClean[! ]` | Remove unlisted plugins (bang version will clean without prompt)
195
167
`PlugUpgrade` | Upgrade vim-plug itself
196
168
`PlugStatus` | Check the status of plugins
197
169
`PlugDiff` | Examine changes from the previous update and the pending changes
198
- `PlugSnapshot[! ] [output path ]` | 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
+ -------------------------------------+ ------------------------------------------------------------------
200
172
201
173
202
174
< Plug options >______________________________________________________________~
203
175
*plug-options*
204
- *:Plug*
176
+
177
+ *<Plug>-mappings*
205
178
206
179
------------------------+-----------------------------------------------
207
180
Option | Description ~
@@ -239,8 +212,6 @@ Reload .vimrc and `:PlugInstall` to install plugins.
239
212
< Keybindings >_______________________________________________________________~
240
213
*plug-keybindings*
241
214
242
- *:PlugStatus* *:PlugDiff*
243
-
244
215
- `D` - `PlugDiff`
245
216
- `S ` - `PlugStatus`
246
217
- `R` - Retry failed update or installation tasks
@@ -284,7 +255,7 @@ Reload .vimrc and `:PlugInstall` to install plugins.
284
255
<
285
256
The `for ` option is generally not needed as most plugins for specific file
286
257
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.
288
259
289
260
290
261
< Post-update hooks >_________________________________________________________~
@@ -343,8 +314,8 @@ variable (or any Vimscript expression) as follows:
343
314
344
315
The installer takes the following steps when installing/updating a plugin:
345
316
346
- 1. `git clone` or `git fetch` from its origin
347
- 2. Check out branch, tag, or commit and optionally `git merge` 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
348
319
3. If the plugin was updated (or installed for the first time)
349
320
1. Update submodules
350
321
2. Execute post-update hooks
@@ -353,34 +324,10 @@ The commands with the `!` suffix ensure that all steps are run
353
324
unconditionally.
354
325
355
326
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
-
379
327
< License >___________________________________________________________________~
380
328
*plug-license*
381
329
382
330
MIT
383
331
384
-
385
332
==============================================================================
386
333
vim:tw=78:sw=2:ts=2:ft=help:norl:nowrap:
0 commit comments