chezmoi: reorganise repo

This commit is contained in:
js0ny 2025-09-27 15:28:09 +01:00
parent b391e03c87
commit 67a78879db
278 changed files with 102 additions and 182 deletions

View file

@ -0,0 +1,6 @@
return {
{ import = "plugins.lang.markdown.render-markdown" },
-- { import = "plugins.mod.lang.markdown.markview" },
{ import = "plugins.lang.markdown.obsidian-nvim" },
{ "bullets-vim/bullets.vim", ft = "markdown" },
}

View file

@ -0,0 +1,29 @@
-- This won't be loaded
-- I keep this since render-markdown sometimes buggy
return {
{
"OXY2DEV/markview.nvim",
lazy = false,
dependencies = {
"nvim-treesitter/nvim-treesitter",
"nvim-tree/nvim-web-devicons",
},
opts = {
checkboxes = require("markview-presets").checkboxes.nerd,
headings = {
enable = true,
shift_width = 1,
heading_1 = {
style = "label",
hl = "MarkviewH1",
},
},
code_blocks = {
style = "language",
language_direction = "right",
hl = "MarkviewCode",
info_hl = "MarkviewCodeInfo",
},
},
},
}

View file

@ -0,0 +1,145 @@
local uuid = function()
local template = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'
return string.gsub(template, '[xy]', function(c)
local v = (c == 'x') and math.random(0, 0xf) or math.random(8, 0xb)
return string.format('%x', v)
end)
end
return {
"obsidian-nvim/obsidian.nvim",
version = "*", -- recommended, use latest release instead of latest commit
-- lazy = false,
ft = "markdown",
cmd = {
"ObsidianNewFromTemplate",
"ObsidianToggleCheckbox",
"ObsidianQuickSwitch",
"ObsidianExtractNote",
"ObsidianFollowLink",
"ObsidianBacklinks",
"ObsidianWorkspace",
"ObsidianYesterday",
"ObsidianPasteImg",
"ObsidianTomorrow",
"ObsidianTemplate",
"ObsidianDailies",
"ObsidianLinkNew",
"ObsidianRename",
"ObsidianSearch",
"ObsidianCheck",
"ObsidianLinks",
"ObsidianToday",
"ObsidianDebug",
"ObsidianOpen",
"ObsidianTags",
"ObsidianLink",
"ObsidianNew",
"ObsidianTOC",
},
-- 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",
-- },
keys = {
{ "<leader>fo", "<cmd>ObsidianQuickSwitch<CR>", desc = "Obsidian: Quick Switch" },
},
dependencies = {
-- Required.
"nvim-lua/plenary.nvim",
-- see below for full list of optional dependencies 👇
"ibhagwan/fzf-lua",
},
opts = {
workspaces = {
{
name = "personal",
path = "~/Obsidian",
},
},
completion = {
nvim_cmp = false,
blink = true,
min_chars = 2,
},
ui = {
enable = false,
},
templates = {
folder = "_Global/LuaTemplates",
date_format = "%Y-%m-%d",
time_format = "%H:%M",
substitutions = {
yesterday = function()
return os.date("%Y-%m-%d", os.time() - 86400)
end,
uuid = uuid()
},
},
---@return table
note_frontmatter_func = function(note)
-- Add the title of the note as an alias.
if note.title then
note:add_alias(note.title)
end
-- Force to use UUID as the note id.
local note_id
if note.metadata then
note_id = note.id
else
note_id = uuid()
end
local out = {
id = note_id,
aliases = note.aliases,
tags = note.tags,
title = note.id,
date = os.date(
"%Y-%m-%dT00:00:00"),
}
-- `note.metadata` contains any manually added fields in the frontmatter.
-- So here we just make sure those fields are kept in the frontmatter.
if note.metadata ~= nil and not vim.tbl_isempty(note.metadata) then
for k, v in pairs(note.metadata) do
out[k] = v
end
end
-- Force to update mtime.
out.mtime = os.date("%Y-%m-%dT%H:%M:%S")
return out
end,
daily_notes = {
folder = "_Global/Periodic",
date_format = "%Y-%m-%d",
default_tags = { "daily" },
template = nil,
},
-- see below for full list of options 👇
attachments = {
img_folder = "_Global/Assets",
img_name_func = function()
return string.format("%s-", os.time())
end,
},
mappings = {
["<cr>"] = {
action = function()
require("obsidian").util.smart_action()
end,
opts = { buffer = true, expr = true },
},
},
new_notes_location = "current_dir",
},
}

