This commit is contained in:
Snoweuph 2024-06-02 19:11:54 +02:00
parent 0eaa505631
commit 518cee03cd
Signed by: Snoweuph
GPG key ID: A494330694B208EF
8 changed files with 103 additions and 113 deletions

View file

@ -1,6 +1,6 @@
return {
'm4xshen/autoclose.nvim',
"m4xshen/autoclose.nvim",
config = function()
require("autoclose").setup()
end
end,
}

View file

@ -23,7 +23,7 @@ return {
},
{
elements = {
{ id = "repl", size = 0.5 },
{ id = "repl", size = 0.5 },
{ id = "console", size = 0.5 },
},
position = "bottom",

View file

@ -5,90 +5,90 @@ local web_lsp = require("plugins.editor.language_server.language_server_web")
local php_lsp = require("plugins.editor.language_server.language_server_php")
return {
{
"williamboman/mason.nvim",
lazy = false,
config = function()
require("mason").setup()
end,
},
{
"williamboman/mason-lspconfig.nvim",
lazy = false,
opts = {
auto_install = true,
},
config = function()
require("mason-lspconfig").setup({
ensure_installed = {
table.unpack(lua_lsp.mason_requirements),
table.unpack(generic_lsp.mason_requirements),
table.unpack(go_lsp.mason_requirements),
table.unpack(web_lsp.mason_requirements),
table.unpack(php_lsp.mason_requirements),
},
})
end,
},
{
"neovim/nvim-lspconfig",
lazy = false,
config = function()
-- Setup --
local capabilities = require("cmp_nvim_lsp").default_capabilities()
local lspconfig = require("lspconfig")
{
"williamboman/mason.nvim",
lazy = false,
config = function()
require("mason").setup()
end,
},
{
"williamboman/mason-lspconfig.nvim",
lazy = false,
opts = {
auto_install = true,
},
config = function()
require("mason-lspconfig").setup({
ensure_installed = {
table.unpack(lua_lsp.mason_requirements),
table.unpack(generic_lsp.mason_requirements),
table.unpack(go_lsp.mason_requirements),
table.unpack(web_lsp.mason_requirements),
table.unpack(php_lsp.mason_requirements),
},
})
end,
},
{
"neovim/nvim-lspconfig",
lazy = false,
config = function()
-- Setup --
local capabilities = require("cmp_nvim_lsp").default_capabilities()
local lspconfig = require("lspconfig")
lua_lsp.setup(lspconfig, capabilities)
generic_lsp.setup(lspconfig, capabilities)
go_lsp.setup(lspconfig, capabilities)
web_lsp.setup(lspconfig, capabilities)
php_lsp.setup(lspconfig, capabilities)
lua_lsp.setup(lspconfig, capabilities)
generic_lsp.setup(lspconfig, capabilities)
go_lsp.setup(lspconfig, capabilities)
web_lsp.setup(lspconfig, capabilities)
php_lsp.setup(lspconfig, capabilities)
-- Keybinding --
vim.keymap.set("n", "<leader>cd", vim.lsp.buf.hover, { desc = "Show Code Definition" })
vim.keymap.set("n", "<leader>gd", vim.lsp.buf.definition, { desc = "Go to Definition" })
vim.keymap.set("n", "<leader>gr", vim.lsp.buf.references, { desc = "Go to References" })
vim.keymap.set("n", "<leader>ca", vim.lsp.buf.code_action, { desc = "Do Code Actions" })
end,
},
{
"nvimtools/none-ls.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
"nvimtools/none-ls-extras.nvim",
},
config = function()
-- Setup --
local null_ls = require("null-ls")
null_ls.setup({
sources = {
table.unpack(lua_lsp.formatter(null_ls)),
table.unpack(generic_lsp.formatter(null_ls)),
table.unpack(go_lsp.formatter(null_ls)),
table.unpack(web_lsp.formatter(null_ls)),
table.unpack(php_lsp.formatter(null_ls)),
},
})
-- Keybinding --
vim.keymap.set("n", "<leader>cd", vim.lsp.buf.hover, { desc = "Show Code Definition" })
vim.keymap.set("n", "<leader>gd", vim.lsp.buf.definition, { desc = "Go to Definition" })
vim.keymap.set("n", "<leader>gr", vim.lsp.buf.references, { desc = "Go to References" })
vim.keymap.set("n", "<leader>ca", vim.lsp.buf.code_action, { desc = "Do Code Actions" })
end,
},
{
"nvimtools/none-ls.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
"nvimtools/none-ls-extras.nvim",
},
config = function()
-- Setup --
local null_ls = require("null-ls")
null_ls.setup({
sources = {
table.unpack(lua_lsp.formatter(null_ls)),
table.unpack(generic_lsp.formatter(null_ls)),
table.unpack(go_lsp.formatter(null_ls)),
table.unpack(web_lsp.formatter(null_ls)),
table.unpack(php_lsp.formatter(null_ls)),
},
})
-- Keybinding --
vim.keymap.set("n", "<leader>fc", vim.lsp.buf.format, { desc = "Format Code" })
end,
},
{
"nvimdev/lspsaga.nvim",
after = "nvim-lspconfig",
dependencies = {
"nvim-treesitter/nvim-treesitter",
"nvim-tree/nvim-web-devicons",
},
config = function()
local lspsaga = require("lspsaga")
lspsaga.setup({})
-- Keybinding --
vim.keymap.set("n", "<leader>fc", vim.lsp.buf.format, { desc = "Format Code" })
end,
},
{
"nvimdev/lspsaga.nvim",
after = "nvim-lspconfig",
dependencies = {
"nvim-treesitter/nvim-treesitter",
"nvim-tree/nvim-web-devicons",
},
config = function()
local lspsaga = require("lspsaga")
lspsaga.setup({})
-- Keybinding --
vim.keymap.set("n", "<leader>cr", ":Lspsaga rename<CR>", { desc = "Rename Variable" })
vim.keymap.set("n", "<leader>cp", ":Lspsaga peek_definition<CR>", { desc = "Peek Code Definition" })
vim.keymap.set({ "n", "t" }, "<F6>", "<cmd>Lspsaga term_toggle<CR>", { desc = "Toggle Terminal" })
end,
},
-- Keybinding --
vim.keymap.set("n", "<leader>cr", ":Lspsaga rename<CR>", { desc = "Rename Variable" })
vim.keymap.set("n", "<leader>cp", ":Lspsaga peek_definition<CR>", { desc = "Peek Code Definition" })
vim.keymap.set({ "n", "t" }, "<F6>", "<cmd>Lspsaga term_toggle<CR>", { desc = "Toggle Terminal" })
end,
},
}

