mirror of
https://github.com/nmasur/dotfiles
synced 2024-11-22 19:15:37 +00:00
fix: gq with null-ls
This commit is contained in:
parent
a26f5dc2b5
commit
b282e76be4
@ -50,6 +50,7 @@
|
|||||||
|
|
||||||
on_attach = function(client, bufnr)
|
on_attach = function(client, bufnr)
|
||||||
if client.supports_method("textDocument/formatting") then
|
if client.supports_method("textDocument/formatting") then
|
||||||
|
-- Auto-format on save
|
||||||
vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr })
|
vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr })
|
||||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||||
group = augroup,
|
group = augroup,
|
||||||
@ -58,6 +59,12 @@
|
|||||||
vim.lsp.buf.format({ bufnr = bufnr })
|
vim.lsp.buf.format({ bufnr = bufnr })
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
-- Use internal formatting for bindings like gq.
|
||||||
|
vim.api.nvim_create_autocmd("LspAttach", {
|
||||||
|
callback = function(args)
|
||||||
|
vim.bo[args.buf].formatexpr = nil
|
||||||
|
end,
|
||||||
|
})
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user