Files
nvim-modular/lua/kickstart/plugins/obsidian.lua
2025-08-24 20:10:59 +02:00

85 lines
2.9 KiB
Lua

-- obsidian
-- https://github.com/obsidian-nvim/obsidian.nvim
--
return {
'obsidian-nvim/obsidian.nvim',
version = '*', -- recommended, use latest release instead of latest commit
lazy = true,
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",
-- },
---@module 'obsidian'
---@type obsidian.config
opts = {
ui = {
enable = false,
},
legacy_commands = false,
workspaces = {
{
name = 'dane',
path = '~/Notes/dane',
strict = true,
},
{
name = 'travail',
path = '~/Notes/travail',
strict = true,
},
{
name = 'no-vault',
path = function()
-- alternatively use the CWD:
-- return assert(vim.fn.getcwd())
return assert(vim.fs.dirname(vim.api.nvim_buf_get_name(0)))
end,
overrides = {
notes_subdir = vim.NIL, -- have to use 'vim.NIL' instead of 'nil'
new_notes_location = 'current_dir',
templates = {
folder = vim.NIL,
},
disable_frontmatter = true,
},
},
},
daily_notes = {
-- Optional, if you keep daily notes in a separate directory.
folder = 'journal/daily',
-- 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 = nil,
-- Optional, if you want `Obsidian yesterday` to return the last work day or `Obsidian tomorrow` to return the next work day.
workdays_only = true,
},
-- Optional, for templates (see https://github.com/obsidian-nvim/obsidian.nvim/wiki/Using-templates)
templates = {
folder = '.templates',
date_format = '%Y%m%d',
time_format = '%H:%M:%s',
-- A map for custom variables, the key should be the variable and the value a function.
-- Functions are called with obsidian.TemplateContext objects as their sole parameter.
-- See: https://github.com/obsidian-nvim/obsidian.nvim/wiki/Template#substitutions
substitutions = {},
-- A map for configuring unique directories and paths for specific templates
--- See: https://github.com/obsidian-nvim/obsidian.nvim/wiki/Template#customizations
customizations = {},
},
},
}