add more lsp and formatter

This commit is contained in:
Ray Andrew 2024-11-21 00:29:47 -06:00
parent cdd417f391
commit cd7dc8181e
No known key found for this signature in database
2 changed files with 42 additions and 6 deletions

View file

@ -401,8 +401,7 @@ require("lazy").setup({
},
}
if vim.fn.executable('pip') == 1 then
if vim.fn.executable("pip") == 1 then
vim.list_extend(servers, {
pylsp = {},
})
@ -412,6 +411,7 @@ require("lazy").setup({
local ensure_installed = vim.tbl_keys(servers or {})
vim.list_extend(ensure_installed, {
"stylua", -- Used to format Lua code
"shfmt",
})
require("mason-tool-installer").setup({ ensure_installed = ensure_installed })
@ -462,6 +462,7 @@ require("lazy").setup({
lua = { "stylua" },
python = { "isort", "black" },
nix = { "nixfmt" },
sh = { "shfmt" },
},
},
},
@ -490,7 +491,38 @@ require("lazy").setup({
},
"saadparwaiz1/cmp_luasnip",
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-path",
-- "hrsh7th/cmp-path",
"https://codeberg.org/FelipeLema/cmp-async-path.git",
{
"zbirenbaum/copilot-cmp",
opts = {},
dependencies = {
{
"zbirenbaum/copilot.lua",
cmd = "Copilot",
event = "InsertEnter",
config = true,
},
},
config = function(_, opts)
local copilot_cmp = require("copilot_cmp")
copilot_cmp.setup(opts)
-- attach cmp source whenever copilot attaches
-- fixes lazy-loading issues with the copilot cmp source
local on_attach = function(client, _)
if client.name == "copilot" then
copilot_cmp._on_insert_enter({})
end
end
vim.api.nvim_create_autocmd("LspAttach", {
callback = function(args)
local buffer = args.buf ---@type number
local client = vim.lsp.get_client_by_id(args.data.client_id)
on_attach(client, buffer)
end,
})
end,
},
},
config = function()
-- See `:help cmp`
@ -556,6 +588,7 @@ require("lazy").setup({
end, { "i", "s" }),
}),
sources = {
{ name = "copilot" },
{
name = "lazydev",
-- set group index to 0 to skip loading LuaLS completions as lazydev recommends it
@ -563,7 +596,8 @@ require("lazy").setup({
},
{ name = "nvim_lsp" },
{ name = "luasnip" },
{ name = "path" },
-- { name = "path" },
{ name = "async_path" },
},
})
end,
@ -751,7 +785,7 @@ require("lazy").setup({
-- stylua: ignore start
keys = {
{ "<leader>un", function() Snacks.notifier.hide() end, desc = "Dismiss All Notifications" },
{ "<leader>bd", function() Snacks.bufdelete() end, desc = "Delete Buffer" },
{ "<leader>bd", function() Snacks.bufdelete({ wipe = true }) end, desc = "Delete Buffer" },
{ "<leader>gg", function() Snacks.lazygit() end, desc = "Lazygit" },
{ "<leader>gb", function() Snacks.git.blame_line() end, desc = "Git Blame Line" },
{ "<leader>gB", function() Snacks.gitbrowse() end, desc = "Git Browse" },

View file

@ -1,9 +1,11 @@
{
"LuaSnip": { "branch": "master", "commit": "0f7bbce41ea152a94d12aea286f2ce98e63c0f58" },
"cmp-async-path": { "branch": "main", "commit": "d6d1ffa2075039632a2d71e8fa139818e15ac757" },
"cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
"conform.nvim": { "branch": "master", "commit": "023f795dbcf32d4351b6a9ed2e613d471b5bb812" },
"copilot-cmp": { "branch": "master", "commit": "b6e5286b3d74b04256d0a7e3bd2908eabec34b44" },
"copilot.lua": { "branch": "master", "commit": "f8d8d872bb319f640d5177dad5fbf01f7a16d7d0" },
"fidget.nvim": { "branch": "main", "commit": "e2a175c2abe2d4f65357da1c98c59a5cfb2b543f" },
"friendly-snippets": { "branch": "main", "commit": "de8fce94985873666bd9712ea3e49ee17aadb1ed" },
"gitsigns.nvim": { "branch": "main", "commit": "ac5aba6dce8c06ea22bea2c9016f51a2dbf90dc7" },