Ⅰ. 插件描述
Run your code on-the-fly in VimⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin '0x84/vim-coderunner'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle '0x84/vim-coderunner'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug '0x84/vim-coderunner'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/0x84/vim-coderunner
Ⅳ. 文档说明
vim-coderunner
What is the CodeRunner?
CodeRunner is the best way to write code on your Mac. You can run code in almost any language instantly, and you'll be surprised by the powerful set of features in such a lightweight and easy-to-use editor.
This simple plugin aims to mimic that, and i have used some scripts from CodeRunner. //Salute
Demo:
Languages supported
- Go
- PHP
- Perl
- Ruby
- Python
- NodeJS
- Java
- Lua
- Bash
- Zsh
- Fish
- AppleScript (OS X only)
- Swift (OS X only)
- C (OS X only)
- C++ (OS X only)
- Objective-C/C++ (OS X only)
You can extend it, see :help vim-coderunner-settings
Installation
You can use the Vundle to install:
BundleInstall 0x84/vim-coderunner
Usage
nmap <leader>r Run entire file (doesn't have to be saved)
vmap <leader>r Run current or selected line(s)
In MacVim, you can use ⌘R to run the code.
:RunCode [language] Run entire file in {language}
:AutoRun [language] Enable/Disable AutoRun Mode by BufWritePost. 