vim-run


Ⅰ. 插件描述

:runner: A Neovim plugin to run the current filetype.

Ⅱ. 基本信息

创建日期:  2016-02-21
使用用户:  3
Github星:  5
插件作者:  Steve Dignam

Ⅲ. 安装方法

使用Vundle管理器安装

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

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

使用NeoBundle管理器安装

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

使用VimPlug管理器安装

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

使用Pathogen管理器安装

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

Ⅳ. 文档说明

# vim-run

A plugin to run the current file in a terminal split using neovim's terminal functionality.

This plugin is based on vim-go's :GoRun.

Requires Neovim

Install

vim-plug

Plug 'sbdchd/vim-run'

Usage

Run the current file with the default shebang / command.

:Run

To specify a command to run the current file, pass the command and its arguments
to :Run. The filepath will be automatically appended.

:Run python3 -b -E

Run the current file using a specific filetype.

:Run javascript

If you wish to end execution before the program has returned, simply type
<ctrl> + c or return to normal mode by hitting <escape> and then type :q.

If the file has a shebang, :Run will execute the file using that shebang.
Otherwise, :Run will use the default command for the filetype.

Configuration [Optional]

You can define your own default commands for specific filetypes.

Note: Your command must be in the naming scheme g:run_cmd_<FILETYPE>.

If your command is only one element long, then the filepath with be added automatically.

let g:run_cmd_python = ['python3']

A more advance example.

let g:run_cmd_java = [
                \ 'javac',
                \ '-g:none',
                \ run#defaults#fullfilepath(),
                \ '&&',
                \ 'java',
                \ run#defaults#basefilename()
                \ ]

Enabled auto-closing of :Run output window when the command exits.

let g:run_auto_close = 1

Choose the direction of splitting (up, down, left, right).

let g:run_split = 'down'

Supported Filetypes

  • Applescript
  • Bash
  • Coffescript
  • Elixir
  • Erlang (Escript)
  • Go
  • Haskell (GHCI)
  • Idris
  • Java
  • Javascript (Node)
  • Lua
  • Moonscript
  • Perl
  • Php
  • Python
  • Ruby
  • Sh
  • Typescript

添加新评论