chore: update README.md

main
olimorris 2022-08-14 23:09:12 +01:00
parent cbdde13408
commit 06023617d7
1 changed files with 15 additions and 15 deletions

View File

@ -22,7 +22,6 @@ Forked from <a href="https://github.com/folke/persistence.nvim">Persistence.nvim
- [Usage](#rocket-usage)
- [Default commands](#default-commands)
- [Telescope](#telescope)
- [Lazy loading](#lazy-loading)
- [Helpers](#helpers)
- [Configuration](#wrench-configuration)
- [Defaults](#defaults)
@ -81,20 +80,27 @@ lua << EOF
}
EOF
```
### Lazy loading
The plugin is designed to work with startup screens like [vim-startify](https://github.com/mhinz/vim-startify) or [dashboard](https://github.com/glepnir/dashboard-nvim) out of the box. It will never load a session automatically by default.
However, to lazy load the plugin add the `module = "persisted"` line to packer.
## :rocket: Usage
### Default commands
The plugin comes with a number of commands:
- `SessionToggle` - Determines whether to load, start or stop a session
- `SessionStart` - Start recording a session. Useful if `autosave = false`
- `SessionStop` - Stop recording a session
- `SessionSave` - Save the current session
- `SessionLoad` - Load the session for the current directory and current branch if `git_use_branch = true`
- `SessionLoadLast` - Load the last session
- `SessionDelete` - Delete the current session
- `:SessionToggle` - Determines whether to load, start or stop a session
- `:SessionStart` - Start recording a session. Useful if `autosave = false`
- `:SessionStop` - Stop recording a session
- `:SessionSave` - Save the current session
- `:SessionLoad` - Load the session for the current directory and current branch if `git_use_branch = true`
- `:SessionLoadLast` - Load the last session
- `:SessionDelete` - Delete the current session
> **Note:** The author only binds `SessionToggle` to a keymap for simplicity.
> **Note:** The author only binds `:SessionToggle` to a keymap for simplicity.
### Telescope
@ -104,12 +110,6 @@ Once opened, the available keymaps are:
* `<CR>` - Source the session file
* `<C-d>` - Delete the session file
### Lazy loading
The plugin is designed to work with startup screens like [vim-startify](https://github.com/mhinz/vim-startify) or [dashboard](https://github.com/glepnir/dashboard-nvim) out of the box. It will never load a session automatically by default.
However, to lazy load the plugin add the `module = "persisted"` line to packer.
### Helpers
The plugin sets a global variable, `vim.g.persisting`, which is set to `true` when a session is started. The author uses this to display an icon in their [statusline](https://github.com/olimorris/dotfiles/blob/0cdaee183c64f872778952f90f62b9366851101c/.config/nvim/lua/Oli/plugins/statusline.lua#L257).