mirror of
https://github.com/kogakure/dotfiles.git
synced 2026-02-03 12:15:29 +00:00
feat(markdownlint): install and configure Markdownlint
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
"lazyvim.plugins.extras.editor.aerial",
|
||||
"lazyvim.plugins.extras.formatting.prettier",
|
||||
"lazyvim.plugins.extras.lang.go",
|
||||
"lazyvim.plugins.extras.lang.markdown",
|
||||
"lazyvim.plugins.extras.lang.tailwind",
|
||||
"lazyvim.plugins.extras.lang.yaml"
|
||||
],
|
||||
|
||||
@@ -11,57 +11,58 @@ vim.cmd([[command! -nargs=0 GoToCommand :Telescope commands]])
|
||||
vim.cmd([[command! -nargs=0 Grep :Telescope live_grep]])
|
||||
|
||||
require("lazy").setup({
|
||||
spec = {
|
||||
-- add LazyVim and import its plugins
|
||||
{ "LazyVim/LazyVim", import = "lazyvim.plugins" },
|
||||
-- import any extras modules here
|
||||
{ import = "lazyvim.plugins.extras.coding.codeium" },
|
||||
{ import = "lazyvim.plugins.extras.coding.copilot" },
|
||||
{ import = "lazyvim.plugins.extras.coding.mini-surround" },
|
||||
{ import = "lazyvim.plugins.extras.dap.core" },
|
||||
{ import = "lazyvim.plugins.extras.editor.aerial" },
|
||||
{ import = "lazyvim.plugins.extras.editor.harpoon2" },
|
||||
{ import = "lazyvim.plugins.extras.formatting.prettier" },
|
||||
{ import = "lazyvim.plugins.extras.lang.go" },
|
||||
{ import = "lazyvim.plugins.extras.lang.json" },
|
||||
{ import = "lazyvim.plugins.extras.lang.ruby" },
|
||||
{ import = "lazyvim.plugins.extras.lang.tailwind" },
|
||||
{ import = "lazyvim.plugins.extras.lang.typescript" },
|
||||
{ import = "lazyvim.plugins.extras.lang.yaml" },
|
||||
{ import = "lazyvim.plugins.extras.linting.eslint" },
|
||||
{ import = "lazyvim.plugins.extras.test.core" },
|
||||
{ import = "lazyvim.plugins.extras.ui.mini-animate" },
|
||||
-- import/override with your plugins
|
||||
{ import = "plugins" },
|
||||
},
|
||||
defaults = {
|
||||
-- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup.
|
||||
-- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default.
|
||||
lazy = false,
|
||||
-- It's recommended to leave version=false for now, since a lot the plugin that support versioning,
|
||||
-- have outdated releases, which may break your Neovim install.
|
||||
version = false, -- always use the latest git commit
|
||||
-- version = "*", -- try installing the latest stable version for plugins that support semver
|
||||
},
|
||||
install = { colorscheme = { "tokyonight", "habamax" } },
|
||||
checker = {
|
||||
enabled = true,
|
||||
notify = false,
|
||||
frequency = 86400,
|
||||
},
|
||||
performance = {
|
||||
rtp = {
|
||||
-- disable some rtp plugins
|
||||
disabled_plugins = {
|
||||
"gzip",
|
||||
-- "matchit",
|
||||
-- "matchparen",
|
||||
-- "netrwPlugin",
|
||||
"tarPlugin",
|
||||
"tohtml",
|
||||
"tutor",
|
||||
"zipPlugin",
|
||||
},
|
||||
},
|
||||
},
|
||||
spec = {
|
||||
-- add LazyVim and import its plugins
|
||||
{ "LazyVim/LazyVim", import = "lazyvim.plugins" },
|
||||
-- import any extras modules here
|
||||
{ import = "lazyvim.plugins.extras.coding.codeium" },
|
||||
{ import = "lazyvim.plugins.extras.coding.copilot" },
|
||||
{ import = "lazyvim.plugins.extras.coding.mini-surround" },
|
||||
{ import = "lazyvim.plugins.extras.dap.core" },
|
||||
{ import = "lazyvim.plugins.extras.editor.aerial" },
|
||||
{ import = "lazyvim.plugins.extras.editor.harpoon2" },
|
||||
{ import = "lazyvim.plugins.extras.formatting.prettier" },
|
||||
{ import = "lazyvim.plugins.extras.lang.go" },
|
||||
{ import = "lazyvim.plugins.extras.lang.json" },
|
||||
{ import = "lazyvim.plugins.extras.lang.markdown" },
|
||||
{ import = "lazyvim.plugins.extras.lang.ruby" },
|
||||
{ import = "lazyvim.plugins.extras.lang.tailwind" },
|
||||
{ import = "lazyvim.plugins.extras.lang.typescript" },
|
||||
{ import = "lazyvim.plugins.extras.lang.yaml" },
|
||||
{ import = "lazyvim.plugins.extras.linting.eslint" },
|
||||
{ import = "lazyvim.plugins.extras.test.core" },
|
||||
{ import = "lazyvim.plugins.extras.ui.mini-animate" },
|
||||
-- import/override with your plugins
|
||||
{ import = "plugins" },
|
||||
},
|
||||
defaults = {
|
||||
-- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup.
|
||||
-- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default.
|
||||
lazy = false,
|
||||
-- It's recommended to leave version=false for now, since a lot the plugin that support versioning,
|
||||
-- have outdated releases, which may break your Neovim install.
|
||||
version = false, -- always use the latest git commit
|
||||
-- version = "*", -- try installing the latest stable version for plugins that support semver
|
||||
},
|
||||
install = { colorscheme = { "tokyonight", "habamax" } },
|
||||
checker = {
|
||||
enabled = true,
|
||||
notify = false,
|
||||
frequency = 86400,
|
||||
},
|
||||
performance = {
|
||||
rtp = {
|
||||
-- disable some rtp plugins
|
||||
disabled_plugins = {
|
||||
"gzip",
|
||||
-- "matchit",
|
||||
-- "matchparen",
|
||||
-- "netrwPlugin",
|
||||
"tarPlugin",
|
||||
"tohtml",
|
||||
"tutor",
|
||||
"zipPlugin",
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
@@ -1,56 +1,74 @@
|
||||
-- Lightweight yet powerful formatter plugin for Neovim
|
||||
-- https://github.com/stevearc/conform.nvim
|
||||
return {
|
||||
"stevearc/conform.nvim",
|
||||
event = { "BufWritePre", "BufNewFile" },
|
||||
keys = {
|
||||
{
|
||||
"<leader>mp",
|
||||
mode = { "n", "v" },
|
||||
function()
|
||||
require("conform").format({
|
||||
lsp_fallback = true,
|
||||
async = false,
|
||||
timeout_ms = 500,
|
||||
})
|
||||
end,
|
||||
desc = "Format file or range (in visual mode)",
|
||||
},
|
||||
},
|
||||
opts = {
|
||||
formatters = {
|
||||
eslint_d = {
|
||||
command = "eslint_d",
|
||||
args = { "--fix-to-stdout", "--stdin", "--stdin-filename", "$FILENAME" },
|
||||
stdin = true,
|
||||
},
|
||||
nixpkgs_fmt = {
|
||||
command = "nixpkgs-fmt",
|
||||
},
|
||||
},
|
||||
formatters_by_ft = {
|
||||
-- ["*"] = { "codespell" },
|
||||
["_"] = { "trim_whitespace" },
|
||||
astro = { { "prettierd", "prettier" } },
|
||||
css = { { "prettierd", "prettier" }, "stylelint" },
|
||||
fish = { "fish_indent" },
|
||||
go = { "goimports", "gofumpt" },
|
||||
graphql = { { "prettierd", "prettier" } },
|
||||
html = { { "prettierd", "prettier" } },
|
||||
javascript = { { "prettierd", "prettier" }, "eslint_d" },
|
||||
javascriptreact = { { "prettierd", "prettier" }, "eslint_d" },
|
||||
json = { { "prettierd", "prettier" } },
|
||||
lua = { "stylua" },
|
||||
markdown = { { "prettierd", "prettier" } },
|
||||
mdx = { { "prettierd", "prettier" } },
|
||||
nix = { "nixpkgs_fmt" },
|
||||
python = { "isort", "black" },
|
||||
ruby = { "rubyfmt", "rubocop" },
|
||||
eruby = { "htmlbeautifier" },
|
||||
svelte = { { "prettierd", "prettier" } },
|
||||
typescript = { { "prettierd", "prettier" }, "eslint_d" },
|
||||
typescriptreact = { { "prettierd", "prettier" }, "eslint_d" },
|
||||
yaml = { { "prettierd", "prettier" } },
|
||||
},
|
||||
},
|
||||
"stevearc/conform.nvim",
|
||||
event = { "BufWritePre", "BufNewFile" },
|
||||
keys = {
|
||||
{
|
||||
"<leader>mp",
|
||||
mode = { "n", "v" },
|
||||
function()
|
||||
require("conform").format({
|
||||
lsp_fallback = true,
|
||||
async = false,
|
||||
timeout_ms = 500,
|
||||
})
|
||||
end,
|
||||
desc = "Format file or range (in visual mode)",
|
||||
},
|
||||
},
|
||||
opts = {
|
||||
formatters = {
|
||||
["eslint_d"] = {
|
||||
command = "eslint_d",
|
||||
args = { "--fix-to-stdout", "--stdin", "--stdin-filename", "$FILENAME" },
|
||||
stdin = true,
|
||||
},
|
||||
["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,
|
||||
},
|
||||
["nixpkgs_fmt"] = {
|
||||
command = "nixpkgs-fmt",
|
||||
},
|
||||
},
|
||||
formatters_by_ft = {
|
||||
-- ["*"] = { "codespell" },
|
||||
["_"] = { "trim_whitespace" },
|
||||
["astro"] = { { "prettierd", "prettier" } },
|
||||
["css"] = { { "prettierd", "prettier" }, "stylelint" },
|
||||
["eruby"] = { "htmlbeautifier" },
|
||||
["fish"] = { "fish_indent" },
|
||||
["go"] = { "goimports", "gofumpt" },
|
||||
["graphql"] = { { "prettierd", "prettier" } },
|
||||
["html"] = { { "prettierd", "prettier" } },
|
||||
["javascript"] = { { "prettierd", "prettier" }, "eslint_d" },
|
||||
["javascriptreact"] = { { "prettierd", "prettier" }, "eslint_d" },
|
||||
["json"] = { { "prettierd", "prettier" } },
|
||||
["lua"] = { "stylua" },
|
||||
["markdown"] = { "prettierd", "prettier", "markdownlint-cli2", "markdown-toc" },
|
||||
["markdown.mdx"] = { "prettierd", "prettier", "markdownlint-cli2", "markdown-toc" },
|
||||
["mdx"] = { { "prettierd", "prettier" } },
|
||||
["nix"] = { "nixpkgs_fmt" },
|
||||
["python"] = { "isort", "black" },
|
||||
["ruby"] = { "rubyfmt", "rubocop" },
|
||||
["svelte"] = { { "prettierd", "prettier" } },
|
||||
["typescript"] = { { "prettierd", "prettier" }, "eslint_d" },
|
||||
["typescriptreact"] = { { "prettierd", "prettier" }, "eslint_d" },
|
||||
["yaml"] = { { "prettierd", "prettier" } },
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -1,34 +1,43 @@
|
||||
-- Linting
|
||||
-- https://github.com/mfussenegger/nvim-lint
|
||||
local HOME = os.getenv("HOME")
|
||||
|
||||
return {
|
||||
"mfussenegger/nvim-lint",
|
||||
event = {
|
||||
"BufWritePre",
|
||||
"BufNewFile",
|
||||
},
|
||||
keys = {
|
||||
{
|
||||
"<leader>L",
|
||||
mode = { "n" },
|
||||
function()
|
||||
require("lint").try_lint()
|
||||
end,
|
||||
desc = "Trigger linting for current file",
|
||||
},
|
||||
},
|
||||
opts = {
|
||||
events = { "BufEnter", "BufWritePost", "BufReadPost", "InsertLeave" },
|
||||
linters_by_ft = {
|
||||
["*"] = { "codespell" },
|
||||
astro = { "eslint_d", "cspell" },
|
||||
fish = { "fish" },
|
||||
javascript = { "eslint_d", "cspell" },
|
||||
javascriptreact = { "eslint_d", "cspell" },
|
||||
python = { "pylint" },
|
||||
ruby = { "rubocop" },
|
||||
svelte = { "eslint_d" },
|
||||
typescript = { "eslint_d", "cspell" },
|
||||
typescriptreact = { "eslint_d", "cspell" },
|
||||
},
|
||||
},
|
||||
"mfussenegger/nvim-lint",
|
||||
event = {
|
||||
"BufWritePre",
|
||||
"BufNewFile",
|
||||
},
|
||||
keys = {
|
||||
{
|
||||
"<leader>L",
|
||||
mode = { "n" },
|
||||
function()
|
||||
require("lint").try_lint()
|
||||
end,
|
||||
desc = "Trigger linting for current file",
|
||||
},
|
||||
},
|
||||
opts = {
|
||||
events = { "BufEnter", "BufWritePost", "BufReadPost", "InsertLeave" },
|
||||
linters = {
|
||||
-- https://github.com/LazyVim/LazyVim/discussions/4094#discussioncomment-10178217
|
||||
["markdownlint-cli2"] = {
|
||||
args = { "--config", HOME .. "/.markdownlint.yaml", "--" },
|
||||
},
|
||||
},
|
||||
linters_by_ft = {
|
||||
["*"] = { "codespell" },
|
||||
["astro"] = { "eslint_d", "cspell" },
|
||||
["fish"] = { "fish" },
|
||||
["javascript"] = { "eslint_d", "cspell" },
|
||||
["javascriptreact"] = { "eslint_d", "cspell" },
|
||||
["markdown"] = { "markdownlint-cli2" },
|
||||
["python"] = { "pylint" },
|
||||
["ruby"] = { "rubocop" },
|
||||
["svelte"] = { "eslint_d" },
|
||||
["typescript"] = { "eslint_d", "cspell" },
|
||||
["typescriptreact"] = { "eslint_d", "cspell" },
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -3,7 +3,16 @@
|
||||
return {
|
||||
"MeanderingProgrammer/render-markdown.nvim",
|
||||
opts = {
|
||||
file_types = { "markdown", "mdx" },
|
||||
file_types = { "markdown", "mdx", "norg", "rmd", "org" },
|
||||
code = {
|
||||
sign = false,
|
||||
width = "block",
|
||||
right_pad = 1,
|
||||
},
|
||||
heading = {
|
||||
sign = false,
|
||||
icons = {},
|
||||
},
|
||||
},
|
||||
dependencies = { "nvim-treesitter/nvim-treesitter", "echasnovski/mini.nvim" },
|
||||
}
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
~/.gitmux.conf: gitmux.conf
|
||||
~/.gnupg/dirmngr.conf: gnupg/dirmngr.conf
|
||||
~/.gnupg/gpg.conf: gnupg/gpg.conf
|
||||
~/.markdownlint.yaml: markdownlint.yaml
|
||||
~/.profile: profile
|
||||
~/.session-variables.sh: session-variables.sh
|
||||
~/.tool-versions: tool-versions
|
||||
|
||||
12
markdownlint.yaml
Normal file
12
markdownlint.yaml
Normal file
@@ -0,0 +1,12 @@
|
||||
# Filename: ~/.markdownlint.yaml
|
||||
#
|
||||
# Example: https://github.com/DavidAnson/markdownlint/blob/main/schema/.markdownlint.yaml
|
||||
|
||||
# Default state for all rules
|
||||
default: true
|
||||
|
||||
# Path to configuration file to extend
|
||||
extends: null
|
||||
|
||||
# MD013/line-length : Line length : https://github.com/DavidAnson/markdownlint/blob/v0.35.0/doc/md013.md
|
||||
MD013: false
|
||||
Reference in New Issue
Block a user