From 1432d08d7107abe873c733c64493d69d90364a1d Mon Sep 17 00:00:00 2001 From: TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> Date: Fri, 6 Jun 2025 08:17:31 +0900 Subject: modified core/autocmds.lua, modified plugins/markdown.lua, modified plugins/sessions.lua, modified plugins/wiki.lua --- .../TheSiahxyz/lua/thesiahxyz/core/autocmds.lua | 6 +- .../TheSiahxyz/lua/thesiahxyz/plugins/markdown.lua | 120 ++++++++++----------- .../TheSiahxyz/lua/thesiahxyz/plugins/sessions.lua | 2 +- .../TheSiahxyz/lua/thesiahxyz/plugins/wiki.lua | 26 +++-- 4 files changed, 82 insertions(+), 72 deletions(-) diff --git a/ar/.config/TheSiahxyz/lua/thesiahxyz/core/autocmds.lua b/ar/.config/TheSiahxyz/lua/thesiahxyz/core/autocmds.lua index 7ba527f..861128c 100644 --- a/ar/.config/TheSiahxyz/lua/thesiahxyz/core/autocmds.lua +++ b/ar/.config/TheSiahxyz/lua/thesiahxyz/core/autocmds.lua @@ -290,8 +290,10 @@ vim.api.nvim_create_autocmd("BufWritePost", { local vimwiki_config = augroup("vimwiki_config") vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, { group = vimwiki_config, - pattern = vim.fn.expand("~/.local/share/vimwiki/index.md"), - command = "setfiletype vimwiki", + pattern = vim.fn.expand("~/.local/share/vimwiki") .. "/**/*.md", + callback = function(args) + vim.bo[args.buf].filetype = "vimwiki" + end, }) -- Run xrdb whenever Xdefaults or Xresources are updated. diff --git a/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/markdown.lua b/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/markdown.lua index cc9e8d8..d7e9db7 100644 --- a/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/markdown.lua +++ b/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/markdown.lua @@ -128,8 +128,7 @@ end return { { - "meanderingprogrammer/render-markdown.nvim", - enabled = true, + "MeanderingProgrammer/render-markdown.nvim", -- dependencies = { "nvim-treesitter/nvim-treesitter", "echasnovski/mini.nvim" }, -- if you use the mini.nvim suite dependencies = { "nvim-treesitter/nvim-treesitter", "echasnovski/mini.icons" }, -- if you use standalone mini plugins -- dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-tree/nvim-web-devicons' }, -- if you prefer nvim-web-devicons @@ -157,6 +156,7 @@ return { }, file_types = { "markdown", "vimwiki" }, heading = { + enabled = true, sign = false, icons = { "󰎤 ", "󰎧 ", "󰎪 ", "󰎭 ", "󰎱 ", "󰎳 " }, }, @@ -167,64 +167,64 @@ return { }) vim.treesitter.language.register("markdown", "vimwiki") end, - keys = { - { - "mrt", - function() - require("render-markdown").buf_toggle() - end, - desc = "Toggle render-markdown", - }, - { - "mre", - function() - require("render-markdown").buf_enable() - end, - desc = "Enable render-markdown", - }, - { - "mrx", - function() - require("render-markdown").buf_disable() - end, - desc = "Disable render-markdown", - }, - { - "mr+", - function() - require("render-markdown").expand() - end, - desc = "Expand conceal margin", - }, - { - "mr-", - function() - require("render-markdown").contract() - end, - desc = "Contract conceal margin", - }, - { - "mrl", - function() - require("render-markdown").log() - end, - desc = "Open render-markdown log", - }, - { - "mrc", - function() - require("render-markdown").config() - end, - desc = "Show render-markdown config diff", - }, - { - "mrd", - function() - require("render-markdown").debug() - end, - desc = "Debug render-markdown marks", - }, - }, + -- keys = { + -- { + -- "mrt", + -- function() + -- require("render-markdown").buf_toggle() + -- end, + -- desc = "Toggle render-markdown", + -- }, + -- { + -- "mre", + -- function() + -- require("render-markdown").buf_enable() + -- end, + -- desc = "Enable render-markdown", + -- }, + -- { + -- "mrx", + -- function() + -- require("render-markdown").buf_disable() + -- end, + -- desc = "Disable render-markdown", + -- }, + -- { + -- "mr+", + -- function() + -- require("render-markdown").expand() + -- end, + -- desc = "Expand conceal margin", + -- }, + -- { + -- "mr-", + -- function() + -- require("render-markdown").contract() + -- end, + -- desc = "Contract conceal margin", + -- }, + -- { + -- "mrl", + -- function() + -- require("render-markdown").log() + -- end, + -- desc = "Open render-markdown log", + -- }, + -- { + -- "mrc", + -- function() + -- require("render-markdown").config() + -- end, + -- desc = "Show render-markdown config diff", + -- }, + -- { + -- "mrd", + -- function() + -- require("render-markdown").debug() + -- end, + -- desc = "Debug render-markdown marks", + -- }, + -- }, }, { -- Install markdown preview, use npx if available. diff --git a/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/sessions.lua b/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/sessions.lua index ab55441..2126196 100644 --- a/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/sessions.lua +++ b/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/sessions.lua @@ -53,7 +53,7 @@ return { keys = { { "fs", "SessionSearch", desc = "Session search" }, { "ws", "SessionSave", desc = "Save session" }, - { "wd", "SessionDisableAutoSave", desc = "Disable autosave" }, + { "wx", "SessionDisableAutoSave", desc = "Disable autosave" }, { "wp", "SessionPurgeOrphaned", desc = "Purge autosave" }, { "wa", "SessionToggleAutoSave", desc = "Toggle autosave" }, }, diff --git a/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/wiki.lua b/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/wiki.lua index f244171..83213ba 100644 --- a/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/wiki.lua +++ b/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/wiki.lua @@ -9,23 +9,31 @@ return { { "w", group = "Diary" }, }) - -- Ensure files are read with the desired filetype - vim.g.vimwiki_ext2syntax = { - [".Rmd"] = "markdown", - [".rmd"] = "markdown", - [".md"] = "markdown", - [".markdown"] = "markdown", - [".mdown"] = "markdown", - } - -- Set up Vimwiki list vim.g.vimwiki_list = { { path = vim.fn.expand("~/.local/share/vimwiki"), + template_path = vim.fn.expand("~/.local/share/vimwiki/templates"), + auto_toc = 1, syntax = "markdown", + nested_syntaxes = { + python = "python", + ["c++"] = "cpp", + }, ext = ".md", }, } + + vim.g.vimwiki_global_ext = 1 + + -- Ensure files are read with the desired filetype + vim.g.vimwiki_ext2syntax = { + [".Rmd"] = "markdown", + [".rmd"] = "markdown", + [".md"] = "markdown", + [".markdown"] = "markdown", + [".mdown"] = "markdown", + } end, keys = { { "ww", ":VimwikiIndex", desc = "Vimwiki index" }, -- cgit v1.2.3