mirror of
https://github.com/m-housh/dotfiles.git
synced 2026-02-14 22:22:40 +00:00
feat: Adds better markdown support / plugins to nvim config.
This commit is contained in:
36
env/.config/nvim/after/ftplugin/markdown.lua
vendored
36
env/.config/nvim/after/ftplugin/markdown.lua
vendored
@@ -1,20 +1,20 @@
|
|||||||
-- Markdown specific key maps.
|
-- Markdown specific key maps.
|
||||||
--
|
--
|
||||||
local todos = require("todo-comments")
|
-- local todos = require("todo-comments")
|
||||||
local keywords = { "WARN", "WARNING", "IMPORTANT" }
|
-- local keywords = { "WARN", "WARNING", "IMPORTANT" }
|
||||||
|
--
|
||||||
-- Show all the warnings in the quick fix list.
|
-- -- Show all the warnings in the quick fix list.
|
||||||
vim.keymap.set(
|
-- vim.keymap.set(
|
||||||
"n",
|
-- "n",
|
||||||
"<leader>tw",
|
-- "<leader>tw",
|
||||||
"<CMD>Trouble todo toggle filter = {tag = {WARN, IMPORTANT}}<CR>",
|
-- "<CMD>Trouble todo toggle filter = {tag = {WARN, IMPORTANT}}<CR>",
|
||||||
{ desc = "[T]odo [W]arnings" }
|
-- { desc = "[T]odo [W]arnings" }
|
||||||
)
|
-- )
|
||||||
|
--
|
||||||
vim.keymap.set("n", "]w", function()
|
-- vim.keymap.set("n", "]w", function()
|
||||||
todos.jump_next({ keywords = keywords })
|
-- todos.jump_next({ keywords = keywords })
|
||||||
end, { desc = "Next [W]arning" })
|
-- end, { desc = "Next [W]arning" })
|
||||||
|
--
|
||||||
vim.keymap.set("n", "[w", function()
|
-- vim.keymap.set("n", "[w", function()
|
||||||
todos.jump_prev({ keywords = keywords })
|
-- todos.jump_prev({ keywords = keywords })
|
||||||
end, { desc = "Previous [W]arning" })
|
-- end, { desc = "Previous [W]arning" })
|
||||||
|
|||||||
47
env/.config/nvim/init.lua
vendored
47
env/.config/nvim/init.lua
vendored
@@ -25,9 +25,26 @@ vim.pack.add({
|
|||||||
{ src = "https://github.com/nvim-lua/plenary.nvim" },
|
{ src = "https://github.com/nvim-lua/plenary.nvim" },
|
||||||
{ src = "https://github.com/ThePrimeagen/harpoon", version = "harpoon2" },
|
{ src = "https://github.com/ThePrimeagen/harpoon", version = "harpoon2" },
|
||||||
{ src = "https://github.com/christoomey/vim-tmux-navigator" },
|
{ src = "https://github.com/christoomey/vim-tmux-navigator" },
|
||||||
|
{ src = "https://github.com/stevearc/conform.nvim" },
|
||||||
|
{ src = 'https://github.com/MeanderingProgrammer/render-markdown.nvim' },
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
require("mason").setup()
|
require("mason").setup({
|
||||||
|
ensure_installed = {
|
||||||
|
"bash-language-server",
|
||||||
|
"docker-language-server",
|
||||||
|
"hyprls",
|
||||||
|
"jq",
|
||||||
|
"lua-language-server",
|
||||||
|
"markdown-toc",
|
||||||
|
"markdownlint-cli2",
|
||||||
|
"marksman",
|
||||||
|
"prettier",
|
||||||
|
"shellcheck",
|
||||||
|
"tinymist",
|
||||||
|
}
|
||||||
|
})
|
||||||
require("mini.pick").setup()
|
require("mini.pick").setup()
|
||||||
require("oil").setup({
|
require("oil").setup({
|
||||||
view_options = {
|
view_options = {
|
||||||
@@ -42,6 +59,34 @@ require("oil").setup({
|
|||||||
end
|
end
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
require("conform").setup({
|
||||||
|
formatters = {
|
||||||
|
["markdown-toc"] = {
|
||||||
|
condition = function(_, ctx)
|
||||||
|
for _, line in ipairs(vim.api.nvim_buf_get_lines(ctx.buf, 0, -1, false)) do
|
||||||
|
if line:find("<!%-%- toc %-%->") then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
["markdownlint-cli2"] = {
|
||||||
|
condition = function(_, ctx)
|
||||||
|
local diag = vim.tbl_filter(function(d)
|
||||||
|
return d.source == "markdownlint"
|
||||||
|
end, vim.diagnostic.get(ctx.buf))
|
||||||
|
return #diag > 0
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
formatters_by_ft = {
|
||||||
|
["markdown"] = { "prettier", "markdownlint-cli2", "markdown-toc" },
|
||||||
|
["markdown.mdx"] = { "prettier", "markdownlint-cli2", "markdown-toc" },
|
||||||
|
lua = { "stulua" },
|
||||||
|
swift = { "swiftformat" },
|
||||||
|
},
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
require("harpoon").setup({ settings = { save_on_toggle = true, sync_on_ui_close = true } })
|
require("harpoon").setup({ settings = { save_on_toggle = true, sync_on_ui_close = true } })
|
||||||
|
|
||||||
-- Set color scheme
|
-- Set color scheme
|
||||||
|
|||||||
Reference in New Issue
Block a user