Format on save for .py
This commit is contained in:
parent
d373b1dac4
commit
8505215a62
@ -33,6 +33,8 @@ lspconfig.gopls.setup({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
-- GO: Automatically organize imports on save
|
||||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||||
pattern = "*.go",
|
pattern = "*.go",
|
||||||
callback = function()
|
callback = function()
|
||||||
@ -131,6 +133,15 @@ lspconfig.rust_analyzer.setup {
|
|||||||
lspconfig.ruff.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", {
|
vim.api.nvim_create_autocmd("LspAttach", {
|
||||||
group = vim.api.nvim_create_augroup('lsp_attach_disable_ruff_hover', { clear = true }),
|
group = vim.api.nvim_create_augroup('lsp_attach_disable_ruff_hover', { clear = true }),
|
||||||
callback = function(args)
|
callback = function(args)
|
||||||
|
Loading…
Reference in New Issue
Block a user