View file

@ -0,0 +1,74 @@
return {
{
"MeanderingProgrammer/render-markdown.nvim",
event = "BufRead",
ft = { "markdown", "Avante" },
opts = {
file_types = { "markdown", "Avante" },
render_modes = { "n", "c", "t" },
latex = {
-- enabled = true,
enabled = false,
converter = "latex2text",
highlight = "RenderMarkdownMath",
top_pad = 0,
bottom_pad = 0,
},
-- heading = {
-- position = "overlay",
-- width = "block",
-- left_margin = 0.5,
-- left_pad = 0.2,
-- right_pad = 0.2,
-- },
link = {
custom = {
python = { pattern = "%.py", icon = "" },
lua = { pattern = "%.lua", icon = "" },
markdown = { pattern = "%.md", icon = "" },
},
},
bullet = {
icons = { "󰮯 ", "", "", "", "" },
},
checkbox = {
checked = { scope_highlight = "@markup.strikethrough" },
unchecked = { scope_highlight = "@comment.todo" },
},
code = {
position = "right",
width = "block",
right_pad = 10,
},
callout = {
note = { raw = "[!NOTE]", rendered = "󰋽 Note", highlight = "RenderMarkdownInfo" },
tip = { raw = "[!TIP]", rendered = "󰌶 Tip", highlight = "RenderMarkdownSuccess" },
important = { raw = "[!IMPORTANT]", rendered = "󰅾 Important", highlight = "RenderMarkdownHint" },
warning = { raw = "[!WARNING]", rendered = "󰀪 Warning", highlight = "RenderMarkdownWarn" },
caution = { raw = "[!CAUTION]", rendered = "󰳦 Caution", highlight = "RenderMarkdownError" },
abstract = { raw = "[!ABSTRACT]", rendered = "󰨸 Abstract", highlight = "RenderMarkdownInfo" },
summary = { raw = "[!SUMMARY]", rendered = "󰨸 Summary", highlight = "RenderMarkdownInfo" },
tldr = { raw = "[!TLDR]", rendered = "󰨸 Tldr", highlight = "RenderMarkdownInfo" },
info = { raw = "[!INFO]", rendered = "󰋽 Info", highlight = "RenderMarkdownInfo" },
todo = { raw = "[!TODO]", rendered = "󰗡 Todo", highlight = "RenderMarkdownInfo" },
hint = { raw = "[!HINT]", rendered = "󰌶 Hint", highlight = "RenderMarkdownSuccess" },
success = { raw = "[!SUCCESS]", rendered = "󰄬 Success", highlight = "RenderMarkdownSuccess" },
check = { raw = "[!CHECK]", rendered = "󰄬 Check", highlight = "RenderMarkdownSuccess" },
done = { raw = "[!DONE]", rendered = "󰄬 Done", highlight = "RenderMarkdownSuccess" },
question = { raw = "[!QUESTION]", rendered = "󰘥 Question", highlight = "RenderMarkdownWarn" },
help = { raw = "[!HELP]", rendered = "󰘥 Help", highlight = "RenderMarkdownWarn" },
faq = { raw = "[!FAQ]", rendered = "󰘥 Faq", highlight = "RenderMarkdownWarn" },
attention = { raw = "[!ATTENTION]", rendered = "󰀪 Attention", highlight = "RenderMarkdownWarn" },
failure = { raw = "[!FAILURE]", rendered = "󰅖 Failure", highlight = "RenderMarkdownError" },
fail = { raw = "[!FAIL]", rendered = "󰅖 Fail", highlight = "RenderMarkdownError" },
missing = { raw = "[!MISSING]", rendered = "󰅖 Missing", highlight = "RenderMarkdownError" },
danger = { raw = "[!DANGER]", rendered = "󱐌 Danger", highlight = "RenderMarkdownError" },
error = { raw = "[!ERROR]", rendered = "󱐌 Error", highlight = "RenderMarkdownError" },
bug = { raw = "[!BUG]", rendered = "󰨰 Bug", highlight = "RenderMarkdownError" },
example = { raw = "[!EXAMPLE]", rendered = "󰉹 Example", highlight = "RenderMarkdownHint" },
quote = { raw = "[!QUOTE]", rendered = "󱆨 Quote", highlight = "RenderMarkdownQuote" },
cite = { raw = "[!CITE]", rendered = "󱆨 Cite", highlight = "RenderMarkdownQuote" },
},
},
},
}