Files
Nvim/lua/plugins/obsidian.lua

37 lines
895 B
Lua

return {
"epwalsh/obsidian.nvim",
version = "*",
lazy = true,
ft = "markdown",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-telescope/telescope.nvim",
"nvim-treesitter/nvim-treesitter",
},
opts = {
workspaces = {
{
name = "main",
path = "~/Notes", -- Update this to your vault's absolute path
},
},
-- Optional: Configure how new notes are named automatically
note_id_func = function(title)
local suffix = ""
if title ~= nil then
suffix = title:gsub(" ", "-"):gsub("[^A-Za-z0-9-]", ""):lower()
else
for _ = 1, 4 do suffix = suffix .. string.char(math.random(65, 90)) end
end
return tostring(os.time()) .. "-" .. suffix
end,
ui = {
enable = true,
},
completion = {
nvim_cmp = true, -- Set to true if using nvim-cmp
min_chars = 2,
},
}
}