vim.opt.conceallevel = 1 plugin({ "obsidian-nvim/obsidian.nvim", version = "*", -- recommended, use latest release instead of latest commit lazy = false, ft = "markdown", -- Replace the above line with this if you only want to load obsidian.nvim for markdown files in your vault: -- event = { -- -- If you want to use the home shortcut '~' here you need to call 'vim.fn.expand'. -- -- E.g. "BufReadPre " .. vim.fn.expand "~" .. "/my-vault/*.md" -- -- refer to `:h file-pattern` for more examples -- "BufReadPre path/to/my-vault/*.md", -- "BufNewFile path/to/my-vault/*.md", -- }, dependencies = { -- Required. "nvim-lua/plenary.nvim", -- see below for full list of optional dependencies 👇 }, opts = { legacy_commands = false, workspaces = { { name = "personal", path = "~/Documents/obsidian/Personal", }, { name = "Quikserve", path = "~/Documents/obsidian/Quikserve", }, { name = "Visage", path = "~/Documents/obsidian/Visage", }, }, notes_subdir = "notes", new_notes_location = "notes_subdir", note_id_func = function(title) -- Create note IDs in a Zettelkasten format with a timestamp and a suffix. -- In this case a note with the title 'My new note' will be given an ID that looks -- like '1657296016-my-new-note', and therefore the file name '1657296016-my-new-note.md'. -- You may have as many periods in the note ID as you'd like—the ".md" will be added automatically local suffix = "" if title ~= nil then -- If title is given, transform it into valid file name. suffix = title:gsub(" ", "-"):gsub("[^A-Za-z0-9-]", ""):lower() else -- If title is nil, just add 4 random uppercase letters to the suffix for _ = 1, 4 do suffix = suffix .. string.char(math.random(65, 90)) end end prefix = os.date("%Y%m%d%H%M") return tostring(prefix .. "-" .. suffix) end, daily_notes = { -- Optional, if you keep daily notes in a separate directory. folder = "dailies", -- Optional, if you want to change the date format for the ID of daily notes. date_format = "%Y-%m-%d", -- Optional, if you want to change the date format of the default alias of daily notes. alias_format = "%B %-d, %Y", -- Optional, default tags to add to each new daily note created. default_tags = { "daily-notes" }, -- Optional, if you want to automatically insert a template from your template directory like 'daily.md' template = "daily", }, templates = { folder = "templates", date_format = "%Y-%m-%d-%a", time_format = "%H:%M", }, completion = { blink = true, }, picker = { -- Set your preferred picker. Can be one of 'telescope.nvim', 'fzf-lua', or 'mini.pick'. name = "snacks.pick", -- Optional, configure key mappings for the picker. These are the defaults. -- Not all pickers support all mappings. note_mappings = { -- Create a new note from your query. new = "", -- Insert a link to the selected note. insert_link = "", }, tag_mappings = { -- Add tag(s) to current note. tag_note = "", -- Insert a tag at the current location. insert_tag = "", }, }, }, }) map("n", "ot", ":Obsidian today", { desc = "Today Note" }) map("n", "on", ":Obsidian new", { desc = "New Note" }) map("n", "oN", ":Obsidian new_from_template", { desc = "New From Template" }) map("n", "ow", ":Obsidian workspace", { desc = "Change Workspace" }) map("n", "oo", "::Obsidian quick_switch", { desc = "Find Note" }) map("n", "os", "!./sync.sh", { desc = "Sync" })