add perlcritic, add mason automated lsp servers install

This commit is contained in:
Szwendacz99 2022-10-21 16:41:35 +02:00
parent 82cbc247fa
commit cb1507b292

View file

@ -2,14 +2,27 @@
vim.g.loaded = 1 vim.g.loaded = 1
vim.g.loaded_netrwPlugin = 1 vim.g.loaded_netrwPlugin = 1
-- load lsp stuff -- load lsp and dependencies (help for both coc and independent lsp setup)
require("mason").setup() require("mason").setup()
require("mason-lspconfig").setup() require("mason-lspconfig").setup({
ensure_installed = {
"bashls",
"pyright",
"perlnavigator",
"salt_ls",
"dockerls",
"kotlin_language_server",
"intelephense",
"phpactor",
"eslint"
}
})
require("null-ls").setup({ require("null-ls").setup({
sources = { sources = {
require("null-ls").builtins.formatting.stylua, require("null-ls").builtins.formatting.stylua,
require("null-ls").builtins.diagnostics.eslint, require("null-ls").builtins.diagnostics.eslint,
require("null-ls").builtins.completion.spell, require("null-ls").builtins.completion.spell,
require("null-ls").builtins.code_actions.gitsigns,
}, },
}) })
@ -27,19 +40,17 @@ codewindow.apply_default_keybinds()
-- load perl lsp -- load perl lsp
local config = { require'lspconfig'.perlnavigator.setup{
cmd = { 'pls' }, -- complete path to where PLS is located
settings = { settings = {
pls = { perlnavigator = {
--inc = { '/my/perl/5.34/lib', '/some/other/perl/lib' }, -- add list of dirs to @INC perlPath = 'perl',
--cwd = { '/my/projects' }, -- working directory for PLS enableWarnings = true,
perlcritic = { enabled = true }, -- use perlcritic and pass a non-default location for its config perltidyProfile = '',
syntax = { enabled = true, perl = '/usr/bin/perl' }, -- enable syntax checking and use a non-default perl binary perlcriticProfile = '',
--perltidy = { perltidyrc = '/my/projects/.perltidyrc' } -- non-default location for perltidy's config perlcriticEnabled = true,
} }
} }
} }
require'lspconfig'.perlpls.setup(config)
require("nvim-tree").setup({ require("nvim-tree").setup({
create_in_closed_folder = true, create_in_closed_folder = true,