1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-02 22:40:06 +08:00

feat(runner): add ctrl-` to close code runner windows

This commit is contained in:
wsdjeg 2022-10-23 14:04:09 +08:00
parent a392dc347b
commit 70e3570082
3 changed files with 11 additions and 0 deletions

View File

@ -223,6 +223,8 @@ function! SpaceVim#default#keyBindings() abort
nnoremap <silent> <c-g> :<c-u>call SpaceVim#plugins#ctrlg#display()<cr>
endif
nnoremap <silent> <C-`> :<c-u>call SpaceVim#plugins#runner#close()<Cr>
" Improve scroll, credits: https://github.com/Shougo
nnoremap <expr> zz (winline() == (winheight(0)+1) / 2) ?

View File

@ -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 = {

View File

@ -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.