You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -363,7 +352,7 @@ default configuration values (and structure of the configuration table) are:
363
352
lockfile= {
364
353
enable=false, -- Should packer apply lockfile to `installer` and `updater`
365
354
path=util.join_paths(stdpath'config', 'lockfile.lua'), -- Default file location for lockfile
366
-
update_on_upgrade=false, -- Should packer update the lockfile after upgrading plugins
355
+
regen_on_update=false, -- Should packer update the lockfile after upgrading plugins
367
356
},
368
357
luarocks= {
369
358
python_cmd='python' -- Set the python command to use for running hererocks
@@ -421,11 +410,12 @@ use {
421
410
ft=stringorlist, -- Specifies filetypes which load this plugin.
422
411
keys=stringorlist, -- Specifies maps which load this plugin. See "Keybindings".
423
412
event=stringorlist, -- Specifies autocommand events which load this plugin.
424
-
fn=stringorlist-- Specifies functions which load this plugin.
413
+
fn=stringorlist,-- Specifies functions which load this plugin.
425
414
cond=string, function, orlistofstrings/functions, -- Specifies a conditional test to load this plugin
426
-
module=stringorlist-- Specifies Lua module names for require. When requiring a string which starts
415
+
module=stringorlist,-- Specifies Lua module names for require. When requiring a string which starts
427
416
-- with one of these module names, the plugin will be loaded.
428
-
module_pattern=string/list-- Specifies Lua pattern of Lua module names for require. When requiring a string which matches one of these patterns, the plugin will be loaded.
417
+
module_pattern=string/list-- Specifies Lua pattern of Lua module names for require. When requiring a
418
+
-- string which matches one of these patterns, the plugin will be loaded.
429
419
}
430
420
```
431
421
@@ -544,14 +534,20 @@ below, `plugins` is an optional table of plugin names; if not provided, the defa
544
534
plugins":
545
535
546
536
-`packer.install(plugins)`: Install the specified plugins if they are not already installed
537
+
-`packer.install(opts, plugins)`: First argument can be a table of optional args
538
+
-`nolockfile`: `boolean` Should the command use the lockfile
539
+
-`lockfile`: `string` Override the default lockfile path to be used
547
540
-`packer.update(plugins)`: Update the specified plugins, installing any that are missing
548
-
-`packer.update(opts, plugins)`: First argument can be a table specifying options, such as `{preview_updates = true}` to preview potential changes before updating (same as `PackerUpdate --preview`).
541
+
-`packer.update(opts, plugins)`: First argument can be a table specifying options
542
+
-`preview`: `boolean` Preview potential change before updating
543
+
-`nolockfile`: `boolean` Should the command use the lockfile
544
+
-`lockfile`: `string` Override the default lockfile path to be used
549
545
-`packer.clean()`: Remove any disabled or no longer managed plugins
550
546
-`packer.sync(plugins)`: Perform a `clean` followed by an `update`.
551
547
-`packer.sync(opts, plugins)`: Can take same optional options as `update`.
552
-
-`packer.upgrade(plugins)`: Performs an `update` without applying the lockfile
553
548
-`packer.compile(path)`: Compile lazy-loader code and save to `path`.
554
-
-`packer.lockfile()`: Updates lockfile based on currently installed plugins
549
+
-`packer.lockfile(opts)`: Updates lockfile based on currently installed plugins
550
+
-`path`: `string` Override lockfile output path
555
551
-`packer.snapshot(snapshot_name, ...)`: Creates a snapshot file that will live under `config.snapshot_path/<snapshot_name>`. If `snapshot_name` is an absolute path, then that will be the location where the snapshot will be taken. Optionally, a list of plugins name can be provided to selectively choose the plugins to snapshot.
556
552
-`packer.rollback(snapshot_name, ...)`: Rollback plugins status a snapshot file that will live under `config.snapshot_path/<snapshot_name>`. If `snapshot_name` is an absolute path, then that will be the location where the snapshot will be taken. Optionally, a list of plugins name can be provided to selectively choose which plugins to revert.
557
553
-`packer.delete(snapshot_name)`: Deletes a snapshot file under `config.snapshot_path/<snapshot_name>`. If `snapshot_name` is an absolute path, then that will be the location where the snapshot will be deleted.
@@ -592,6 +588,40 @@ name and information table as arguments.
592
588
configuration in some sort of source repository. Committing packer's lockfile will ensure that packer will
593
589
`install` and `update` plugins to known working commits for their configuration.
594
590
591
+
Enabling lockfile support will change the default behavior of `install`, `update`, and `sync` commands.
592
+
If the lockfile contains a plugin, packer will update to that commit instead of the latest changes. If the
593
+
plugin is not found in the lockfile packer will fetch the latest changes.
594
+
595
+
When wanting to update your local plugins to the latest changes call your packer update command with
596
+
`--nolockfile` argument. This will ignore the lockfile and update your plugins to the latest changes.
597
+
598
+
Some example commands:
599
+
600
+
```vim
601
+
" Generate the lockfile to lockfile.path defined in packer's config
602
+
PackerLockfile
603
+
604
+
" Generating a lockfile to some other path
605
+
PackerLockfile --path="/some/other/path.lua"
606
+
607
+
" Update plugins to the state defined in lockfile
608
+
PackerUpdate
609
+
610
+
" Updating without applying lockfile
611
+
PackerUpdate --nolockfile
612
+
613
+
" Updating a specific plugin without applying lockfile
614
+
PackerUpdate --nolockfile plenary.nvim
615
+
616
+
" Updating plugins and applying a specific lockfile
617
+
PackerUpdate --lockfile="/some/other/path.lua"
618
+
619
+
" Updating a specific plugin with a specific lockfile
The same options that apply to `PackerUpdate` also apply to `PackerInstall` and `PackerSync`.
512
550
513
551
USER AUTOCMDS *packer-user-autocmds*
514
552
`packer` runs most of its operations asyncronously. If you would like to
@@ -583,10 +621,6 @@ Additionally, the first argument can be a table specifying options,
583
621
such as `update({preview_updates = true}, ...)` to preview potential changes before updating
584
622
(same as `PackerUpdate --preview`).
585
623
586
-
upgrade() *packer.upgrade()*
587
-
`upgrade` performes an `update` without applying the `lockfile`. This will
588
-
update plugins to their latest versions.
589
-
590
624
snapshot(snapshot_name, ...) *packer.snapshot()*
591
625
`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.
592
626
Optionally plugins name can be specified so that only those plugins will be
0 commit comments