Neovim: Clean up configuration
This commit is contained in:
parent
ebf0dab03c
commit
9472088711
5 changed files with 15 additions and 34 deletions
|
@ -26,7 +26,7 @@ local plugins = {
|
||||||
{
|
{
|
||||||
"nvim-lualine/lualine.nvim",
|
"nvim-lualine/lualine.nvim",
|
||||||
dependencies = { "kyazdani42/nvim-web-devicons" },
|
dependencies = { "kyazdani42/nvim-web-devicons" },
|
||||||
config = require("plugins.lualine"),
|
config = true,
|
||||||
},
|
},
|
||||||
|
|
||||||
-- Git status in signcolumn
|
-- Git status in signcolumn
|
||||||
|
@ -74,22 +74,23 @@ local plugins = {
|
||||||
"zane-/cder.nvim", -- cd plugin for telescope
|
"zane-/cder.nvim", -- cd plugin for telescope
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
-- Do stuff as sudo
|
-- Do stuff as sudo
|
||||||
"lambdalisue/suda.vim",
|
"lambdalisue/suda.vim",
|
||||||
|
|
||||||
-- Display possible keybinds
|
-- Display possible keybinds
|
||||||
{ "folke/which-key.nvim", config = require("plugins.which-key") },
|
{ "folke/which-key.nvim", config = true },
|
||||||
|
|
||||||
-- Read editorconfig settings
|
-- Read editorconfig settings
|
||||||
"editorconfig/editorconfig-vim",
|
"editorconfig/editorconfig-vim",
|
||||||
|
|
||||||
-- Package manager for LSP servers, DAP adapters etc.
|
-- 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
|
-- Install LSP server executables with Mason
|
||||||
{
|
{
|
||||||
"williamboman/mason-lspconfig.nvim",
|
"williamboman/mason-lspconfig.nvim",
|
||||||
config = require("plugins.mason").lspconfig_setup,
|
config = true,
|
||||||
},
|
},
|
||||||
|
|
||||||
-- Configs for built-in LSP
|
-- Configs for built-in LSP
|
||||||
|
@ -98,6 +99,7 @@ local plugins = {
|
||||||
-- Additional LSP features for Java
|
-- Additional LSP features for Java
|
||||||
"mfussenegger/nvim-jdtls",
|
"mfussenegger/nvim-jdtls",
|
||||||
|
|
||||||
|
-- DAP plugin
|
||||||
{ "mfussenegger/nvim-dap", config = require("plugins.dap") },
|
{ "mfussenegger/nvim-dap", config = require("plugins.dap") },
|
||||||
|
|
||||||
-- Display function signature
|
-- Display function signature
|
||||||
|
@ -111,7 +113,7 @@ local plugins = {
|
||||||
},
|
},
|
||||||
|
|
||||||
-- vim api documentation for lua lsp
|
-- vim api documentation for lua lsp
|
||||||
{ "ii14/emmylua-nvim" },
|
"ii14/emmylua-nvim",
|
||||||
|
|
||||||
-- Completion
|
-- Completion
|
||||||
{
|
{
|
||||||
|
@ -195,9 +197,7 @@ local plugins = {
|
||||||
-- High performance color highlighter
|
-- High performance color highlighter
|
||||||
{
|
{
|
||||||
"norcalli/nvim-colorizer.lua",
|
"norcalli/nvim-colorizer.lua",
|
||||||
config = function()
|
config = true,
|
||||||
require("colorizer").setup()
|
|
||||||
end,
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
-- Pairs of server name and settings.
|
-- Pairs of server name and settings.
|
||||||
-- This is iterated through and every
|
-- This is iterated through and every
|
||||||
-- server is setup with lspconfig
|
-- server is setup with lspconfig
|
||||||
Servers = {
|
local servers = {
|
||||||
bashls = {},
|
bashls = {},
|
||||||
html = {},
|
html = {},
|
||||||
jsonls = {},
|
jsonls = {},
|
||||||
|
@ -30,9 +30,9 @@ Servers = {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
M = {}
|
local m = {}
|
||||||
|
|
||||||
function M.map_keys()
|
function m.map_keys()
|
||||||
-- Register keybindings via which-key
|
-- Register keybindings via which-key
|
||||||
-- to get documentation in which-key
|
-- to get documentation in which-key
|
||||||
local wk = require("which-key")
|
local wk = require("which-key")
|
||||||
|
@ -69,19 +69,19 @@ function M.map_keys()
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
function M.setup()
|
function m.setup()
|
||||||
local function on_attach()
|
local function on_attach()
|
||||||
-- Setup lsp signature plugin
|
-- Setup lsp signature plugin
|
||||||
require("lsp_signature").setup({})
|
require("lsp_signature").setup({})
|
||||||
|
|
||||||
-- Setup keybinds
|
-- Setup keybinds
|
||||||
M.map_keys()
|
m.map_keys()
|
||||||
end
|
end
|
||||||
|
|
||||||
local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||||
|
|
||||||
-- Setup every defined server
|
-- Setup every defined server
|
||||||
for server, settings in pairs(Servers) do
|
for server, settings in pairs(servers) do
|
||||||
require("lspconfig")[server].setup({
|
require("lspconfig")[server].setup({
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
settings = settings,
|
settings = settings,
|
||||||
|
@ -92,4 +92,4 @@ function M.setup()
|
||||||
end
|
end
|
||||||
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…
Reference in a new issue