View file

@ -6,12 +6,10 @@ LSP.mason_requirements = {
"sqlls",
"lemminx",
"yamlls",
"marksman"
"marksman",
}
LSP.plugin_info = {
}
LSP.plugin_info = {}
function LSP.setup(lspconfig, capabilities)
local config = { capabilities = capabilities }
@ -26,7 +24,7 @@ end
function LSP.formatter(null_ls)
return {
null_ls.builtins.formatting.prettier.with({
command = "prettierd"
command = "prettierd",
}),
null_ls.builtins.diagnostics.spectral,
null_ls.builtins.code_actions.refactoring,
@ -38,7 +36,7 @@ function LSP.formatter(null_ls)
null_ls.builtins.diagnostics.codespell,
null_ls.builtins.diagnostics.dotenv_linter,
null_ls.builtins.diagnostics.trail_space,
null_ls.builtins.diagnostics.vacuum
null_ls.builtins.diagnostics.vacuum,
}
end

View file

@ -1,12 +1,10 @@
local LSP = {}
LSP.mason_requirements = {
"gopls"
"gopls",
}
LSP.plugin_info = {
}
LSP.plugin_info = {}
function LSP.setup(lspconfig, capabilities)
lspconfig.gopls.setup({ capabilities = capabilities })
@ -18,7 +16,7 @@ function LSP.formatter(null_ls)
null_ls.builtins.code_actions.gomodifytags,
null_ls.builtins.code_actions.impl,
null_ls.builtins.diagnostics.golangci_lint,
null_ls.builtins.diagnostics.staticcheck
null_ls.builtins.diagnostics.staticcheck,
}
end

View file

@ -1,12 +1,10 @@
local LSP = {}
LSP.mason_requirements = {
"lua_ls"
"lua_ls",
}
LSP.plugin_info = {
}
LSP.plugin_info = {}
function LSP.setup(lspconfig, capabilities)
lspconfig.lua_ls.setup({
@ -15,16 +13,16 @@ function LSP.setup(lspconfig, capabilities)
Lua = {
diagnostics = {
globals = { "vim" },
}
}
}
},
},
},
})
end
function LSP.formatter(null_ls)
return {
null_ls.builtins.formatting.stylua,
null_ls.builtins.diagnostics.selene
null_ls.builtins.diagnostics.selene,
}
end

View file

@ -2,12 +2,10 @@ local LSP = {}
LSP.mason_requirements = {
"phpactor",
"stimulus_ls"
"stimulus_ls",
}
LSP.plugin_info = {
}
LSP.plugin_info = {}
function LSP.setup(lspconfig, capabilities)
local config = { capabilities = capabilities }
@ -20,7 +18,7 @@ function LSP.formatter(null_ls)
null_ls.builtins.diagnostics.phpstan,
null_ls.builtins.formatting.phpcsfixer.with({
prefer_local = "vendor/bin/php-cs-fixer",
args = { "fix", "--allow-risky=yes", "$FILENAME" }
args = { "fix", "--allow-risky=yes", "$FILENAME" },
}),
null_ls.builtins.diagnostics.phpcs,
null_ls.builtins.diagnostics.twigcs,

View file

@ -11,9 +11,7 @@ LSP.mason_requirements = {
"eslint",
}
LSP.plugin_info = {
}
LSP.plugin_info = {}
function LSP.setup(lspconfig, capabilities)
local config = { capabilities = capabilities }
@ -30,7 +28,7 @@ end
function LSP.formatter(null_ls)
return {
require("none-ls.formatting.eslint_d"),
null_ls.builtins.diagnostics.stylelint
null_ls.builtins.diagnostics.stylelint,
}
end