Tuesday, February 21, 2017

Disabling persistent undo for a file mask

Hi!


In order to disable persistent undo for a file mask I have the following command in my .vimdc:

autocmd! BufRead,BufWrite *.sec setlocal ul=-1

However, I noticed the following strange behaviour:

1. I save an empty buffer with :saveas file.sec command: no undo file present
2. I add text and save this now named buffer with :write command: undo file appears
3. I add more text and save this buffer again with :write command: undo file disappears.

How do I escape the appearance of the undo file at the second step? What should I add to my autocmd?

Vim ver:
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Jan 24 2017 00:42:53)
MacOS X (unix) version
Included patches: 1-222
Compiled by Homebrew


Thanks!

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment