Skip to content

Commit 71aca12

Browse files
committed
docs(lockfile): Add lockfile docs to help docs
1 parent 822e391 commit 71aca12

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

doc/packer.txt

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ FEATURES *packer-intro-features*
4444
- Uses jobs for async installation
4545
- Support for `git` tags, branches, revisions, submodules
4646
- Support for local plugins
47+
- Lockfile for for keeping plugins in sync between systems
4748
- Support for saving/restoring snapshots for plugin versions (`git` only)
4849

4950
==============================================================================
@@ -124,6 +125,12 @@ Clean, then update and install plugins.
124125
`PackerSync` *packer-commands-sync*
125126
Perform `PackerUpdate` and then `PackerCompile`.
126127

128+
`PackerUpdate` *packer-commands-upgrade*
129+
Perform `PackerUpdate` without lockfile.
130+
131+
`PackerLockfile` *packer-commands-lockfile*
132+
Updates lockfile from installed plugins.
133+
127134
`PackerLoad` *packer-commands-load*
128135
Loads opt plugin immediately
129136

@@ -186,8 +193,10 @@ commands work well for this purpose: >
186193
command! -nargs=* -complete=customlist,v:lua.require'packer'.plugin_complete PackerInstall lua require('packer').install(<f-args>)
187194
command! -nargs=* -complete=customlist,v:lua.require'packer'.plugin_complete PackerUpdate lua require('packer').update(<f-args>)
188195
command! -nargs=* -complete=customlist,v:lua.require'packer'.plugin_complete PackerSync lua require('packer').sync(<f-args>)
196+
command! -nargs=* -complete=customlist,v:lua.require'packer'.plugin_complete PackerUpgrade lua require('packer').upgrade(<f-args>)
189197
command! PackerClean packadd packer.nvim | lua require('plugins').clean()
190198
command! PackerCompile packadd packer.nvim | lua require('plugins').compile('~/.config/nvim/plugin/packer_load.vim')
199+
command! PackerLockfile packadd packer.nvim | lua require('packer').lockfile()
191200
command! -bang -nargs=+ -complete=customlist,v:lua.require'packer'.loader_complete PackerLoad lua require('packer').loader(<f-args>, '<bang>')
192201
193202
CONFIGURATION *packer-configuration*
@@ -225,6 +234,11 @@ default values: >
225234
clone_timeout = 60, -- Timeout, in seconds, for git clones
226235
default_url_format = 'https://github.com/%s' -- Lua format string used for "aaa/bbb" style plugins
227236
},
237+
lockfile = {
238+
enable = false, -- Should packer apply lockfile to `installer` and `updater`
239+
path = util.join_paths(stdpath 'config', 'lockfile.lua'), -- Default file location for lockfile
240+
update_on_upgrade = false, -- Should packer update the lockfile after upgrading plugins
241+
},
228242
log = { level = 'warn' }, -- The default print log level. One of: "trace", "debug", "info", "warn", "error", "fatal".
229243
display = {
230244
non_interactive = false, -- If true, disable display windows for all operations
@@ -481,6 +495,12 @@ They can be configured by changing the value of `config.display.keybindings`
481495
(see |packer-configuration|). Setting it to `false` will disable all keybindings.
482496
Setting any of its keys to `false` will disable the corresponding keybinding.
483497

498+
LOCKFILE *packer-lockfile*
499+
`packer` provides a `lockfile` to help manage plugin updates. This is useful
500+
for users that store their configuration in some sort of source repository.
501+
Committing packer's lockfile will ensure that packer will `install` and
502+
`update` plugins to known working commits for their configuration.
503+
484504
USER AUTOCMDS *packer-user-autocmds*
485505
`packer` runs most of its operations asyncronously. If you would like to
486506
implement automations that require knowing when the operations are complete,
@@ -519,6 +539,10 @@ It can be invoked with no arguments or with a list of plugin names to install.
519539
These plugin names must already be managed by `packer` via a call to
520540
|packer.use()|.
521541

542+
lockfile() *packer.lockfile()*
543+
`lockfile` updates packer's lockfile (defined by `lockfile.path`) based on
544+
currently installed plugins.
545+
522546
reset() *packer.reset()*
523547
`reset` empties the set of managed plugins. Called with no arguments; used to
524548
ensure plugin specifications are reinitialized if the specification file is
@@ -544,6 +568,10 @@ It can be invoked with no arguments or with a list of plugin names to update.
544568
These plugin names must already be managed by `packer` via a call to
545569
|packer.use()|.
546570

571+
upgrade() *packer.upgrade()*
572+
`upgrade` performes an `update` without applying the `lockfile`. This will
573+
update plugins to their latest versions.
574+
547575
snapshot(snapshot_name, ...) *packer.snapshot()*
548576
`snapshot` takes the rev of all the installed plugins and serializes them into a Lua table which will be saved under `config.snapshot_path` (which is the directory that will hold all the snapshots files) as `config.snapshot_path/<snapshot_name>` or an absolute path provided by the users.
549577
Optionally plugins name can be specified so that only those plugins will be

0 commit comments

Comments
 (0)