Friday, March 25, 2011

Grab text in command-line area & insert it to the buffer text?

To run visually selected text though a scheme interpreter and display
its output in Vim's command line area, I'm using this mapping:

" run visually selected text through the chicken scheme interpreter
vmap <silent> <leader>c :w! /tmp/scheme-snippet<cr>:!csi-vim-cmd<cr>

where csi-vim-cmd is a shell script like so:

#!/bin/sh
csi -q < /tmp/scheme-snippet | sed -e s/^\#.*$// -e s/^---\>.*$// -e /^$/d

The output of what the selected code evaluates to is displayed in
the command line area along with "Press ENTER or type command to
continue". Pressing ENTER makes it go away, but I'd like to have the
option of grabbing that output and inserting it after the selected
text, say by pressing "i" rather than ENTER at that point.

What approach(es) might I explore to achieve this functionality?

Thanks for any help,

John

--
John Magolske
http://B79.net/contact

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