Run code snippet or code file in vim for multiple languages: C, C++, Java, JavaScript, PHP, Python, Perl, Ruby, Go, Lua, etc.
terminal
feature, reference)By default, it binds <leader>B
to run the code snippet. User can cutomize it like below:
nmap <silent><leader>B <plug>CodeRunner
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'
\}
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