Skip to content

Commit

Permalink
feat: Adding stuff for mdx files
Browse files Browse the repository at this point in the history
  • Loading branch information
elliotcourant committed Oct 28, 2023
1 parent 7f0edac commit d0f3d46
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 0 deletions.
62 changes: 62 additions & 0 deletions nvim/lua/user/autocomplete.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ require("mason-lspconfig").setup {
"gopls",
"lua_ls",
"marksman",
"mdx_analyzer",
"pylsp",
"rust_analyzer",
"svelte",
Expand Down Expand Up @@ -291,6 +292,15 @@ require('lspconfig')['marksman'].setup {
}
}

require('lspconfig')['mdx_analyzer'].setup {
capabilities = capabilities,
on_attach = on_attach,
flags = lsp_flags,
filetypes = {
"markdown.mdx",
}
}

-- require('lspconfig')['grammarly'].setup {
-- capabilities = capabilities,
-- on_attach = on_attach,
Expand All @@ -307,6 +317,58 @@ require('lspconfig')['tailwindcss'].setup {
capabilities = capabilities,
on_attach = on_attach,
flags = lsp_flags,
filetypes = {
"aspnetcorerazor",
"astro",
"astro-markdown",
"blade",
"clojure",
"django-html",
"htmldjango",
"edge",
"eelixir",
"elixir",
"ejs",
"erb",
"eruby",
"gohtml",
"gohtmltmpl",
"haml",
"handlebars",
"hbs",
"html",
"html-eex",
"heex",
"jade",
"leaf",
"liquid",
"markdown",
"markdown.mdx",
"mdx",
"mustache",
"njk",
"nunjucks",
"php",
"razor",
"slim",
"twig",
"css",
"less",
"postcss",
"sass",
"scss",
"stylus",
"sugarss",
"javascript",
"javascriptreact",
"reason",
"rescript",
"typescript",
"typescriptreact",
"vue",
"svelte",
}
,
handlers = {
["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, {
silent = true,
Expand Down
14 changes: 14 additions & 0 deletions nvim/lua/user/markdown.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,17 @@ vim.api.nvim_create_autocmd({ "BufNewFile", "BufFilePre", "BufRead", "BufEnter"
vim.o.colorcolumn = '120'
end
})

vim.api.nvim_create_autocmd({ "BufNewFile", "BufFilePre", "BufRead", "BufEnter" }, {
pattern = { "*.mdx" },
callback = function()
vim.bo.expandtab = true
vim.bo.shiftwidth = 2
vim.bo.tabstop = 2
vim.bo.filetype = 'markdown.mdx'
vim.bo.syntax = 'markdown'
vim.bo.textwidth = 120
vim.o.spell = false
vim.o.colorcolumn = '120'
end
})

0 comments on commit d0f3d46

Please sign in to comment.