Sprint


Ⅰ. 插件描述

Async file running

Ⅱ. 基本信息

创建日期:  2016-12-25
使用用户:  5
Github星:  11
插件作者:  Pedro Mendonca

Ⅲ. 安装方法

使用Vundle管理器安装

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

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

使用NeoBundle管理器安装

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

使用VimPlug管理器安装

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

使用Pathogen管理器安装

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

Ⅳ. 文档说明

# Sprint 2.0
Async file running

Screenshot

tl;dr

Just like any IDE's run button this plugins just runs your code.

Dependencies

Sprint relies heavily on @skywind3000 async run, sprint also relies on Vim 8.0's async functionality. Depending on what language is being used with Sprint you will require a different dependecy check the supported languages area for reference.

  • Async run
  • Vim 8.0
  • Language compilers/interpreters

What does it do?

Sprint adds a command to vim to allow for asynchronous running of your file, perfect for testing. On compiled formats sprint will compile to the default name or use the "sprintFile" name to create a file to run, so make sure no file with this name exists.

Supported languages and language dependencies

LanguagesCompiler
CGCC
C++G++
Pythonpython
Phpphp
Javascriptnode
Javajavac
Rustrustc
Haskellghc
Latexpdflatex
Markdownpandoc(pdf)
README.mdpandoc(github styling)

Things to consider

In order to compile the contents of the buffer Sprint must save your files before executing. However after executing the file Sprint will delete the file.(Sprint is for quick testing not for final release builds, makefiles are your friend)

Installing

Use any package manager of your liking if you have Vim 8.0 and Async run. My recommendation is to use vundle with the following code.

"This checks for vim 8.0 or above before installing plugins
if v:version >= 800
    Plugin 'skywind3000/asyncrun.vim'
    Plugin 'pedsm/sprint'
endif

Using

Sprint is simple just run :Sprint at any file of the supported languages and watch the result.

Customizing

If you want Sprints to not override running programs(Ideal for programs that run for a long time you can set the following variables on your vimrc.

    let g:SprintForceRun = 0

If you want Sprint not to open the quickfix window and you rather open it manually add the following to your vimrc

    let g:SprintHidden = 1

Known Bugs

  • SprintForceRun will stop a running program but not start the following unless used twice.

To-do

Pull requests are helpful and the code base is small

  • [ ] Add more languages
  • [x] Global variables for copen
  • [ ] Global variables for cw(Error messaging)
  • [ ] Global variable for writing the file
  • [x] Global variable for override running process
  • [x] Finish the help help file
  • [ ] Add buffer mode

添加新评论