> after searching for a while I couldn't find an exact solution for my > problem. > Therefore I ask here and hope not to bother. > > I have a textfile with several shell statements. I want to be able to > visually mark one of them and to execute the marked one in an external > shell. The output of this command should go to a new vim window (e.g. > split one). > > Is this possible? When yes, how?
Shooting from the hip (meaning the below is untested), I'd do something like :nnoremap <f4> yy<c-w>nP:%!sh<cr> :vnoremap <f4> y<c-w>nP:%!sh<cr> This will allow you to hit <f4> and execute the current line into a new window, or visually highlight a range of 1+ lines and execute them into a new window. If you want to process with your favorite shell instead of "sh", just s/sh/your_favorite_shell/ The only side-effect is that your scratch-register (@") and your yank-register (@0) get replaced with your command to be executed. -tim --~--~---------~--~----~------------~-------~--~----~ You received this message from the "vim_use" maillist. For more information, visit http://www.vim.org/maillist.php -~----------~----~----~----~------~----~------~--~---
