From f96ec5a231fe4d6e004059448bb6d65b150378ff Mon Sep 17 00:00:00 2001 From: Cameron Ring Date: Thu, 1 Aug 2024 19:22:23 -0700 Subject: [PATCH] docs: update the statusline section, move disabling section to bottom --- README.md | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index ba1565c..13e2b42 100644 --- a/README.md +++ b/README.md @@ -363,23 +363,6 @@ Another possibility is to only save the session if there are at least two window ``` -## Disabling the plugin - -You might run into issues with Firenvim or another plugin and want to disable `auto_session` altogether based on some condition. -For this example, as to not try and save sessions for Firenvim, we disable the plugin if the `started_by_firenvim` variable is set. - -```viml -if exists('g:started_by_firenvim') - let g:auto_session_enabled = v:false -endif -``` - -One can also disable the plugin by setting the `auto_session_enabled` option to false at startup. - -```sh -nvim "+let g:auto_session_enabled = v:false" -``` - ## 🔭 Session Lens You can use Telescope to see, load, and delete your sessions. It's enabled by default if you have Telescope, but here's the Lazy config that shows the configuration options: @@ -427,11 +410,11 @@ NOTE: If you previously installed `rmagatti/session-lens`, you should remove it -### Statusline +## Statusline -One can show the current session name in the statusline by using an AutoSession helper function. +You can show the current session name in the statusline by using the function `current_session_name()`. With no arguments, it will return the full session name. For automatically created sessions that will be the path where the session was saved. If you only want the last directory in the path, you can call `current_session_name(true)`. -Lualine example config and how it looks +Here's an example using [Lualine](https://github.com/nvim-lualine/lualine.nvim): ```lua require('lualine').setup{ @@ -450,6 +433,23 @@ require('lualine').setup{ Screen Shot 2021-10-30 at 3 58 57 PM +## Disabling the plugin + +You might run into issues with Firenvim or another plugin and want to disable `auto_session` altogether based on some condition. +For this example, as to not try and save sessions for Firenvim, we disable the plugin if the `started_by_firenvim` variable is set. + +```viml +if exists('g:started_by_firenvim') + let g:auto_session_enabled = v:false +endif +``` + +One can also disable the plugin by setting the `auto_session_enabled` option to false at startup. + +```sh +nvim "+let g:auto_session_enabled = v:false" +``` + ## 🚧 Troubleshooting For troubleshooting refer to the [wiki page](https://github.com/rmagatti/auto-session/wiki/Troubleshooting).