File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed
Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change 1+ --- @brief
2+ ---
3+ --- https://github.com/mhersson/mpls
4+ ---
5+ --- Markdown Preview Language Server
6+
7+ --- @type vim.lsp.Config
8+ return {
9+ cmd = {
10+ ' mpls' ,
11+ ' --theme' ,
12+ ' dark' ,
13+ ' --enable-emoji' ,
14+ ' --enable-footnotes' ,
15+ ' --no-auto' ,
16+ },
17+ root_markers = { ' .marksman.toml' , ' .git' },
18+ filetypes = { ' markdown' },
19+ on_attach = function (client , bufnr )
20+ vim .api .nvim_create_autocmd (' BufEnter' , {
21+ pattern = { ' *.md' },
22+ group = vim .api .nvim_create_augroup (' lspconfig.mpls.focus' , { clear = true }),
23+ callback = function (ctx )
24+ --- @diagnostic disable-next-line : param-type-mismatch
25+ client :notify (' mpls/editorDidChangeFocus' , { uri = ctx .match })
26+ end ,
27+ desc = ' mpls: notify buffer focus changed' ,
28+ })
29+ vim .api .nvim_buf_create_user_command (bufnr , ' LspMplsOpenPreview' , function ()
30+ client :exec_cmd ({
31+ title = ' Preview markdown with mpls' ,
32+ command = ' open-preview' ,
33+ })
34+ end , { desc = ' Preview markdown with mpls' })
35+ end ,
36+ }
You can’t perform that action at this time.
0 commit comments