nvim: mason
This commit is contained in:
parent
d60c2c7b48
commit
e6cf9b4a9d
5 changed files with 118 additions and 86 deletions
1
dot_config/nvim/after/ftplugin/xml.vim
Normal file
1
dot_config/nvim/after/ftplugin/xml.vim
Normal file
|
@ -0,0 +1 @@
|
||||||
|
setlocal tabstop=2 shiftwidth=2
|
|
@ -1,3 +1,4 @@
|
||||||
autocmd BufRead,BufNewFile Directory.Build.props set ft=xml
|
autocmd BufRead,BufNewFile Directory.Build.props set ft=xml
|
||||||
autocmd BufRead,BufNewFile Directory.Build.targets set ft=xml
|
autocmd BufRead,BufNewFile Directory.Build.targets set ft=xml
|
||||||
|
autocmd BufRead,BufNewFile *.axaml set ft=xml
|
||||||
autocmd BufRead,BufNewFile *.cake set filetype=cs
|
autocmd BufRead,BufNewFile *.cake set filetype=cs
|
||||||
|
|
|
@ -1,7 +1,18 @@
|
||||||
return {
|
return {
|
||||||
{ 'mfussenegger/nvim-dap',
|
{ 'mfussenegger/nvim-dap',
|
||||||
|
init = function ()
|
||||||
|
local php = require("mason-registry").get_package('php-debug-adapter')
|
||||||
|
if not php:is_installed() then
|
||||||
|
php:install()
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
|
||||||
dependencies = {
|
dependencies = {
|
||||||
'rcarriga/nvim-dap-ui',
|
'rcarriga/nvim-dap-ui',
|
||||||
|
'williamboman/mason.nvim',
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
keys = {
|
keys = {
|
||||||
{ '<F2>', function() require('dap').step_over() end },
|
{ '<F2>', function() require('dap').step_over() end },
|
||||||
|
@ -74,12 +85,6 @@ return {
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
{ 'xdebug/vscode-php-debug',
|
|
||||||
build = { 'npm install && npm run build' },
|
|
||||||
config = false,
|
|
||||||
module = false,
|
|
||||||
lazy = true,
|
|
||||||
},
|
|
||||||
{ 'leoluz/nvim-dap-go',
|
{ 'leoluz/nvim-dap-go',
|
||||||
ft = 'go',
|
ft = 'go',
|
||||||
config = true,
|
config = true,
|
||||||
|
|
|
@ -164,7 +164,7 @@ local function config()
|
||||||
-- Use a loop to conveniently both setup defined servers
|
-- Use a loop to conveniently both setup defined servers
|
||||||
-- and map buffer local keybindings when the language server attaches
|
-- and map buffer local keybindings when the language server attaches
|
||||||
local servers = {
|
local servers = {
|
||||||
powershell_es = { bundle_path = '/home/vladimir/devel/PowerShellEditorServices/module' },
|
powershell_es = {},
|
||||||
gopls = {},
|
gopls = {},
|
||||||
clangd = {},
|
clangd = {},
|
||||||
zls = {},
|
zls = {},
|
||||||
|
@ -260,18 +260,35 @@ local function config()
|
||||||
}, -- }}}
|
}, -- }}}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
local mlsp = require('mason-lspconfig')
|
||||||
|
local available = mlsp.get_available_servers()
|
||||||
|
local ensure = {}
|
||||||
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
||||||
for name, conf in pairs(servers) do
|
for name, conf in pairs(servers) do
|
||||||
conf.capabilities = capabilities
|
conf.capabilities = capabilities
|
||||||
nvim_lsp[name].setup(conf)
|
nvim_lsp[name].setup(conf)
|
||||||
|
if vim.tbl_contains(available, name) then
|
||||||
|
ensure[#ensure + 1] = name
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
mlsp.setup({ ensure_installed = ensure })
|
||||||
|
end
|
||||||
|
|
||||||
return {
|
return {
|
||||||
{ 'neovim/nvim-lspconfig',
|
{
|
||||||
|
'neovim/nvim-lspconfig',
|
||||||
dependencies = {
|
dependencies = {
|
||||||
{ 'j-hui/fidget.nvim', config = true },
|
{ 'j-hui/fidget.nvim', config = true },
|
||||||
{ 'ray-x/lsp_signature.nvim', opts = { hint_prefix = '⥊ ', floating_window = false, hint_scheme = 'Identifier' } },
|
{
|
||||||
|
'ray-x/lsp_signature.nvim',
|
||||||
|
opts = {
|
||||||
|
hint_prefix = '⥊ ',
|
||||||
|
floating_window = false,
|
||||||
|
hint_scheme = 'Identifier'
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{ 'williamboman/mason-lspconfig.nvim' },
|
||||||
},
|
},
|
||||||
keys = {
|
keys = {
|
||||||
{ '<leader>li', '<Cmd>LspInfo<CR>', desc = 'Lsp info' },
|
{ '<leader>li', '<Cmd>LspInfo<CR>', desc = 'Lsp info' },
|
||||||
|
@ -284,4 +301,11 @@ return {
|
||||||
{ 'Hoffs/omnisharp-extended-lsp.nvim', lazy = true },
|
{ 'Hoffs/omnisharp-extended-lsp.nvim', lazy = true },
|
||||||
{ 'b0o/schemastore.nvim', lazy = true },
|
{ 'b0o/schemastore.nvim', lazy = true },
|
||||||
{ 'folke/neodev.nvim', lazy = true },
|
{ 'folke/neodev.nvim', lazy = true },
|
||||||
|
{
|
||||||
|
'williamboman/mason.nvim',
|
||||||
|
cmd = 'Mason',
|
||||||
|
keys = {},
|
||||||
|
opts = {},
|
||||||
|
config = true,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -115,6 +115,7 @@ return {
|
||||||
|
|
||||||
{ 'fpob/nette.vim', ft = 'nette' },
|
{ 'fpob/nette.vim', ft = 'nette' },
|
||||||
{ 'ziglang/zig.vim', ft = 'zig' },
|
{ 'ziglang/zig.vim', ft = 'zig' },
|
||||||
|
{ 'chrisbra/csv.vim', ft = 'csv' },
|
||||||
|
|
||||||
{
|
{
|
||||||
'mfussenegger/nvim-jdtls',
|
'mfussenegger/nvim-jdtls',
|
||||||
|
|
Loading…
Add table
Reference in a new issue