Skip to content

Commit 00656ce

Browse files
author
Hamish Downer
committed
make markdownlint work how I want it to
1 parent 22cb56d commit 00656ce

File tree

3 files changed

+24
-187
lines changed

3 files changed

+24
-187
lines changed

freshrc

+3
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,9 @@ fresh regolith/Xresources --file=~/.config/regolith/Xresources
144144
# need to do `pipsi install pypyp` and then install pipetools into that venv and then
145145
fresh pypyp.py --file=~/.config/pypyp.py
146146

147+
# markdown lint
148+
fresh markdownlint-cli2.yaml --file
149+
147150
############
148151
# mail stuff
149152
############

lazyvim/lua/plugins/example.lua

+12-187
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,18 @@ if true then
4646
},
4747
},
4848

49+
{
50+
"mfussenegger/nvim-lint",
51+
optional = true,
52+
opts = {
53+
linters = {
54+
["markdownlint-cli2"] = {
55+
args = { "--config", vim.fn.expand("~/.markdownlint-cli2.yaml"), "--" },
56+
},
57+
},
58+
},
59+
},
60+
4961
-- revert to standard `s` keybinding
5062
{
5163
"folke/flash.nvim",
@@ -71,190 +83,3 @@ if true then
7183
},
7284
}
7385
end
74-
75-
-- since this is just an example spec, don't actually load anything here and return an empty spec
76-
-- stylua: ignore
77-
if true then return {} end
78-
79-
-- every spec file under the "plugins" directory will be loaded automatically by lazy.nvim
80-
--
81-
-- In your plugin files, you can:
82-
-- * add extra plugins
83-
-- * disable/enabled LazyVim plugins
84-
-- * override the configuration of LazyVim plugins
85-
return {
86-
-- change trouble config
87-
{
88-
"folke/trouble.nvim",
89-
-- opts will be merged with the parent spec
90-
opts = { use_diagnostic_signs = true },
91-
},
92-
93-
-- disable trouble
94-
{ "folke/trouble.nvim", enabled = false },
95-
96-
-- override nvim-cmp and add cmp-emoji
97-
{
98-
"hrsh7th/nvim-cmp",
99-
dependencies = { "hrsh7th/cmp-emoji" },
100-
---@param opts cmp.ConfigSchema
101-
opts = function(_, opts)
102-
table.insert(opts.sources, { name = "emoji" })
103-
end,
104-
},
105-
106-
-- change some telescope options and a keymap to browse plugin files
107-
{
108-
"nvim-telescope/telescope.nvim",
109-
keys = {
110-
-- add a keymap to browse plugin files
111-
-- stylua: ignore
112-
{
113-
"<leader>fp",
114-
function() require("telescope.builtin").find_files({ cwd = require("lazy.core.config").options.root }) end,
115-
desc = "Find Plugin File",
116-
},
117-
},
118-
-- change some options
119-
opts = {
120-
defaults = {
121-
layout_strategy = "horizontal",
122-
layout_config = { prompt_position = "top" },
123-
sorting_strategy = "ascending",
124-
winblend = 0,
125-
},
126-
},
127-
},
128-
129-
-- add pyright to lspconfig
130-
{
131-
"neovim/nvim-lspconfig",
132-
---@class PluginLspOpts
133-
opts = {
134-
---@type lspconfig.options
135-
servers = {
136-
-- pyright will be automatically installed with mason and loaded with lspconfig
137-
pyright = {},
138-
},
139-
},
140-
},
141-
142-
-- add tsserver and setup with typescript.nvim instead of lspconfig
143-
{
144-
"neovim/nvim-lspconfig",
145-
dependencies = {
146-
"jose-elias-alvarez/typescript.nvim",
147-
init = function()
148-
require("lazyvim.util").lsp.on_attach(function(_, buffer)
149-
-- stylua: ignore
150-
vim.keymap.set( "n", "<leader>co", "TypescriptOrganizeImports", { buffer = buffer, desc = "Organize Imports" })
151-
vim.keymap.set("n", "<leader>cR", "TypescriptRenameFile", { desc = "Rename File", buffer = buffer })
152-
end)
153-
end,
154-
},
155-
---@class PluginLspOpts
156-
opts = {
157-
---@type lspconfig.options
158-
servers = {
159-
-- tsserver will be automatically installed with mason and loaded with lspconfig
160-
tsserver = {},
161-
},
162-
-- you can do any additional lsp server setup here
163-
-- return true if you don't want this server to be setup with lspconfig
164-
---@type table<string, fun(server:string, opts:_.lspconfig.options):boolean?>
165-
setup = {
166-
-- example to setup with typescript.nvim
167-
tsserver = function(_, opts)
168-
require("typescript").setup({ server = opts })
169-
return true
170-
end,
171-
-- Specify * to use this function as a fallback for any server
172-
-- ["*"] = function(server, opts) end,
173-
},
174-
},
175-
},
176-
177-
-- for typescript, LazyVim also includes extra specs to properly setup lspconfig,
178-
-- treesitter, mason and typescript.nvim. So instead of the above, you can use:
179-
{ import = "lazyvim.plugins.extras.lang.typescript" },
180-
181-
-- add more treesitter parsers
182-
{
183-
"nvim-treesitter/nvim-treesitter",
184-
opts = {
185-
ensure_installed = {
186-
"bash",
187-
"html",
188-
"javascript",
189-
"json",
190-
"lua",
191-
"markdown",
192-
"markdown_inline",
193-
"python",
194-
"query",
195-
"regex",
196-
"tsx",
197-
"typescript",
198-
"vim",
199-
"yaml",
200-
},
201-
},
202-
},
203-
204-
-- since `vim.tbl_deep_extend`, can only merge tables and not lists, the code above
205-
-- would overwrite `ensure_installed` with the new value.
206-
-- If you'd rather extend the default config, use the code below instead:
207-
{
208-
"nvim-treesitter/nvim-treesitter",
209-
opts = function(_, opts)
210-
-- add tsx and treesitter
211-
vim.list_extend(opts.ensure_installed, {
212-
"tsx",
213-
"typescript",
214-
})
215-
end,
216-
},
217-
218-
-- the opts function can also be used to change the default opts:
219-
{
220-
"nvim-lualine/lualine.nvim",
221-
event = "VeryLazy",
222-
opts = function(_, opts)
223-
table.insert(opts.sections.lualine_x, {
224-
function()
225-
return "😄"
226-
end,
227-
})
228-
end,
229-
},
230-
231-
-- or you can return new options to override all the defaults
232-
{
233-
"nvim-lualine/lualine.nvim",
234-
event = "VeryLazy",
235-
opts = function()
236-
return {
237-
--[[add your custom lualine config here]]
238-
}
239-
end,
240-
},
241-
242-
-- use mini.starter instead of alpha
243-
{ import = "lazyvim.plugins.extras.ui.mini-starter" },
244-
245-
-- add jsonls and schemastore packages, and setup treesitter for json, json5 and jsonc
246-
{ import = "lazyvim.plugins.extras.lang.json" },
247-
248-
-- add any tools you want to have installed below
249-
{
250-
"williamboman/mason.nvim",
251-
opts = {
252-
ensure_installed = {
253-
"stylua",
254-
"shellcheck",
255-
"shfmt",
256-
"flake8",
257-
},
258-
},
259-
},
260-
}

markdownlint-cli2.yaml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
config:
3+
# header style
4+
MD003:
5+
style: setext_with_atx
6+
# line length
7+
MD013: false
8+
9+
gitignore: true

0 commit comments

Comments
 (0)