Ⅰ. 插件描述
Small vim plugin implementing a send-to-window operator.Ⅱ. 基本信息
|
Ⅲ. 安装方法
使用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
- Sending lines using motions

- Sending parts of a line using motions

- Sending paragraphs using text objects

- Sending text using visual selections

- Sending commands back - from REPL to script

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>lsends to the right window<space>ksends to the top window<space>jsends to the bottom window<space>hsends 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