xianzhon / vim-code-runner

Similar code-runner plugin for vim
The Unlicense
13 stars 6 forks source link

vim-code-runner

Run code snippet or code file in vim for multiple languages: C, C++, Java, JavaScript, PHP, Python, Perl, Ruby, Go, Lua, etc.

Features

Supported vim version

Configurations

Key-bindings

By default, it binds <leader>B to run the code snippet. User can cutomize it like below:

nmap <silent><leader>B <plug>CodeRunner

Command map

User can define the command mapping like below, mapping defined here will override the default one. More details can be found with command :h CodeRunner.

let g:CodeRunnerCommandMap = {
      \ 'python' : 'python $fileName'
      \}

Save before execution

By default, after file modification, user should save it first to check the execution result of the latest file. With below setting, it will auto-save before the code execution.

let g:code_runner_save_before_execute = 1

TODOs

Thanks