From 86a55a1d4c5338f9828ac28da8d02afafd331628 Mon Sep 17 00:00:00 2001 From: olimorris Date: Sat, 24 Feb 2024 12:05:57 +0000 Subject: [PATCH] docs: update README.md --- README.md | 25 ++++++++++++++++--------- doc/persisted.nvim.txt | 24 +++++++++++++++--------- 2 files changed, 31 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 6ce1237..cd2e3da 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,8 @@ Install the plugin with your preferred package manager: } ``` -> **Note**: The `lazy = true` option may be useful if you use a dashboard +> [!NOTE] +> The `lazy = true` option may be useful if you use a dashboard **[Packer](https://github.com/wbthomason/packer.nvim)** @@ -170,8 +171,8 @@ require("persisted").setup({ As the plugin uses Vim's `:mksession` command then you may change the `vim.o.sessionoptions` value to determine what to write into the session. Please see `:h sessionoptions` for more information. -> **Note**: The author uses: -> `vim.o.sessionoptions = "buffers,curdir,folds,tabpages,winpos,winsize"` +> [!NOTE] +> The author uses: `vim.o.sessionoptions = "buffers,curdir,folds,tabpages,winpos,winsize"` ### Session save location @@ -183,7 +184,8 @@ require("persisted").setup({ }) ``` -> **Note**: The plugin may be unable to find existing sessions if the `save_dir` value is changed +> [!NOTE] +> The plugin may be unable to find existing sessions if the `save_dir` value is changed ### Git branching @@ -223,7 +225,8 @@ require("persisted").setup({ Of course, if you wish to manually save the session when autosaving is disabled, the `:SessionSave` command can be used. -> **Note**: If `autosave = false` then the `should_autosave` callback will not be executed. +> [!TIP] +> If `autosave = false` then the `should_autosave` callback will not be executed. ### Autoloading @@ -248,7 +251,8 @@ require("persisted").setup({ Autoloading can be further controlled for certain directories by specifying `allowed_dirs` and `ignored_dirs`. -> **Note**: Autoloading will not occur if the plugin is lazy loaded or a user opens Neovim with arguments other than a single directory argument. For example: `nvim some_file.rb` will not result in autoloading but `nvim some/existing/path` or `nvim .` will. +> [!NOTE] +> Autoloading will not occur if the plugin is lazy loaded or a user opens Neovim with arguments other than a single directory argument. For example: `nvim some_file.rb` will not result in autoloading but `nvim some/existing/path` or `nvim .` will. ### Following current working directory @@ -262,7 +266,8 @@ require("persisted").setup({ }) ``` -> **Note**: If `follow_cwd = false` the session name is stored upon loading under the global variable `vim.g.persisting_session`. This variable can be manually adjusted if changes to the session name are needed. Alternatively, if `follow_cwd = true` then `vim.g.persisting_session = nil`. +> [!NOTE] +> If `follow_cwd = false` the session name is stored upon loading under the global variable `vim.g.persisting_session`. This variable can be manually adjusted if changes to the session name are needed. Alternatively, if `follow_cwd = true` then `vim.g.persisting_session = nil`. ### Allowed directories @@ -279,7 +284,8 @@ require("persisted").setup({ Specifying `~/Code` will autosave and autoload from that directory as well as all its sub-directories. -> **Note**: If `allowed_dirs` is left at its default value and `autosave` and/or `autoload` are set to `true`, then the plugin will autoload/autosave from _any_ directory +> [!NOTE] +> If `allowed_dirs` is left at its default value and `autosave` and/or `autoload` are set to `true`, then the plugin will autoload/autosave from _any_ directory ### Ignored directories @@ -373,7 +379,8 @@ vim.api.nvim_create_autocmd({ "User" }, { }) ``` -> **Note**: This data is available for the `PersistedLoad`, `PersistedDelete` and `PersistedTelescope` events +> [!NOTE] +> This data is available for the `PersistedLoad`, `PersistedDelete` and `PersistedTelescope` events ## :page_with_curl: License diff --git a/doc/persisted.nvim.txt b/doc/persisted.nvim.txt index ff81a2d..84c5d4d 100644 --- a/doc/persisted.nvim.txt +++ b/doc/persisted.nvim.txt @@ -12,6 +12,7 @@ Table of Contents *persisted.nvim-table-of-contents* FEATURES *persisted.nvim-features* + - Supports sessions across multiple git branches - Telescope extension to work with saved sessions - Custom events which users can hook into for tighter integration @@ -22,6 +23,7 @@ FEATURES *persisted.nvim-features* REQUIREMENTS *persisted.nvim-requirements* + - Neovim >= 0.8.0 @@ -40,7 +42,7 @@ Install the plugin with your preferred package manager: < - **Note**The `lazy = true` option may be useful if you use a dashboard + [!NOTE] The `lazy = true` option may be useful if you use a dashboard **Packer** >lua @@ -105,6 +107,7 @@ 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 @@ -120,6 +123,7 @@ TELESCOPE EXTENSION ~ The Telescope extension may be opened via `:Telescope persisted`. The available actions are: + - `` - Open/source the session file - `` - Add/update the git branch for the session file - `` - Copy the session file @@ -130,6 +134,7 @@ GLOBAL VARIABLES ~ The plugin sets a number of global variables throughout its lifecycle: + - `vim.g.persisting` - (bool) Determines if the plugin is active for the current session - `vim.g.persisted_exists` - (bool) Determines if a session exists for the current working directory - `vim.g.persisted_loaded_session` - (string) The file path to the current session @@ -166,10 +171,10 @@ WHAT IS SAVED IN THE SESSION? ~ As the plugin uses Vim’s `:mksession` command then you may change the `vim.o.sessionoptions` value to determine what to write into the session. -Please see |sessionoptions| for more information. +Please see `:h sessionoptions` for more information. - **Note**The author uses: `vim.o.sessionoptions = + [!NOTE] The author uses: `vim.o.sessionoptions = "buffers,curdir,folds,tabpages,winpos,winsize"` SESSION SAVE LOCATION ~ @@ -184,7 +189,7 @@ configuration option. For example: < - **Note**The plugin may be unable to find existing sessions if the `save_dir` + [!NOTE] The plugin may be unable to find existing sessions if the `save_dir` value is changed GIT BRANCHING ~ @@ -233,7 +238,7 @@ Of course, if you wish to manually save the session when autosaving is disabled, the `:SessionSave` command can be used. - **Note**If `autosave = false` then the `should_autosave` callback will not be + [!TIP] If `autosave = false` then the `should_autosave` callback will not be executed. AUTOLOADING ~ @@ -263,7 +268,7 @@ Autoloading can be further controlled for certain directories by specifying `allowed_dirs` and `ignored_dirs`. - **Note**Autoloading will not occur if the plugin is lazy loaded or a user opens + [!NOTE] Autoloading will not occur if the plugin is lazy loaded or a user opens Neovim with arguments other than a single directory argument. For example: `nvim some_file.rb` will not result in autoloading but `nvim some/existing/path` or `nvim .` will. @@ -283,7 +288,7 @@ By default, the session name will match the current working directory: < - **Note**If `follow_cwd = false` the session name is stored upon loading under + [!NOTE] If `follow_cwd = false` the session name is stored upon loading under the global variable `vim.g.persisting_session`. This variable can be manually adjusted if changes to the session name are needed. Alternatively, if `follow_cwd = true` then `vim.g.persisting_session = nil`. @@ -306,7 +311,7 @@ Specifying `~/Code` will autosave and autoload from that directory as well as all its sub-directories. - **Note**If `allowed_dirs` is left at its default value and `autosave` and/or + [!NOTE] If `allowed_dirs` is left at its default value and `autosave` and/or `autoload` are set to `true`, then the plugin will autoload/autosave from _any_ directory @@ -351,6 +356,7 @@ EVENTS / CALLBACKS ~ The plugin fires events at various points during its lifecycle: + - `PersistedLoadPre` - For _before_ a session is loaded - `PersistedLoadPost` - For _after_ a session is loaded - `PersistedTelescopeLoadPre` - For _before_ a session is loaded via Telescope @@ -415,7 +421,7 @@ To consume this data, use the `session.data` table in your autocmd: < - **Note**This data is available for the `PersistedLoad`, `PersistedDelete` and + [!NOTE] This data is available for the `PersistedLoad`, `PersistedDelete` and `PersistedTelescope` events LICENSE *persisted.nvim-license*