Neovim: Clean up configuration

main
Marko Korhonen 1 year ago
parent ebf0dab03c
commit 9472088711
No known key found for this signature in database
GPG Key ID: A7F78BCB859CD890

@ -26,7 +26,7 @@ local plugins = {
{
"nvim-lualine/lualine.nvim",
dependencies = { "kyazdani42/nvim-web-devicons" },
config = require("plugins.lualine"),
config = true,
},
-- Git status in signcolumn
@ -74,22 +74,23 @@ local plugins = {
"zane-/cder.nvim", -- cd plugin for telescope
},
},
-- Do stuff as sudo
"lambdalisue/suda.vim",
-- Display possible keybinds
{ "folke/which-key.nvim", config = require("plugins.which-key") },
{ "folke/which-key.nvim", config = true },
-- Read editorconfig settings
"editorconfig/editorconfig-vim",
-- Package manager for LSP servers, DAP adapters etc.
{ "williamboman/mason.nvim", config = require("plugins.mason").setup },
{ "williamboman/mason.nvim", config = true },
-- Install LSP server executables with Mason
{
"williamboman/mason-lspconfig.nvim",
config = require("plugins.mason").lspconfig_setup,
config = true,
},
-- Configs for built-in LSP
@ -98,6 +99,7 @@ local plugins = {
-- Additional LSP features for Java
"mfussenegger/nvim-jdtls",
-- DAP plugin
{ "mfussenegger/nvim-dap", config = require("plugins.dap") },
-- Display function signature
@ -111,7 +113,7 @@ local plugins = {
},
-- vim api documentation for lua lsp
{ "ii14/emmylua-nvim" },
"ii14/emmylua-nvim",
-- Completion
{
@ -195,9 +197,7 @@ local plugins = {
-- High performance color highlighter
{
"norcalli/nvim-colorizer.lua",
config = function()
require("colorizer").setup()
end,
config = true,
},
}

@ -1,7 +1,7 @@
-- Pairs of server name and settings.
-- This is iterated through and every
-- server is setup with lspconfig
Servers = {
local servers = {
bashls = {},
html = {},
jsonls = {},
@ -30,9 +30,9 @@ Servers = {
},
}
M = {}
local m = {}
function M.map_keys()
function m.map_keys()
-- Register keybindings via which-key
-- to get documentation in which-key
local wk = require("which-key")
@ -69,19 +69,19 @@ function M.map_keys()
})
end
function M.setup()
function m.setup()
local function on_attach()
-- Setup lsp signature plugin
require("lsp_signature").setup({})
-- Setup keybinds
M.map_keys()
m.map_keys()
end
local capabilities = require("cmp_nvim_lsp").default_capabilities()
-- Setup every defined server
for server, settings in pairs(Servers) do
for server, settings in pairs(servers) do
require("lspconfig")[server].setup({
on_attach = on_attach,
settings = settings,
@ -92,4 +92,4 @@ function M.setup()
end
end
return M
return m

@ -1,3 +0,0 @@
return function()
require("lualine").setup({})
end

@ -1,13 +0,0 @@
local M = {}
Opts = { mason = {}, lspconfig = { automatic_installation = true } }
M.setup = function()
require("mason").setup(Opts.mason)
end
M.lspconfig_setup = function()
require("mason-lspconfig").setup(Opts.lspconfig)
end
return M

@ -1,3 +0,0 @@
return function()
require("which-key").setup({ spelling = { enabled = true } })
end
Loading…
Cancel
Save