There is a difference between the expansion of % and Ctrl-R % on the
command line.
I use Dropbox to keep a number of my configuration files, including
my ~/.vim directory, synchronized between various machines running
Linux and Windows.
Today I discovered this file in the ~/Dropbox/vimfiles of a machine
named toucan which is running Fedora 14:
filetype (toucan's conflicted copy 2014-03-01).vim
Using a GUI file manager, I opened this file with gvim. I made some
changes to it, then tried comparing the changed buffer with the
copy on disk with this command which I have used for years:
:w !diff "%" -
The result surprised me.
diff: Dropbox/vimfiles/filetype \(toucan's conflicted copy
2014-03-01\).vim: No such file or directory
shell returned 2
However, if instead I typed
:w !diff "^R%" -
where ^R means Ctrl-R, the command became
:w !diff "Dropbox/vimfiles/filetype (toucan's conflicted copy
2014-03-01).vim" -
and worked fine.
So, Ctrl-R % expands to just the file name, but % alone expands with
parenthesis escaped by backslashes. This latter behavior seems like
a bug.
I was using Vim 7.4.192 on Fedora 14.
Regards,
Gary
--
--
You received this message from the "vim_dev" 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_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.