Update config with new plugins and none-ls

main
antoine.lenours 2025-01-31 09:08:33 +01:00
parent 1fc8b7c3b0
commit 428eb00d89
3 changed files with 92 additions and 3 deletions

View File

@ -6,7 +6,7 @@
local M = {} local M = {}
M.base46 = { M.base46 = {
theme = "material-deep-ocean", theme = "catppuccin",
-- hl_override = { -- hl_override = {
-- Comment = { italic = true }, -- Comment = { italic = true },

29
lua/configs/none-ls.lua Normal file
View File

@ -0,0 +1,29 @@
local none_ls = require("null-ls")
local augroup = vim.api.nvim_create_augroup("LspFormatting", {})
local opts = {
sources = {
none_ls.builtins.formatting.gofmt,
none_ls.builtins.formatting.goimports_reviser,
none_ls.builtins.formatting.golines,
none_ls.builtins.formatting.prettierd,
},
on_attach = function(client, bufnr)
if client.supports_method("textDocument/formatting") then
vim.api.nvim_clear_autocmds({
group = augroup,
buffer = bufnr,
})
vim.api.nvim_create_autocmd("BufWritePre", {
group = augroup,
buffer= bufnr,
callback = function()
vim.lsp.buf.format({bufnr=bufnr})
end,
})
end
end,
}
return opts

View File

@ -13,13 +13,73 @@ return {
end, end,
}, },
{
"nvimtools/none-ls.nvim",
ft = "go",
opts = function ()
return require "configs.none-ls"
end,
},
{
"williamboman/mason.nvim",
opts = {
ensure_installed = {
"gopls",
"pyright",
"typescript-language-server",
"tailwindcss-language-server",
"prettierd",
"eslint-lsp",
}
}
},
{ {
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
opts = { opts = {
ensure_installed = { ensure_installed = {
"vim", "lua", "vimdoc", "vim",
"html", "css" "lua",
"vimdoc",
"html",
"css",
"typescript",
"go",
"rust",
"python",
"tsx"
}, },
}, },
}, },
{
"ray-x/go.nvim",
config = function()
require("go").setup()
end,
event = {"CmdlineEnter"},
ft = {"go", 'gomod'},
build = ':lua require("go.install").update_all_sync()' -- if you need to install/update all binaries
},
{
"kdheepak/lazygit.nvim",
cmd = {
"LazyGit",
"LazyGitConfig",
"LazyGitCurrentFile",
"LazyGitFilter",
"LazyGitFilterCurrentFile",
},
-- optional for floating window border decoration
dependencies = {
"nvim-lua/plenary.nvim",
},
-- setting the keybinding for LazyGit with 'keys' is recommended in
-- order to load the plugin when the command is run for the first time
keys = {
{ "<leader>lg", "<cmd>LazyGit<cr>", desc = "LazyGit" }
}
},
} }