Skip to content

Commit

Permalink
auto save handled
Browse files Browse the repository at this point in the history
  • Loading branch information
tunctugcu committed Sep 29, 2024
1 parent 23ba87a commit f1ce55f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lua/config/lazy.lua
Original file line number Diff line number Diff line change
@@ -101,6 +101,18 @@ vim.api.nvim_create_autocmd("FocusLost", {
end,
})


vim.api.nvim_create_augroup("AutoSaveOnBufferChange", { clear = true })
vim.api.nvim_create_autocmd({"TextChanged", "TextChangedI", "BufLeave"}, {
group = "AutoSaveOnBufferChange",
pattern = "*",
callback = function()
if vim.bo.modified then
vim.cmd("silent! write")
end
end,
})

-- Setup lazy.nvim
require("lazy").setup({
spec = {

0 comments on commit f1ce55f

Please sign in to comment.