Add phpcs, php-cs-fixer and phpcbf
This commit is contained in:
+14
-1
@@ -189,7 +189,20 @@ function P.on_attach(client, bufnr)
|
||||
vim.keymap.set("n", "<leader>rn", ca_rename, opts)
|
||||
vim.keymap.set("n", "<leader>ca", vim.lsp.buf.code_action, opts)
|
||||
vim.keymap.set("n", "gr", vim.lsp.buf.references, opts)
|
||||
vim.keymap.set({ "n", "x", }, "<leader>lf", function () vim.lsp.buf.format({ async = true, }) end, opts)
|
||||
vim.keymap.set(
|
||||
{ "n", "x", },
|
||||
"<leader>lf",
|
||||
function ()
|
||||
if vim.bo.filetype == "php" then
|
||||
vim.cmd("w")
|
||||
vim.lsp.buf.format({ async = false, })
|
||||
vim.cmd("e!")
|
||||
else
|
||||
vim.lsp.buf.format({ async = false, })
|
||||
end
|
||||
end,
|
||||
opts
|
||||
)
|
||||
-- if client.server_capabilities.document_range_formatting then
|
||||
-- end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user