diff --git a/lua/plugins/obsidian.lua b/lua/plugins/obsidian.lua new file mode 100644 index 0000000..32d0ac9 --- /dev/null +++ b/lua/plugins/obsidian.lua @@ -0,0 +1,36 @@ +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, + }, + } +}