mirror of
https://github.com/zoriya/flake.git
synced 2026-08-15 18:43:42 +00:00
Add surround, sleuth & auto-save
This commit is contained in:
@@ -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,
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user