···11-21return {
33--- "epwalsh/obsidian.nvim",
44--- event = "VeryLazy", --using neovim with the Obsidian vault
55--- config = function()
66--- require("obsidian").setup({
77--- dir = "$HOME/Simon/Sync/SecondBrain",
88--- completion = {
99--- nvim_cmp = true, -- if using nvim-cmp, otherwise set to false
1010--- }
1111--- })
1212--- end
22+ "epwalsh/obsidian.nvim",
33+ version = "*", -- recommended, use latest release instead of latest commit
44+ lazy = true,
55+ ft = "markdown",
66+ -- Replace the above line with this if you only want to load obsidian.nvim for markdown files in your vault:
77+ -- event = {
88+ -- -- If you want to use the home shortcut '~' here you need to call 'vim.fn.expand'.
99+ -- -- E.g. "BufReadPre " .. vim.fn.expand "~" .. "/my-vault/**.md"
1010+ -- "BufReadPre path/to/my-vault/**.md",
1111+ -- "BufNewFile path/to/my-vault/**.md",
1212+ -- },
1313+ dependencies = {
1414+ -- Required.
1515+ "nvim-lua/plenary.nvim",
1616+1717+ -- see below for full list of optional dependencies 👇
1818+ },
1919+ opts = {
2020+ workspaces = {
2121+ {
2222+ name = "personal",
2323+ path = "~/Simon/Sync/SecondBrain",
2424+ }
2525+ -- {
2626+ -- name = "work",
2727+ -- path = "~/vaults/work",
2828+ -- },
2929+ },
3030+ templates = {
3131+ --TODO: create dedicated templates for neovim with {date} placeholder instead of Templator syntax
3232+ folder = "💡 Resources/🛠 Templates/Markdown/",
3333+ date_format = "%Y-%m-%d-%a",
3434+ time_format = "%H:%M",
3535+ },
3636+3737+ -- Optional, alternatively you can customize the frontmatter data.
3838+ ---@return table
3939+ note_frontmatter_func = function(note)
4040+ -- Add the title of the note as an alias.
4141+ if note.title then
4242+ note:add_alias(note.title)
4343+ end
4444+4545+ --remove default id, aliases and tags: { id = note.id, aliases = note.aliases, tags = note.tags }
4646+ local out = { }
4747+4848+ -- `note.metadata` contains any manually added fields in the frontmatter.
4949+ -- So here we just make sure those fields are kept in the frontmatter.
5050+ if note.metadata ~= nil and not vim.tbl_isempty(note.metadata) then
5151+ for k, v in pairs(note.metadata) do
5252+ out[k] = v
5353+ end
5454+ end
5555+5656+ return out
5757+ end,
5858+ },
1359}