Monday, July 27, 2020

Re: Opening files in a certain pattern [follow-up]

On 2020-07-27 18:32, Tim Chase wrote:
> You might try something like this:
>
> $ vim -p -c 'set tabpagemax=50' -c 'tabdo exec "vsp
> ".substitute(substitute(expand("%"),"dir1", "dir2", ""), "/L",
> "/A", "")' dir1/*

Apparently the "tabpagemax" doesn't get set until after Vim has
opened the args in each tab, so this doesn't work for n>10. So you
have to do the splitting after changing 'tabpagemax'. I had better
luck with this

$ vim -c 'set tabpagemax=50' -c 'args dir1/*' -c 'argdo tabe %' -c 'tabdo exec "vsp ".substitute(substitute(expand("%"),"dir1", "dir2", ""), "/L", "/A", "")'

It does open one extra window, but seems to work better than the
previous one.

-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/20200727185002.67fa0cf9%40bigbox.attlocal.net.

No comments: