auto-save.nvim icon indicating copy to clipboard operation
auto-save.nvim copied to clipboard

Disable auto save for specific file types?

Open niksingh710 opened this issue 1 year ago • 1 comments

How can i disable auto save for specific file types like markdown?

niksingh710 avatar Aug 11 '24 10:08 niksingh710

Something like this:

	condition = function(buf)
		local fn = vim.fn
		local utils = require("auto-save.utils.data")

		if
			fn.getbufvar(buf, "&modifiable") == 1 and
			utils.not_in(fn.getbufvar(buf, "&filetype"), {"markdown"}) then
			return true -- met condition(s), can save
		end
		return false -- can't save
	end,

See the README

primeapple avatar Aug 21 '24 06:08 primeapple