Ⅰ. 插件描述
Run inline code, runⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'hlissner/vim-forrestgump'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'hlissner/vim-forrestgump'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'hlissner/vim-forrestgump'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/hlissner/vim-forrestgump
Ⅳ. 文档说明
vim-forrestgump
One thing I miss from textmate? ⌘R and ⌥⌘R.
The former would run the current script and display output in a separate
- The latter would run selected code (or the current line).
This simple plugin aims to mimic that.
Languages supported
The following interpreters should work out of the box.
let g:forrestgumps = {
"php": ["php", "<?php "],
"python": ["python"],
"ruby": ["ruby"],
"perl": ["perl"],
"javascript": ["node"],
"coffee": ["coffee"],
"sh": ["sh"]
" Example:
"&filetype": ["/usr/bin/&filetype", "Prepend this to code"]
}
If no filetype is set, it will try to find a shebang line in the script.
Usage
nmap <leader>r Run entire file (doesn't have to be saved)
vmap <leader>r Run current or selected line(s)