Sunday, January 5, 2020

Re: Populate arglist with files, exclude directories

On 2020-01-05 22:27, Johannes Degen wrote:
> :args `=filter(expand('**', v:true, v:true),
> '!isdirectory(v:val)')` works for me (Vim 8.2.74 on OpenBSD 6.6).
> If you checked on Windows it might mean a Windows related bug(?)

Did you get more than one result? I only got one file, testing on
FreeBSD & OpenBSD:

$ mkdir -p ~/tmp/v/{a,b}
$ for d in ~/tmp/v/{a,b,} ; echo "$d" > "$d/foo.txt" ; done
$ cd ~/tmp/v
$ vim
:args `=filter(expand('**', v:true, v:true), '!isdirectory(v:val)')`

this opens foo.txt but

:args

shows that it's the only file in the arg-list, missing "a/foo.txt" and
"b/foo.txt"

whereas

:args `find . -type f`
:args

shows all the expected files.

-tim


--
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20200105154123.48137851%40bigbox.attlocal.net.

No comments:

Post a Comment