nvim: Update to new conform.nvim version

Update and fix small breaking change in new conform by specifically
setting lsp formatting as fallback. Move to explicit ruff format import
organizing and remove tailwind css lsp for the time being.
This commit is contained in:
Marty Oehme 2024-07-02 13:08:07 +02:00
parent 8aa845dcfb
commit 1514eca622
Signed by: Marty
GPG key ID: EDBF2ED917B2EF6A
3 changed files with 29 additions and 14 deletions

View file

@ -23,7 +23,7 @@
"cmp-treesitter": { "branch": "master", "commit": "958fcfa0d8ce46d215e19cc3992c542f576c4123" },
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
"completion-vcard": { "branch": "master", "commit": "2220fd517a985ececed1adcf0e5be8f2815564c7" },
"conform.nvim": { "branch": "master", "commit": "797d1f622a23d4a21bb58218bdf5999a9beac4ef" },
"conform.nvim": { "branch": "master", "commit": "60e6fbddbdf37d7790de07dc7420beefaf650e5e" },
"dial.nvim": { "branch": "master", "commit": "54b503f906bc9e5ab85288414840a1b86d40769f" },
"dressing.nvim": { "branch": "master", "commit": "572314728cb1ce012e825fd66331f52c94acac12" },
"fidget.nvim": { "branch": "main", "commit": "ef99df04a1c53a453602421bc0f756997edc8289" },

View file

@ -39,7 +39,6 @@ local servers = {
basedpyright = {},
ruff = {},
serve_d = {},
tailwindcss = {},
taplo = {},
texlab = {},
tsserver = {},

View file

@ -16,21 +16,21 @@ local formatters = {
astro = { { "prettierd", "prettier" } },
bash = { "shfmt" },
bib = { "bibtex-tidy" },
css = { { "prettierd", "prettier" } },
css = { { "prettierd", "prettier" }, "rustywind" },
graphql = { { "prettierd", "prettier" } },
html = { { "prettierd", "prettier" } },
html = { { "prettierd", "prettier" }, "rustywind" },
javascript = { { "prettierd", "prettier" } },
javascriptreact = { { "prettierd", "prettier" } },
json = { "jq" },
liquid = { { "prettierd", "prettier" } },
lua = { "stylua" },
markdown = { { "prettierd", "prettier" } },
python = { "ruff_fix", "ruff_format" },
python = { "ruff_fix", "ruff_format", "ruff_organize_imports" },
sh = { "shfmt" },
svelte = { { "prettierd", "prettier" } },
typescript = { { "prettierd", "prettier" } },
typescriptreact = { { "prettierd", "prettier" } },
vue = { { "prettierd", "prettier" } },
vue = { { "prettierd", "prettier" }, "rustywind" },
yaml = { { "prettierd", "prettier" } },
zsh = { "shfmt" },
}
@ -141,7 +141,7 @@ return {
"stevearc/conform.nvim",
config = function()
require("conform").setup({
lsp_fallback = true,
lsp_format = "fallback",
format_after_save = function(bufnr)
if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then
return
@ -149,12 +149,6 @@ return {
return { lsp_fallback = true }
end,
formatters_by_ft = formatters,
formatters = {
-- enable python isort functionality
ruff_fix = {
prepend_args = { "--select", "I" },
},
},
})
vim.api.nvim_create_user_command("FormatDisable", function(args)
if args.bang then
@ -202,7 +196,7 @@ return {
end,
},
},
event = { "BufReadPost", "BufNewFile", "BufWritePre" },
event = { "BufWritePre" },
opts = {},
},
@ -225,6 +219,28 @@ return {
},
},
-- automatic docstring creation for a variety of languages
{
"danymat/neogen",
dependencies = "nvim-treesitter/nvim-treesitter",
opts = {
snippet_engine = "luasnip",
},
cmd = {
"Neogen",
},
keys = {
{
"<localleader>lg",
function()
require("neogen").generate()
end,
silent = true,
desc = "generate docstring",
},
},
},
-- testing setup
{
"nvim-neotest/neotest",