update nvim plugins
This commit is contained in:
@ -33,7 +33,22 @@ return {
|
||||
|
||||
local keymap = vim.keymap
|
||||
local fmt_func = function()
|
||||
vim.lsp.buf.format({ async = true })
|
||||
local null_ls_active = false
|
||||
for _, client in ipairs(vim.lsp.get_clients({ bufnr = 0 })) do
|
||||
if client.name == "null-ls" then
|
||||
null_ls_active = true
|
||||
break
|
||||
end
|
||||
end
|
||||
vim.lsp.buf.format({
|
||||
async = true,
|
||||
filter = function(client)
|
||||
if null_ls_active then
|
||||
return client.name == "null-ls"
|
||||
end
|
||||
return true
|
||||
end,
|
||||
})
|
||||
end
|
||||
keymap.set('n', '<leader>ii', fmt_func, { noremap = true, silent = true })
|
||||
|
||||
|
||||
Reference in New Issue
Block a user