Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion doc/zpack.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1175,7 +1175,30 @@ To fix this, add a route that explicitly shows `vim.pack` messages:
<

------------------------------------------------------------------------------
11.4 NATIVE VIM.PACK COMMANDS *zpack-native-commands*
11.4 LOCKFILE LOCATION *zpack-lockfile*

`vim.pack` writes its lockfile to `$XDG_CONFIG_HOME/nvim/nvim-pack-lock.json`
— i.e. next to your `init.lua`. On Neovim 0.13+ the path is configurable
through the |'packlockfile'| option, so you can keep it out of your config
repo:
>lua
vim.o.packlockfile =
vim.fs.joinpath(vim.fn.stdpath('data'), 'nvim-pack-lock.json')
<
Two caveats:
- 'packlockfile' must be set before the first |vim.pack| call, which in
practice means before the `vim.pack.add()` that installs zpack itself —
put it at the very top of your `init.lua`.
- Changing the path does not move the existing file. Move (or delete and
regenerate with `:ZPack update`) the old lockfile, otherwise `vim.pack`
starts from an empty one.

zpack needs no configuration for this — it delegates to `vim.pack` for
lockfile reads and writes, so `:ZPack update` and `:ZPack restore` follow
whatever 'packlockfile' points at.

------------------------------------------------------------------------------
11.5 NATIVE VIM.PACK COMMANDS *zpack-native-commands*

On Neovim 0.13+, several `:ZPack` subcommands map to native `vim.pack`
commands (`:packupdate`, `:packdel`) that can be used interchangeably; zpack
Expand Down
14 changes: 14 additions & 0 deletions docs/tips.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,20 @@ require('noice').setup({
})
```

## Lockfile location

`vim.pack` writes its lockfile to `$XDG_CONFIG_HOME/nvim/nvim-pack-lock.json` — i.e. next to your `init.lua`. On Neovim 0.13+ the path is configurable through the `'packlockfile'` option (see `:h 'packlockfile'`), so you can keep it out of your config repo:

```lua
vim.o.packlockfile = vim.fs.joinpath(vim.fn.stdpath('data'), 'nvim-pack-lock.json')
```

Two caveats:
- `'packlockfile'` must be set **before the first `vim.pack` call**, which in practice means before the `vim.pack.add()` that installs zpack itself — put it at the very top of your `init.lua`.
- Changing the path does not move the existing file. Move (or delete and regenerate with `:ZPack update`) the old lockfile, otherwise `vim.pack` starts from an empty one.

zpack needs no configuration for this — it delegates to `vim.pack` for lockfile reads and writes, so `:ZPack update` and `:ZPack restore` follow whatever `'packlockfile'` points at.

## Native vim.pack commands

On Neovim 0.13+, the `:ZPack update`, `restore`, and `delete` subcommands have native `vim.pack` command equivalents (`:packupdate`, `:packupdate ++lockfile`, `:packdel`). Use whichever you prefer — zpack keeps its session state in sync either way. See `:h zpack-native-commands` for the full mapping.
Loading