sponsor Vim development Vim logo Vim Book Ad

scrnpipe.vim : Pipe lines from your buffer to a screen window

 script karma  Rating 0/0, Downloaded by 653  Comments, bugs, improvements  Vim wiki

created by
Trevor Little
 
script type
utility
 
description
This plugin allows you to send a range of lines from a buffer to another screen window. This could be used for all sorts of things but my motivation was to be able to edit SQL statements in a file and then send them to a open mysql client session in another window. You could also send ruby code to a running erb or bash commands to a bash prompt, etc. You could even use this as a quick way to paste between 2 vim sessions running in different windows (or even different screen sessions).

The plugin creates some mapping by default.

In normal mode || sends the current line to another screen window. In visual modes use |.

If you have a mapleader set you'll need to type that first for both mapings. See :help mapleader for more info on that.

You can create you own mappings to override these. For the normal mode do this:

nmap <whatever> <Plug>ScreenPipeSend

For visual modes do this:

vmap <whatever> <Plug>ScreenPipeOpSend

Just replace <whatever> with what you want to map of course.

Finally, this plugin also provides a :ScreenPipe command to do the same thing.

The code is available on git here:

https://github.com/bundacia/ScreenPipe

KNOWN BUGS:
1. The window list doesn't show up on the mac (but choosing the right number still works)

TODO:
1. Implement an operator.
 
install details
Just drop scrnpipe.vim in your plugins directory.
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
scrnpipe.vim 0.2 2011-03-17 7.0 Trevor Little Better support for visual mode selection. Better shell escaping so that if you try to send text that has special shel chars in it the whole thing doesn't break. Normal mode mapping is now || by default.
scrnpipe.vim 0.1 2011-03-17 7.0 Trevor Little Initial upload
ip used for rating: 3.143.168.172

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Vim at Github