Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable auto save for specific file types? #90

Open
niksingh710 opened this issue Aug 11, 2024 · 1 comment
Open

Disable auto save for specific file types? #90

niksingh710 opened this issue Aug 11, 2024 · 1 comment

Comments

@niksingh710
Copy link

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

@primeapple
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants