Ⅰ. 插件描述
Compiles and executes simple programs in one command.Ⅱ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'finetralfazz/vim-fastexec'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'finetralfazz/vim-fastexec'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'finetralfazz/vim-fastexec'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/finetralfazz/vim-fastexec
Ⅳ. 文档说明
#vim-fastexec
Compiles (if necessary) and executes the current file. Honestly, this feature might already be built into vim, but I didn't see it anywhere and thought making a vim plugin would be fun. It wasn't. Vimscript is the worst.
The traditional way of compiling C/++ projects in vim (from what I understand anyway) is by using the :make command. I built this because the CS course I'm taking has a lot of single-file homework assignments, and creating Makefiles for every single one would be kind of ridiculous. Switching between the terminal and vim to compile+run got annoying because I do most of my assignments in class on my MacBook, where I don't have i3's easy window switching hotkeys.
Installation
If you're using Vundle, add this line to your .vimrc:
Plugin 'finetralfazz/vim-fastexec'If you're not using Vundle, it's probably something similar.
Usage
With the file open, run :Fx.
That's it.