Thursday, May 27, 2010

Re: tabdo left or right

On Thu, May 27, 2010 4:35 pm, Jürgen Krämer wrote:
> Adam wrote:
>> Does anybody know if it's possible to have :tabdo only execute on, say,
>> the tabs to the right of the current tab?
>
> I don't think so. You might have to resort to something like
>
> for t in range(tabpagenr() + 1, tabpagenr('$'))
> exe t . 'tabn'
> " do your work here
> endfor

Or even (untested!):

:com! -nargs=+ TabRightDo :let g:act_tabnr=tabpagenr()|
\ exe ":tabdo if g:act_tabnr < tabpagenr() | <args> | endif " |
\ unlet g:act_tabnr

:com! -nargs=+ TabLeftDo :let g:act_tabnr=tabpagenr()|
\exe ":tabdo if g:act_tabnr > tabpagenr() | <args> | endif " |
\unlet g:act_tabnr

regards,
Christian

--
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

No comments: