packer.nvim
packer.nvim copied to clipboard
Way to get or add luarocks package bin path
I installed luaformatter but when running :Format command, it cannot find lua-format.
use {
'mhartington/formatter.nvim',
config = function()
require("formatter").setup({
logging = false,
filetype = {
lua = {
function()
return {exe = "lua-format", args = {}, stdin = true}
end
},
}
})
end
}
However I noticed the lua-format bin is available under following directory.
~/.cache/nvim/packer_hererocks/2.0.5/bin
Is there a way to get the path to bin grammatically so I can set env.
Wrong project? :)
Did you install lua-format via packer's Luarocks integration? That's a somewhat unusual use of it - it's mostly meant for installing libraries as modules.
I wouldn't really recommend installing binaries this way, but you could look at the code in packer.luarocks to see what paths we do/could possibly expose for this kind of use.
I can't think of a reason why I shouldn't do this. formatter depends on one of the packages. In this case it happened to be a binary.
I have no clue how to add bin to the PATH. But I created a pull request to add an API to expose the path to bin.
#515