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

make autocmd after buffer write optional #17

Closed
Konfekt opened this issue Mar 9, 2017 · 5 comments
Closed

make autocmd after buffer write optional #17

Konfekt opened this issue Mar 9, 2017 · 5 comments

Comments

@Konfekt
Copy link
Contributor

Konfekt commented Mar 9, 2017

For example, here's a nested autocmd that saves the buffer after Vim losing focus. So, in the likely event that CheckAttach recognizes a keyword like 'atttach', it will ask for attaching a file every time when returning to Vim.

How about making that Check optional? Instead, thinking of a mutt user that uses Vim as its text editor, the autocmd reminding the user to add an attachment when quitting Vim seems the most useful and indispensable.

@Konfekt Konfekt changed the title make reminder after buffer write optional make autocmd after buffer write optional Mar 9, 2017
@chrisbra
Copy link
Owner

chrisbra commented Mar 9, 2017

Yeah, it also often bothers me, that the check triggers on each BufWrite command. However, I am not sure, how to postpone it until just before quitting Vim and going back to mutt. And even if you could, one would not have the chance to check that the correct file has been attached. Perhaps, it would be better for your autocommand to do a :noa :w?

@Konfekt
Copy link
Contributor Author

Konfekt commented Mar 9, 2017

Well, another idea: If the user explicitely refused to attach a file, that is, escaped the attachment dialogue (hit enter or space), then further propositions could be disabled (say at least if let g:checkattach_once = 'y').

@chrisbra
Copy link
Owner

chrisbra commented Mar 9, 2017

will think about it.

@chrisbra
Copy link
Owner

Please check current head.

@Konfekt
Copy link
Contributor Author

Konfekt commented Mar 15, 2017

Thanks! Works.

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