.config/nvim/lua/config/autocmds.lua

changeset 1129
1bd6edeaf6ae
parent 1088
c221227cbba5
child 1157
a237720efee9
equal deleted inserted replaced
1128:30d81fbc6a7b 1129:1bd6edeaf6ae
15 -- Stopinsert on leave, or autowriteall doesn't work. 15 -- Stopinsert on leave, or autowriteall doesn't work.
16 autocmd(g, { "WinLeave", "FocusLost" }, "*", function() 16 autocmd(g, { "WinLeave", "FocusLost" }, "*", function()
17 if fn.pumvisible() == 0 then 17 if fn.pumvisible() == 0 then
18 cmd.stopinsert() 18 cmd.stopinsert()
19 end 19 end
20 cmd.wa() 20 pcall(cmd.wa)
21 end) 21 end)
22 22
23 -- >> auto mkpath on write 23 -- >> auto mkpath on write
24 autocmd(g, "BufWritePre", "*", { 24 autocmd(g, "BufWritePre", "*", {
25 callback = function(ctx) 25 callback = function(ctx)

mercurial