Sunday, November 29, 2020

Re: How to combine windo/tabdo with a shortcutted command?

If you're duplicating keystrokes you might hit in normal mode, the command is :normal, so something like might work:

tabdo windo normal dd
tabdo windo normal Ihello<esc>

--

Salman

On Sun, Nov 29, 2020, 13:10 <tuxic@posteo.de> wrote:
Hi Tim,

thanks for your reply!

Is there a more general way to acchieve this?

If I would had asked:
"I have a command, which is known by its shortcut only: How can I
execute this command for each tab or each window by using tabdo or
window respectively?"

Is there an answer even if the command itsself is not know first hand?

Cheers!
Meino



On 11/27 09:59, Tim Chase wrote:
> On 2020-11-27 07:44, tuxic@posteo.de wrote:
> > suppose I want to delete a line in each window or tab I currently
> > have in my vim...how can I do a
> >
> >     windo
> > or
> >
> >     tabdo
> >
> > combined with 'dd' (and I am too lazy to lookup the command name
> > in the help for each shortcut I want to use this way... ;)
>
> Well for the "dd" case, that's the same as the ex ":d" command so you
> can do
>
>   :windo d
>   :tabdo d
>
> assuming that the cursor is positioned on the right line.  If it's a
> particular line like the first or last line in the file, you can
> specify that:
>
>   :windo 1d
>   :windo $d
>
> or if it's all lines matching a pattern,
>
>   :windo g/pattern/d
>
> -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/20201127095949.1f6b9036%40bigbox.attlocal.net.
>

--
--
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/20201129181017.huebjeeyumb7crfq%40solfire.

--
--
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/CANuxnEd7zKr0-k3PJ9hN9ftnvXC%3D11ug7M0ocZTOWv56YH6vYA%40mail.gmail.com.

No comments:

Post a Comment