diff --git a/autoload/SpaceVim/default.vim b/autoload/SpaceVim/default.vim index 14d522313..76a67ce6c 100644 --- a/autoload/SpaceVim/default.vim +++ b/autoload/SpaceVim/default.vim @@ -223,6 +223,8 @@ function! SpaceVim#default#keyBindings() abort nnoremap :call SpaceVim#plugins#ctrlg#display() endif + nnoremap :call SpaceVim#plugins#runner#close() + " Improve scroll, credits: https://github.com/Shougo nnoremap zz (winline() == (winheight(0)+1) / 2) ? diff --git a/autoload/SpaceVim/plugins/runner.vim b/autoload/SpaceVim/plugins/runner.vim index d3a5b4193..811b5b24c 100644 --- a/autoload/SpaceVim/plugins/runner.vim +++ b/autoload/SpaceVim/plugins/runner.vim @@ -356,6 +356,13 @@ function! s:stop_runner() abort endif endfunction + +function! SpaceVim#plugins#runner#close() abort + + call s:close() + +endfunction + function! SpaceVim#plugins#runner#select_file() abort let s:runner_lines = 0 let s:runner_status = { diff --git a/docs/documentation.md b/docs/documentation.md index d9ff67148..d47d6f026 100644 --- a/docs/documentation.md +++ b/docs/documentation.md @@ -2385,6 +2385,7 @@ The default color for iedit is `red`/`green` which is based on the current color SpaceVim provides an asynchronous code runner plugin. In most language layers, the key binding `SPC l r` is defined for running the current buffer. +To close the code runner windows, you can use ``Ctrl-` `` key binding. If you need to add new commands, you can use the bootstrap function. For example: Use `F5` to build the project asynchronously. @@ -2399,6 +2400,7 @@ Key bindings within code runner buffer: | `ctrl-c` | stop code runner | | `i` | open promote to insert text | + #### Custom runner If you want to set custom code runner for specific language. You need to use `SpaceVim#plugins#runner#reg_runner(ft, runner)` api in bootstrap function.