Tom Purl wrote:
I use the potwiki plugin (which is pretty sweet by the way) to keep a
plain-text wiki on my desktop that I can edit using Vim. All of my
documents are stored under my `$HOME/gtd/wiki` directory.
Occasionally, I need to do a "full-text" search of my wiki pages, which I
do using the `vimgrep` command. I use the following basic syntax:
:vimgrep /searchterm/ $HOME/gtd/wiki/*
This works pretty well, except for the fact that it always returns two
"matches" for each search: one from the "real" doc (for example,
FrontPage), and one from the backup of that doc (FrontPage~).
I would like to force Vim to not make backups of files in my wiki folder,
but still create backups for all of my other docs. I therefore tried the
following command in my _vimrc:
set backupskip=$HOME/gtd/wiki/*
This, however, didn't work. I also tried quoting the path, using a
relative path, etc. I read the autocmd-patterns help, and followed it's
recommendations, but that still didn't work.
Does anyone know what I'm missing here? Is my path incorrect, or am I
using the wrong option to achieve my goal?
Thanks in advance!
Tom Purl
Once a backup has been created, it won't spontaneously disappear. Under
Unix, you could try running the following shell command:
rm -vf ~/gtd/wiki/*~
In Windows, it'll be harder, since IIUC explicit characters after a *
wildcard aren't acted upon. Or you might try doing it in a bash shell
(from cygwin, minGW, GnuWin32, ...). (If you are prudent, use "ls" first
instead of "rm -vf" to make sure that _only_ backup files will be removed).
Oh, or maybe you could use Vim to expand the wildcards? If
!dir ~/gtd/wiki/*~
shows only the backup files, use
!del -y ~/gtd/wiki/*~
to remove them.
After that, your 'backupskip' option ought to work.
Best regards,
Tony.