vim-sendtowindow


Ⅰ. 插件描述

Small vim plugin implementing a send-to-window operator.

Ⅱ. 基本信息

创建日期:  2016-09-11
使用用户:  4
Github星:  27
插件作者:  Karolis Koncevičius

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'kkpmw/vim-sendtowindow'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'kkpmw/vim-sendtowindow'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'kkpmw/vim-sendtowindow'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/kkpmw/vim-sendtowindow

Ⅳ. 文档说明

# vim-sendtowindow

Vim operator to send text from one window to another.

Main use case is sending code to and from the REPL running inside :terminal buffer.

Demo

  1. Sending lines using motions

demo1

  1. Sending parts of a line using motions

demo2

  1. Sending paragraphs using text objects

demo3

  1. Sending text using visual selections

demo4

  1. Sending commands back - from REPL to script

demo5

Installation

With your favorite plugin manager. In my case it's vim-plug:

Plug 'KKPMW/vim-sendtowindow'

Or manually copy the contents of the plugin folder to your
./vim/plugin/ directory.

Features

  • Can send text between any two adjacent vim windows.
  • Text can be defined by visual selection, motions and text objects.
  • Tries to position the cursor in a convenient place after each call.
  • Dot repeatable.

Maps

By default it uses the following maps:

  • <space>l sends to the right window
  • <space>k sends to the top window
  • <space>j sends to the bottom window
  • <space>h sends to the left window

In order to change the above key maps add the following to you vimrc:

let g:sendtowindow_use_defaults=0

And then remap the commands as you see fit.
For example this would map all the commands to L, H, K and J respectively:

nmap L <Plug>SendRight
xmap L <Plug>SendRightV
nmap H <Plug>SendLeft
xmap H <Plug>SendLeftV
nmap K <Plug>SendUp
xmap K <Plug>SendUpV
nmap J <Plug>SendDown
xmap J <Plug>SendDownV

添加新评论