Skip to content

Commit d0d29df

Browse files
committed
recipes: show nvdash when all buffers are closed
1 parent 7518f65 commit d0d29df

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/routes/docs/recipes.mdx

+15
Original file line numberDiff line numberDiff line change
@@ -100,3 +100,18 @@ vim.g.clipboard = {
100100
cache_enabled = 0,
101101
}
102102
```
103+
104+
## Show Nvdash when all buffers are closed
105+
106+
- You can use nvim_list_bufs() too but vim.t.bufs has only listed bufs
107+
108+
```lua
109+
vim.api.nvim_create_autocmd("BufDelete", {
110+
callback = function()
111+
local bufs = vim.t.bufs
112+
if #bufs == 1 and vim.api.nvim_buf_get_name(bufs[1]) == "" then
113+
vim.cmd "Nvdash"
114+
end
115+
end,
116+
})
117+
```

0 commit comments

Comments
 (0)