mirror of
https://github.com/kogakure/dotfiles.git
synced 2026-02-03 20:25:30 +00:00
feat(nvim): update configuration of obsidian.nvim
This commit is contained in:
@@ -2,10 +2,9 @@
|
||||
-- https://github.com/epwalsh/obsidian.nvim
|
||||
return {
|
||||
"epwalsh/obsidian.nvim",
|
||||
version = "*",
|
||||
lazy = true,
|
||||
event = {
|
||||
"BufReadPre " .. vim.fn.expand("~") .. "/Library/Mobile Documents/iCloud~md~obsidian/Documents/Zettelkasten/**.md",
|
||||
},
|
||||
ft = "markdown",
|
||||
dependencies = {
|
||||
-- required
|
||||
"nvim-lua/plenary.nvim",
|
||||
@@ -19,6 +18,57 @@ return {
|
||||
"preservim/vim-markdown",
|
||||
},
|
||||
opts = {
|
||||
dir = "~/Library/Mobile Documents/iCloud~md~obsidian/Documents/Zettelkasten", -- no need to call 'vim.fn.expand' here
|
||||
workspaces = {
|
||||
{
|
||||
name = "zettelkasten",
|
||||
path = "~/Library/Mobile Documents/iCloud~md~obsidian/Documents/Zettelkasten",
|
||||
overrides = {
|
||||
notes_subdir = "pages",
|
||||
},
|
||||
},
|
||||
{
|
||||
name = "highlights",
|
||||
path = "~/Library/Mobile Documents/iCloud~md~obsidian/Documents/Highlights",
|
||||
},
|
||||
},
|
||||
completion = {
|
||||
nvim_cmp = true,
|
||||
min_chars = 2,
|
||||
new_notes_location = "current_dir",
|
||||
prepend_note_id = true,
|
||||
preprend_note_path = false,
|
||||
use_path_only = false,
|
||||
},
|
||||
mappings = {
|
||||
-- Overrides the 'gf' mapping to work on markdown/wiki links within your vault.
|
||||
["gf"] = {
|
||||
action = function()
|
||||
return require("obsidian").util.gf_passthrough()
|
||||
end,
|
||||
opts = { noremap = false, expr = true, buffer = true },
|
||||
},
|
||||
-- Toggle check-boxes.
|
||||
["<leader>ch"] = {
|
||||
action = function()
|
||||
return require("obsidian").util.toggle_checkbox()
|
||||
end,
|
||||
opts = { buffer = true },
|
||||
},
|
||||
},
|
||||
disable_frontmatter = true,
|
||||
note_id_func = function(title)
|
||||
local suffix = ""
|
||||
if title ~= nil and title ~= "" then
|
||||
suffix = title
|
||||
else
|
||||
suffix = tostring(os.date("%Y%m%d%H%M"))
|
||||
end
|
||||
return suffix
|
||||
end,
|
||||
templates = {
|
||||
subdir = "templates",
|
||||
date_format = "%Y-%m-%d",
|
||||
time_format = "%H:%M",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user