forked from Snoweuph/Dotfiles_nvim
64 lines
1.7 KiB
Lua
64 lines
1.7 KiB
Lua
local T = require('toolchain')
|
|
local K = require('core.keymap')
|
|
local M = {}
|
|
|
|
function M.setup()
|
|
T.add_highlighter_autoinstalls('markdown')
|
|
|
|
T.add_null_ls_module(function(null_ls)
|
|
return {
|
|
-- Actions
|
|
null_ls.builtins.code_actions.proselint,
|
|
-- Diagnostics
|
|
null_ls.builtins.diagnostics.alex,
|
|
null_ls.builtins.diagnostics.codespell,
|
|
null_ls.builtins.diagnostics.trail_space,
|
|
-- Formatter
|
|
null_ls.builtins.diagnostics.markdownlint,
|
|
}
|
|
end)
|
|
|
|
T.add_lsp_autoinstalls('marksman')
|
|
|
|
T.add_lsps(function(lspconfig, capabilities)
|
|
local config = { capabilities = capabilities }
|
|
lspconfig.marksman.setup(config)
|
|
end)
|
|
|
|
T.add_plugins({
|
|
'mrjones2014/mdpreview.nvim',
|
|
ft = 'markdown',
|
|
dependencies = {
|
|
'norcalli/nvim-terminal.lua',
|
|
},
|
|
config = function()
|
|
require('mdpreview').setup({
|
|
cli_args = {
|
|
'glow',
|
|
'-s',
|
|
'~/.config/glow/catppuccin-macchiato.json',
|
|
'-w',
|
|
'1',
|
|
'--local',
|
|
},
|
|
renderer = {
|
|
opts = {
|
|
win_opts = {
|
|
number = true,
|
|
wrap = false,
|
|
},
|
|
},
|
|
},
|
|
})
|
|
|
|
vim.keymap.set(
|
|
K.MARKDOWN_PREVIEW.mode,
|
|
K.MARKDOWN_PREVIEW.shortcut,
|
|
':Mdpreview<CR>',
|
|
{ desc = K.MARKDOWN_PREVIEW.description }
|
|
)
|
|
end,
|
|
})
|
|
end
|
|
|
|
return M
|