nix/prog/nvim: restore old version of neoformat group
This commit is contained in:
parent
8d4c99f8ae
commit
ea7536542f
1 changed files with 16 additions and 1 deletions
|
@ -33,12 +33,27 @@ vim.g.neoformat_try_node_exe = 1
|
||||||
vim.g.neoformat_only_msg_on_error = 1
|
vim.g.neoformat_only_msg_on_error = 1
|
||||||
vim.g.neoformat_enabled_markdown = {"denofmt"}
|
vim.g.neoformat_enabled_markdown = {"denofmt"}
|
||||||
|
|
||||||
|
vim.cmd [[
|
||||||
|
aug fmt
|
||||||
|
au!
|
||||||
|
au BufWritePre * try | undojoin | Neoformat | catch /E790/ | Neoformat | endtry
|
||||||
|
aug END
|
||||||
|
]]
|
||||||
|
--[[ TODO: need to investigate how implement it in lua
|
||||||
local format_augroup = vim.api.nvim_create_augroup('format', {})
|
local format_augroup = vim.api.nvim_create_augroup('format', {})
|
||||||
vim.api.nvim_create_autocmd('BufWritePre', {
|
vim.api.nvim_create_autocmd('BufWritePre', {
|
||||||
pattern = '*',
|
pattern = '*',
|
||||||
group = spell_check_augroup,
|
group = spell_check_augroup,
|
||||||
callback = 'try | undojoin | NeoFormat | catch /E790/ | NeoFormat | endtry'
|
callback = function ()
|
||||||
|
local ok, _ = pcall(function ()
|
||||||
|
vim.fn.undojoin();
|
||||||
|
vim.cmd'NeoFormat';
|
||||||
|
end)
|
||||||
|
|
||||||
|
if not ok then vim.cmd'NeoFormat' end
|
||||||
|
end
|
||||||
})
|
})
|
||||||
|
]]--
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
--
|
--
|
||||||
|
|
Loading…
Reference in a new issue