require("which-key").add({ "co", function() vim.lsp.buf.code_action({ apply = true, context = { only = { "source.organizeImports" }, -- Or the specific ruff identifier if known }, bufnr = vim.api.nvim_get_current_buf(), }) end , name = "Organize Imports" })