Thinca wrote:
> 2012/7/7 Bram Moolenaar <[email protected]>:
>
> > This does not appear to be the right solution. It also affects a
> > command like ":n foo*" even though that should obey 'wildignore'.
>
> Backtick can avoid any special characters, including wildcard.
> Thus, there is no reason for applying 'wildignore'.
> ":n foo*" does not relate on this discussion. This is not escaped by
> backtick.
>
>
> > Your example is about passing a literal string. But it might as well be
> > an expression that returns a list of file names. Again, 'wildignore'
> > should apply then.
>
> A list of file names is not a wildcard.
>
> :args `=['a.txt', 'b.bak', 'c.txt']`
>
> This should be equal to:
>
> :args a.txt b.bak c.txt
>
> Not the following.
>
> :args a.txt c.txt
>
>
> > Why would the user want to use backticks instead?
>
> For example, I want to open a new file "file[a].txt".
>
> :e file[a].txt
>
> This is often successful. But, if file "filea.txt" exists, Vim opens it.
> I try to avoid it by escape.
>
> :e file\[a].txt
>
> However, this doesn't work well on MS Windows. "\" is treated as a
> directory separator.
> Like this, the escape by "\" does not work. fnameescape() is useless.
> I try escape according to advice of ":help wildcard".
>
> :e file\[[]a].txt
>
> But, this also doesn't work. I don't know the reason.
> Additionally, this way is too complex.
> So, I use backtick to avoid this problem.
>
> :e `='file[a].txt'`
>
> This works well.
You are misusing backticks. The normal use is something like:
:e `glob(pattern)`
Vim can't really make a difference for what expression you use inside
the backticks. That would be too complicated.
If we want something to take the expression literally we would need
another mechanism. Perhaps a command modifier that disables wildcard
expansion, something like:
:nowild e file[a].txt
--
hundred-and-one symptoms of being an internet addict:
98. The Alta Vista administrators ask you what sites are missing
in their index files.
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
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