tube.vim


Ⅰ. 插件描述

Painless MacVim/Terminal interaction

Ⅱ. 基本信息

创建日期:  2013-01-19
使用用户:  11
Github星:  9
插件作者:  geck

Ⅲ. 安装方法

使用Vundle管理器安装

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

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

使用NeoBundle管理器安装

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

使用VimPlug管理器安装

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

使用Pathogen管理器安装

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

Ⅳ. 文档说明

## tube.vim

Tube provides a tiny interface for sending commands from MacVim to a separate
iTerm or Terminal window without losing focus of MacVim.

Installation

Install with Vundle, Pathogen
or Neobundle.

By default Tube sends commands to Terminal.app but if you prefer using
iTerm.app set the following variable in your .vimrc file:

let g:tube_terminal = "iterm"

Basic usage

To send commands to a separate terminal window use the :Tube command:

:Tube echo "Hello world!"

This executes the given command in a separate terminal window without losing focus
of MacVim. If the window does not exist yet, then it is created.

Some characters have a special meaning and are expanded as described below:

  • %: this character is replaced with current buffer name.
  • @: this character is replaced with current selection (or the current
  1. if nothing is currently selected).
  • <cr>: this character sequence is replaced with a carriage return.

NOTE: if you want to avoid expansion of certain characters escape them
with a backslash.

Other useful commands

:TubeClr [command] executes the given command as :Tube would, but clears the
terminal screen before executing the command.

:TubeLastCmd executes the last executed command.

:TubeCd cds into the container directory of the current buffer.

:TubeInterrupt interrupts the current running command by triggering CTRL+C
inside the terminal.

:TubeFocus gives focus to the terminal window.

TubeClose closes the terminal.

Aliasing

With the option g:tube_aliases you can set shortcuts for executing frequently
executed commands.

let g:tube_aliases = {
    \ "cmd1": "long command",
    \ "cmd2": "very long command",
\ }

To execute an aliased command use the :TubeAlias command:

:TubeAlias cmd1

To see what aliases are currently set, you can use the command :TubeAliases

添加新评论