Update init.lua
This commit is contained in:
parent
b62bd9efa0
commit
38c4421eea
4
init.lua
4
init.lua
@ -324,7 +324,11 @@ local on_attach = function(_, bufnr)
|
|||||||
|
|
||||||
-- Create a command `:Format` local to the LSP buffer
|
-- Create a command `:Format` local to the LSP buffer
|
||||||
vim.api.nvim_buf_create_user_command(bufnr, 'Format', function(_)
|
vim.api.nvim_buf_create_user_command(bufnr, 'Format', function(_)
|
||||||
|
if vim.lsp.buf.format then
|
||||||
vim.lsp.buf.format()
|
vim.lsp.buf.format()
|
||||||
|
elseif vim.lsp.buf.formatting then
|
||||||
|
vim.lsp.buf.formatting()
|
||||||
|
end
|
||||||
end, { desc = 'Format current buffer with LSP' })
|
end, { desc = 'Format current buffer with LSP' })
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user