added a shortcut to run the formatted on a keybind in neovim

This commit is contained in:
aminnairi
2023-12-06 04:48:02 +01:00
parent 7993743dc6
commit 305fff1968
@@ -7,4 +7,22 @@ return {
php = { "phpcbf" }
},
},
init = function()
local whichKey = require("which-key");
local conform = require("conform")
whichKey.register({
["<leader>f"] = {
name = "Format",
f = {
function()
local currentFileBufferNumber = vim.fn.bufnr("%")
conform.format({ bufnr = currentFileBufferNumber })
end,
"Format the current file"
}
}
})
end,
}