Running a formatter in a specific directory #616
-
Hey folks, I configured
Is there a way for |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
By default, null-ls will resolve its root directory from a few patterns, the most common of which is a Git root. You can either modify root directory detection based on your project or set the local ufmt = {
method = null_ls.methods.FORMATTING,
filetypes = { "python" },
generator = null_ls.formatter({
command = "ufmt",
args = {
"format",
"$FILENAME",
},
stdin = false,
to_temp_file = true,
}),
cwd = function(params)
return vim.fn.fnamemodify(params.bufname, ":p:h")
end,
} |
Beta Was this translation helpful? Give feedback.
By default, null-ls will resolve its root directory from a few patterns, the most common of which is a Git root. You can either modify root directory detection based on your project or set the
cwd
for the process dynamically (I haven't tested this, but it should get you on the right track):