Skip to content

Commit 6e65b0a

Browse files
committed
feat(nvim): add shada utility file
1 parent 26c0db9 commit 6e65b0a

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

.config/nvim/lua/user/shada.lua

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
local function set_shada_file()
2+
local git_root = require('snacks').git.get_root()
3+
local dir = git_root ~= nil and git_root or vim.fn.getcwd()
4+
5+
local shada_file = vim.fs.joinpath(
6+
vim.fn.stdpath('state'),
7+
'shada',
8+
vim.fn.fnamemodify(dir, ':t') .. '.shada'
9+
)
10+
vim.o.shadafile = shada_file
11+
end
12+
13+
return { set_shada_file = set_shada_file }

0 commit comments

Comments
 (0)