summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--neovim/.config/nvim/lua/plugins/nvim_lspconfig.lua13
1 files changed, 13 insertions, 0 deletions
diff --git a/neovim/.config/nvim/lua/plugins/nvim_lspconfig.lua b/neovim/.config/nvim/lua/plugins/nvim_lspconfig.lua
index fbae976..19e2eb4 100644
--- a/neovim/.config/nvim/lua/plugins/nvim_lspconfig.lua
+++ b/neovim/.config/nvim/lua/plugins/nvim_lspconfig.lua
@@ -145,6 +145,19 @@ return {
vim.diagnostic.enable(false, { bufnr = args.buf })
end,
})
+
+ vim.api.nvim_create_autocmd({ "BufWritePost" }, {
+ pattern = '*.py',
+ callback = function()
+ vim.lsp.buf.code_action {
+ context = {
+ only = { 'source.fixAll.ruff' },
+ },
+ apply = true,
+ }
+ vim.lsp.buf.format { async = true }
+ end
+ })
end,
},
}