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:
parent
40bdb20c6c
commit
d8b0ad50b3
5
.pre-commit-config.yaml
Normal file
5
.pre-commit-config.yaml
Normal file
|
@ -0,0 +1,5 @@
|
|||
repos:
|
||||
- repo: https://github.com/JohnnyMorganz/StyLua
|
||||
rev: v0.16.1
|
||||
hooks:
|
||||
- id: stylua
|
|
@ -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"
|
||||
|
|
13
config/nvim/lua/config/mason.lua
Normal file
13
config/nvim/lua/config/mason.lua
Normal file
|
@ -0,0 +1,13 @@
|
|||
return {
|
||||
pip = {
|
||||
upgrade_pip = true,
|
||||
},
|
||||
ui = {
|
||||
border = "single",
|
||||
icons = {
|
||||
package_installed = "✓",
|
||||
package_pending = "➜",
|
||||
package_uninstalled = "✗",
|
||||
},
|
||||
},
|
||||
}
|
4
config/nvim/lua/config/mason_lspconfig.lua
Normal file
4
config/nvim/lua/config/mason_lspconfig.lua
Normal file
|
@ -0,0 +1,4 @@
|
|||
return {
|
||||
ensure_installed = { "lua_ls" },
|
||||
automatic_installation = true,
|
||||
}
|
|
@ -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
|
||||
|
|
|
@ -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,
|
||||
},
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue