dotfiles/nvim/.config/nvim/after/ftplugin/python.lua
Sanchayan Maity 940c66406f
nvim: Use Ruff as Python LSP
Though Ruff is not an LSP in the LSP sense but using it this way
gives us formatting and linting via code actions. All other Python
LSP servers are garbage anyway.
2023-10-26 13:06:11 +05:30

14 lines
267 B
Lua

local lsp_utils = require('lsp-utils')
local ruff_config = lsp_utils.ruff_config()
vim.lsp.start(ruff_config)
vim.bo.textwidth = 0
vim.api.nvim_create_autocmd({ "BufWritePost" }, {
buffer = 0,
callback = function()
require("lint").try_lint()
end,
})