Skip to content

Commit f96ec5a

Browse files
committed
docs: update the statusline section, move disabling section to bottom
1 parent 147c53f commit f96ec5a

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

README.md

+20-20
Original file line numberDiff line numberDiff line change
@@ -363,23 +363,6 @@ Another possibility is to only save the session if there are at least two window
363363

364364
```
365365

366-
## Disabling the plugin
367-
368-
You might run into issues with Firenvim or another plugin and want to disable `auto_session` altogether based on some condition.
369-
For this example, as to not try and save sessions for Firenvim, we disable the plugin if the `started_by_firenvim` variable is set.
370-
371-
```viml
372-
if exists('g:started_by_firenvim')
373-
let g:auto_session_enabled = v:false
374-
endif
375-
```
376-
377-
One can also disable the plugin by setting the `auto_session_enabled` option to false at startup.
378-
379-
```sh
380-
nvim "+let g:auto_session_enabled = v:false"
381-
```
382-
383366
## 🔭 Session Lens
384367

385368
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
427410

428411
<img src="https://github.com/rmagatti/readme-assets/blob/main/session-lens.gif" width=800 />
429412

430-
### Statusline
413+
## Statusline
431414

432-
One can show the current session name in the statusline by using an AutoSession helper function.
415+
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)`.
433416

434-
Lualine example config and how it looks
417+
Here's an example using [Lualine](https://github.com/nvim-lualine/lualine.nvim):
435418

436419
```lua
437420
require('lualine').setup{
@@ -450,6 +433,23 @@ require('lualine').setup{
450433

451434
<img width="1904" alt="Screen Shot 2021-10-30 at 3 58 57 PM" src="https://user-images.githubusercontent.com/2881382/139559478-8edefdb8-8254-42e7-a0f3-babd3dfd6ff2.png">
452435

436+
## Disabling the plugin
437+
438+
You might run into issues with Firenvim or another plugin and want to disable `auto_session` altogether based on some condition.
439+
For this example, as to not try and save sessions for Firenvim, we disable the plugin if the `started_by_firenvim` variable is set.
440+
441+
```viml
442+
if exists('g:started_by_firenvim')
443+
let g:auto_session_enabled = v:false
444+
endif
445+
```
446+
447+
One can also disable the plugin by setting the `auto_session_enabled` option to false at startup.
448+
449+
```sh
450+
nvim "+let g:auto_session_enabled = v:false"
451+
```
452+
453453
## 🚧 Troubleshooting
454454

455455
For troubleshooting refer to the [wiki page](https://github.com/rmagatti/auto-session/wiki/Troubleshooting).

0 commit comments

Comments
 (0)