mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-22 12:31:07 +00:00
Merge 8aee4d3fe6 into 459a4c3b10
This commit is contained in:
commit
6334b37b12
1 changed files with 70 additions and 0 deletions
70
lua/lazyvim/plugins/extras/lang/matlab.lua
Normal file
70
lua/lazyvim/plugins/extras/lang/matlab.lua
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
if lazyvim_docs then
|
||||
-- Formatter to use for MATLAB.
|
||||
-- Set to "miss_hit" to use mh_style instead of matlab_ls.
|
||||
vim.g.lazyvim_matlab_formatter = "lsp"
|
||||
end
|
||||
|
||||
local formatter = vim.g.lazyvim_matlab_formatter or "lsp"
|
||||
|
||||
return {
|
||||
recommended = function()
|
||||
return LazyVim.extras.wants({
|
||||
ft = "matlab",
|
||||
root = { "*.prj" },
|
||||
})
|
||||
end,
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = { ensure_installed = { "matlab" } },
|
||||
},
|
||||
{
|
||||
"mason-org/mason.nvim",
|
||||
opts = function(_, opts)
|
||||
opts.ensure_installed = opts.ensure_installed or {}
|
||||
if formatter == "miss_hit" then
|
||||
vim.list_extend(opts.ensure_installed, { "miss_hit" })
|
||||
end
|
||||
end,
|
||||
},
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = {
|
||||
servers = {
|
||||
matlab_ls = {},
|
||||
},
|
||||
},
|
||||
},
|
||||
-- tmux required
|
||||
{
|
||||
"idossha/matlab.nvim",
|
||||
ft = "matlab",
|
||||
opts = {
|
||||
auto_start = false,
|
||||
default_mappings = true,
|
||||
mappings = {
|
||||
prefix = "<localleader>m",
|
||||
},
|
||||
},
|
||||
},
|
||||
-- `mh_style` from `miss_hit`
|
||||
{
|
||||
"stevearc/conform.nvim",
|
||||
optional = true,
|
||||
opts = function(_, opts)
|
||||
if formatter == "miss_hit" then
|
||||
opts.formatters_by_ft = opts.formatters_by_ft or {}
|
||||
opts.formatters_by_ft.matlab = { "mh_style" }
|
||||
end
|
||||
end,
|
||||
},
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
optional = true,
|
||||
opts = {
|
||||
spec = {
|
||||
{ "<localleader>m", group = "MATLAB", icon = { icon = "" } },
|
||||
{ "<localleader>md", group = "debug" },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue