Friday, June 29, 2012

Re: vim: use external program, but direct output to a new vsplitted buffer

On Thursday, June 28, 2012 3:27:15 PM UTC-5, ping wrote:
> thanks Ben, for the solutions.
> looks like the default behavior is , if you selected a range of text as
> the input, then the output from external prog will overide the input
> texts...
>
> 1) to summarize as a learning excercise
> http://vim.wikia.com/wiki/Display_output_of_shell_commands_in_new_window
> this looks good when no need use range of text as input
>
> 2) :'<,>'w !ext-prog
> I found this syntax is interesting.
> it take seleted text as input, but just print the output to the screen,
> without overiding the selected text. which seems good.
>
> so using another tip I learned from a previous thread, how about this:
>
> "redirect output to reg z
> :redir @z
> "take seleted text as input, output to screen
> :'<,'> !asciidoc ...

You forgot the w. But maybe it's just a typo.

:'<,'>w !asciidoc

See :help :w_c.

> "end redirection
> :redir END
> "open a vsplit win
> :vsp
> "paste content of reg z
> "zp
>
> surprisingly I got nothing here.
>
> 3) yes asciidoc has its way to define an output filename, but my again
> that's not what I want (I want the def a similar behavior like :TOhtml)
>
> but it's not big deal. either way I can done my work, just wonder what's
> the best options here.
>
> currently I'm just using:
> :'<,'>!ext-prog
> yank the output (which overide my original texts as input)
> u to recover my text back
> open another window and paste
>

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

Post a Comment