Add surround, sleuth & auto-save

This commit is contained in:
2024-12-26 17:44:19 +01:00
parent f37b3a700f
commit 60acf0a289
4 changed files with 45 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
return {
{
"auto-save.nvim",
lazy = false,
load = function() end,
keys = {
{
"<leader>w",
function()
vim.g.auto_save_state = not vim.g.auto_save_state
end,
desc = "Toggle autosave"
},
},
event = { "InsertLeave", "TextChanged", },
opts = {
write_all_buffers = true,
condition = function(buf)
if not vim.g.auto_save_state then
return false
end
local ft = vim.fn.getbufvar(buf, "&filetype")
return ft ~= "oil" and ft ~= "harpoon"
end,
},
after = function(plug)
vim.g.auto_save_state = true
require("auto-save").setup(plug.opt)
end,
},
}