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 end
vim.opt.rtp:prepend(lazypath) vim.opt.rtp:prepend(lazypath)
require("lazy").setup("plugins", require("config.lazy")) require("lazy").setup("plugins", require "config.lazy")
-- Set vim options -- Set vim options
require "config" 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 }) vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl })
end end
require("mason").setup()
require("mason-lspconfig").setup(require "config.mason_lspconfig")
require("neodev").setup() require("neodev").setup()
local lspconfig = require "lspconfig"
M.on_attach = require "lsp.attach" M.on_attach = require "lsp.attach"
M.lsp_flags = require "lsp.flags" M.lsp_flags = require "lsp.flags"
M.capabilities = require("cmp_nvim_lsp").default_capabilities() M.capabilities = require("cmp_nvim_lsp").default_capabilities()
lspconfig.pyright.setup { require("mason-lspconfig").setup_handlers {
on_attach = M.on_attach, function(server_name)
flags = M.lsp_flags, require("lspconfig")[server_name].setup {
capabilities = M.capabilities, 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 return M

View file

@ -1,5 +1,15 @@
return { return {
"williamboman/mason.nvim", {
lazy = false, "williamboman/mason.nvim",
config = function() require("mason").setup() end, 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 fzf
lazygit lazygit
lua-language-server
neovim neovim
prettier
python python
python-black
python-isort
python-pip python-pip
python-pipx python-pipx
python-poetry python-poetry
@ -13,9 +9,9 @@ python-pre-commit
python-pynvim python-pynvim
python-virtualenv python-virtualenv
ripgrep ripgrep
shfmt
stylua
tmux tmux
tree-sitter tree-sitter
wezterm wezterm
zsh zsh
rust
npm