Format on save for .py
All checks were successful
Run nix flake check / flake-check (push) Successful in 1m41s
Periodic flake update / flake-update (push) Successful in 1m21s

This commit is contained in:
Torjus Håkestad 2024-10-14 19:33:23 +02:00
parent d373b1dac4
commit 8505215a62
Signed by: torjus
SSH Key Fingerprint: SHA256:KjAds8wHfD2mBYK2H815s/+ABcSdcIHUndwHEdSxml4

View File

@ -33,6 +33,8 @@ lspconfig.gopls.setup({
}
}
})
-- GO: Automatically organize imports on save
vim.api.nvim_create_autocmd("BufWritePre", {
pattern = "*.go",
callback = function()
@ -131,6 +133,15 @@ lspconfig.rust_analyzer.setup {
lspconfig.ruff.setup({
})
-- Ruff: automatically format on save
vim.api.nvim_create_autocmd("BufWritePre", {
pattern = "*.py",
callback = function()
vim.lsp.buf.format { async = false }
end,
})
-- Ruff: Disable hover capability
vim.api.nvim_create_autocmd("LspAttach", {
group = vim.api.nvim_create_augroup('lsp_attach_disable_ruff_hover', { clear = true }),
callback = function(args)