> > > > > > > > > This one grabs the buffer contents, converts it to HTML, and sends it to > > the clipboard for pasting into WordPress or whatever. > > > > > > " Send Text Through Filter To Clipboard: > > > " http://vim.wikia.com/wiki/Use_filter_commands_to_process_text > > > function! MDC() > > > :redir @+ > > > " No output file specified so it goes to STDOUT > > > exe '!pandoc %' > > > :redir END > > > endfunction > > > > > > This morning I was monkeying with using Python in Vim to do this. That also > > works. Then you can use Python's Markdown module. > > > > > > > > > But does it though? From what I see the line: > > > > exe '!pandoc %' > > > > Is running pandoc with the *file* open in the current buffer as input, > > which means you have to have a file and you have to save it in order > > for it to work. This is similar to what was shown in previous emails, > > but what I was wondering is whether one can use something similar that > > uses buffer contents, not file contents. > > > > Regards, > > -- > > Jacobo de Vera > > http://www.jacobodevera.com > > @jovianjake
if no file is specified with -o in pandoc it goes to STDOUT, and you are using redir to redirect STOUT to the clipboard. At least that's how I understand it. Another scripting angle, esp. using Python or Ruby is just run the commands, save the file, and tell vim to open the file in a new buffer. Now that I've been playing, the redirect to the clipboard is actually even more useful, because you can use Marked2 or some other html converter/viewer to check things before loading your html up to go paste. Rick -- -- 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+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.