vim-run


Ⅰ. 插件描述

Run any file and show output inside vim

Ⅱ. 基本信息

创建日期:  2019-10-16
使用用户:  1
Github星:  1
插件作者:  leaf

Ⅲ. 安装方法

使用Vundle管理器安装

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

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

使用NeoBundle管理器安装

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

使用VimPlug管理器安装

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

使用Pathogen管理器安装

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

Ⅳ. 文档说明

# vim-run

<p align="center">
screenshot
screenshot
</p>

Run any file and show output inside vim.

Usage

With config


let g:run_cmd = {
      \'c':           'gcc -Wall -Wextra -std=c99 -pedantic',
      \'c_plus':      './a.out',
      \'python':      'python',
      \'javascript':  'node',
      \'vim':         'source',  
      \}

Open a tmp.c or tmp.py file and Press go in NORMAL mode. Vim will run the file and split a window that displays output.

Installation

<details>
<summary>How to install</summary>



</details>

Please stay up to date. Feel free to open an issue or a pull request.

Configuration

g:run_cmd: { key: <filetype>[_plus], value: cmd }

  • description:

    <filetype> specifies cmd to run file and generate output. File name will be appended to it. If there is % or %:r in cmd, they are replaced by file name and file name without extension. File name won't be appended in this case.

    <filetype>_plus specifies cmd to generate output. It's optional. It's useful if previous cmd only compiles file, for example.

  • type: Dictionry
  • default: Undefined
  • example:

    let markdown_to_html = 'pandoc 
          \ --metadata title="%" 
          \ -c http://cdn.bootcss.com/bootstrap/3.3.5/css/bootstrap.min.css 
          \ -s % -o %:r.html'
    
    let g:run_cmd = {
          \'c':             'gcc -Wall -Wextra -std=c99 -pedantic',
          \'c_plus':        './a.out',
          \'cpp':           'g++ -Wall -Wextra -pedantic',
          \'javascript':    'node',
          \'python':        'python',
          \'markdown':      markdown_to_html,
          \'markdown_plus': 'open %:r.html',
          \}

g:run_mapping

  • description: run file mapping.
  • default: 'go'
  • example:

    let g:run_mapping = '<F5>'

g:run_output_focus

  • description: focus output window.
  • default: 0

g:run_output_scroll_bottom

  • description: let output window scroll to bottom.
  • default: 0

添加新评论