From f89e212da758a137d11187668e5d294cfa776448 Mon Sep 17 00:00:00 2001 From: salomaestro Date: Sat, 22 Feb 2025 01:22:59 +0100 Subject: [PATCH] Fixed a long standing bug where fm didnt format python files correctly --- lua/configs/conform.lua | 2 +- lua/configs/lspconfig.lua | 1 - lua/options.lua | 1 + 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/configs/conform.lua b/lua/configs/conform.lua index 3f21923..79ce8c6 100644 --- a/lua/configs/conform.lua +++ b/lua/configs/conform.lua @@ -4,7 +4,7 @@ local options = { -- css = { "prettier" }, -- html = { "prettier" }, -- python = { "isort", "black" }, - python = { "ruff" }, + python = { "isort", "ruff_fix", "ruff_format" }, yaml = { "prettier" }, }, diff --git a/lua/configs/lspconfig.lua b/lua/configs/lspconfig.lua index 562a17e..0c08797 100644 --- a/lua/configs/lspconfig.lua +++ b/lua/configs/lspconfig.lua @@ -33,7 +33,6 @@ lspconfig.ruff.setup({ ignore = {"F401", "W191"}, preview = true, } - -- Ruff language server settings go here } } }) diff --git a/lua/options.lua b/lua/options.lua index 70db6ff..b5dbead 100644 --- a/lua/options.lua +++ b/lua/options.lua @@ -4,6 +4,7 @@ vim.o.cursorlineopt ='both' -- to enable cursorline! vim.o.scrolloff = 10 vim.opt.relativenumber = true vim.g.wiki_root = "~/wiki" +vim.o.formatexpr = "v:lua.require'conform'.formatexpr()" local highlight_group = vim.api.nvim_create_augroup("yankhighlight", { clear = true }) vim.api.nvim_create_autocmd("textyankpost", {