Add config for mason and automatic LSP config setup from LspInstall, remove LSP packages from pkglist, setup stylua in pre-commit hook

This commit is contained in:
Evie Litherland-Smith 2023-02-21 07:43:48 +00:00
parent 40bdb20c6c
commit d8b0ad50b3
7 changed files with 48 additions and 32 deletions

5
.pre-commit-config.yaml Normal file
View file

@ -0,0 +1,5 @@
repos:
- repo: https://github.com/JohnnyMorganz/StyLua
rev: v0.16.1
hooks:
- id: stylua

View file

@ -13,7 +13,7 @@ if not vim.loop.fs_stat(lazypath) then
}
end
vim.opt.rtp:prepend(lazypath)
require("lazy").setup("plugins", require("config.lazy"))
require("lazy").setup("plugins", require "config.lazy")
-- Set vim options
require "config"

View file

@ -0,0 +1,13 @@
return {
pip = {
upgrade_pip = true,
},
ui = {
border = "single",
icons = {
package_installed = "",
package_pending = "",
package_uninstalled = "",
},
},
}

View file

@ -0,0 +1,4 @@
return {
ensure_installed = { "lua_ls" },
automatic_installation = true,
}

View file

@ -14,34 +14,22 @@ for type, icon in pairs(signs) do
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl })
end
require("mason").setup()
require("mason-lspconfig").setup(require "config.mason_lspconfig")
require("neodev").setup()
local lspconfig = require "lspconfig"
M.on_attach = require "lsp.attach"
M.lsp_flags = require "lsp.flags"
M.capabilities = require("cmp_nvim_lsp").default_capabilities()
lspconfig.pyright.setup {
on_attach = M.on_attach,
flags = M.lsp_flags,
capabilities = M.capabilities,
require("mason-lspconfig").setup_handlers {
function(server_name)
require("lspconfig")[server_name].setup {
on_attach = M.on_attach,
flags = M.lsp_flags,
capabilities = M.capabilities,
}
end,
}
lspconfig.fortls.setup {
on_attach = M.on_attach,
flags = M.lsp_flags,
capabilities = M.capabilities,
}
lspconfig.lua_ls.setup {
on_attach = M.on_attach,
flags = M.lsp_flags,
capabilities = M.capabilities,
}
lspconfig.texlab.setup {
on_attach = M.on_attach,
flags = M.lsp_flags,
capabilities = M.capabilities,
}
return M

View file

@ -1,5 +1,15 @@
return {
"williamboman/mason.nvim",
lazy = false,
config = function() require("mason").setup() end,
{
"williamboman/mason.nvim",
lazy = false,
config = function() require("mason").setup(require "config.mason") end,
},
{
"williamboman/mason-lspconfig.nvim",
dependencies = {
"williamboman/mason.nvim",
"neovim/nvim-lspconfig",
},
lazy = true,
},
}

View file

@ -1,11 +1,7 @@
fzf
lazygit
lua-language-server
neovim
prettier
python
python-black
python-isort
python-pip
python-pipx
python-poetry
@ -13,9 +9,9 @@ python-pre-commit
python-pynvim
python-virtualenv
ripgrep
shfmt
stylua
tmux
tree-sitter
wezterm
zsh
rust
npm