Skip to content

fyang93/quickrun.vim

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

quickrun.vim

GitHub version license

Yet, just another quickrun plugin for vim.

Installation

Take Vundle as an example:

  • Add Plugin 'MikeCoder/quickrun.vim' to your vimrc file.
  • Then use Vundle Install to install this plugin.

Config

In this plugin, the default run config has been set as following:

let g:quickrun_configs = {
        \"cpp": ["!g++ %", "./a.out"],
        \"c": ["!gcc %", "./a.out"],
        \"php": ["!php %"],
        \"vim": ["source %"],
        \"py": ["!python %"],
    \}

These configuration means, when you edit a file with ".cpp". You will use !g++ % && ./a.out to run this file.

So, you can add your customize configuration here. If you want to use :go test command when you edit go files. You can add your config like this:

let g:quickrun_configs = {
        \"cpp": ["!g++ %", "./a.out"],
        \"c": ["!gcc %", "./a.out"],
        \"php": ["!php %"],
        \"vim": ["source %"],
        \"py": ["!python %"],
        \"go": ["!go test"],
    \}

Here we use % to represent the file you currently edit.

This configuration you can write in your vimrc file.

Usage

  1. Auto detect the filetype.
  • When you editing your file, You can run :QuickRun to run your current file.
  • If you are editting main.c file, the command will be :!gcc main.c && ./a.out.
  1. Run with spec filetype.
  • When you editing your file, you can run :QuickRun go to run your current file.
  • If you are editting main.md, the command will be :!go test to test the whole go project.
  1. You can bind your key with nnoremap <F5> :QuickRun<cr> to enjoy the plugin.

Optional

If you installed another plugin asyncrun, then you can also use :QuickRunAsync without changing any configs.

Notice that :QuickRunAsync will invode :AsyncRun for you, it is only used for system commands such as !python foo.py.

License

See @LICENSE

TODO

See @TODO.md

About

Yet, just another quickrun plugin for vim.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Vim Script 100.0%