mirror of
https://github.com/aminnairi/dotfiles.git
synced 2026-09-14 19:12:13 +02:00
added a shortcut to run the formatted on a keybind in neovim
This commit is contained in:
@@ -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,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user