1
0
Fork 1
Dotfiles_nvim/lua/toolchain/text.lua

65 lines
1.7 KiB
Lua
Raw Normal View History

2024-09-07 18:39:22 +00:00
local T = require('toolchain')
2024-09-07 23:50:39 +00:00
local K = require('core.keymap')
2024-09-07 18:39:22 +00:00
local M = {}
2024-09-07 23:50:39 +00:00
function M.setup()
2024-09-07 18:39:22 +00:00
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({
2024-07-02 21:52:43 +00:00
'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(
2024-09-07 23:50:39 +00:00
K.MARKDOWN_PREVIEW.mode,
K.MARKDOWN_PREVIEW.shortcut,
2024-07-02 21:52:43 +00:00
':Mdpreview<CR>',
2024-09-07 23:50:39 +00:00
{ desc = K.MARKDOWN_PREVIEW.description }
2024-07-02 21:52:43 +00:00
)
end,
2024-09-07 18:39:22 +00:00
})
end
return M