Skip to content

Commit

Permalink
docs: update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
olimorris committed Sep 13, 2024
1 parent 4672201 commit 3006e64
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,21 @@ vim.api.nvim_create_autocmd("User", {
})
```

Or, to ensure that certain filetypes are removed from the session before it's saved:

```lua
vim.api.nvim_create_autocmd("User", {
pattern = "PersistedSavePre",
callback = function()
for _, buf in ipairs(vim.api.nvim_list_bufs()) do
if vim.bo[buf].filetype == "codecompanion" then
vim.api.nvim_buf_delete(buf, { force = true })
end
end
end,
})
```

**Highlights**

The plugin also comes with pre-defined highlight groups for the Telescope implementation:
Expand Down
16 changes: 16 additions & 0 deletions doc/persisted.nvim.txt
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,22 @@ session, saving the current session before clearing all of the open buffers:
})
<

Or, to ensure that certain filetypes are removed from the session before it’s
saved:

>lua
vim.api.nvim_create_autocmd("User", {
pattern = "PersistedSavePre",
callback = function()
for _, buf in ipairs(vim.api.nvim_list_bufs()) do
if vim.bo[buf].filetype == "codecompanion" then
vim.api.nvim_buf_delete(buf, { force = true })
end
end
end,
})
<

**Highlights**

The plugin also comes with pre-defined highlight groups for the Telescope
Expand Down

0 comments on commit 3006e64

Please sign in to comment.