Add keymaps and commands for turning off/on auto formatting on save.
This commit is contained in:
parent
e1d2f81f32
commit
56ee18a475
4 changed files with 51 additions and 2 deletions
|
|
@ -1,5 +1,6 @@
|
|||
local utils = require("utils")
|
||||
local inlay_hints_handler = require("inlay_hints_handler")
|
||||
local format_handler = require("format_handler")
|
||||
|
||||
local function chain_on_attach(...)
|
||||
local funcs = { ... }
|
||||
|
|
@ -18,7 +19,7 @@ local function global_on_attach(client, bufnr)
|
|||
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||
buffer = bufnr,
|
||||
callback = function()
|
||||
vim.lsp.buf.format()
|
||||
format_handler.format()
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue