mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-02-09 08:50:06 +08:00
feat(repl): add i
key binding to insert text
This commit is contained in:
parent
8ec9409fda
commit
02afefa413
@ -202,6 +202,7 @@ function! s:open_windows() abort
|
|||||||
setlocal buftype=nofile bufhidden=wipe nobuflisted nolist noswapfile nowrap cursorline nospell nonu norelativenumber winfixheight nomodifiable
|
setlocal buftype=nofile bufhidden=wipe nobuflisted nolist noswapfile nowrap cursorline nospell nonu norelativenumber winfixheight nomodifiable
|
||||||
set filetype=SpaceVimREPL
|
set filetype=SpaceVimREPL
|
||||||
nnoremap <silent><buffer> q :call <SID>close()<cr>
|
nnoremap <silent><buffer> q :call <SID>close()<cr>
|
||||||
|
nnoremap <silent><buffer> i :call <SID>insert()<cr>
|
||||||
augroup spacevim_repl
|
augroup spacevim_repl
|
||||||
autocmd!
|
autocmd!
|
||||||
autocmd BufWipeout <buffer> call <SID>close_repl()
|
autocmd BufWipeout <buffer> call <SID>close_repl()
|
||||||
@ -210,3 +211,13 @@ function! s:open_windows() abort
|
|||||||
let s:winid = win_getid(winnr())
|
let s:winid = win_getid(winnr())
|
||||||
wincmd p
|
wincmd p
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! s:insert() abort
|
||||||
|
call inputsave()
|
||||||
|
let input = input('input >')
|
||||||
|
if !empty(input) && s:status.is_running == 1
|
||||||
|
call s:JOB.send(s:job_id, input)
|
||||||
|
endif
|
||||||
|
normal! :
|
||||||
|
call inputrestore()
|
||||||
|
endfunction
|
||||||
|
@ -88,7 +88,7 @@ description: "General documentation about how to use SpaceVim, including the qui
|
|||||||
- [Replace text with iedit](#replace-text-with-iedit)
|
- [Replace text with iedit](#replace-text-with-iedit)
|
||||||
- [iedit states key bindings](#iedit-states-key-bindings)
|
- [iedit states key bindings](#iedit-states-key-bindings)
|
||||||
- [Code runner](#code-runner)
|
- [Code runner](#code-runner)
|
||||||
- [Read Eval Print Loop](#read-eval-print-loop)
|
- [REPL(read eval print loop)](#replread-eval-print-loop)
|
||||||
- [Highlight current symbol](#highlight-current-symbol)
|
- [Highlight current symbol](#highlight-current-symbol)
|
||||||
- [Error handling](#error-handling)
|
- [Error handling](#error-handling)
|
||||||
- [EditorConfig](#editorconfig)
|
- [EditorConfig](#editorconfig)
|
||||||
@ -571,7 +571,6 @@ In font transient state:
|
|||||||
| `-` | decrease the font size |
|
| `-` | decrease the font size |
|
||||||
| Any other key | leave the transient state |
|
| Any other key | leave the transient state |
|
||||||
|
|
||||||
|
|
||||||
### Mouse
|
### Mouse
|
||||||
|
|
||||||
Mouse support is enabled in Normal mode and Visual mode by default.
|
Mouse support is enabled in Normal mode and Visual mode by default.
|
||||||
@ -954,7 +953,6 @@ If only one file buffer is opened, a file is opened in the active window, otherw
|
|||||||
| `s g` | open file in a vertically split window |
|
| `s g` | open file in a vertically split window |
|
||||||
| `s v` | open file in a horizontally split window |
|
| `s v` | open file in a horizontally split window |
|
||||||
|
|
||||||
|
|
||||||
#### Override filetree key bindings
|
#### Override filetree key bindings
|
||||||
|
|
||||||
If you want to override the default key bindings in filetree windows. You can use User autocmd in bootstrap function. for examples:
|
If you want to override the default key bindings in filetree windows. You can use User autocmd in bootstrap function. for examples:
|
||||||
@ -2400,12 +2398,18 @@ Key bindings within code runner buffer:
|
|||||||
| `ctrl-c` | stop code runner |
|
| `ctrl-c` | stop code runner |
|
||||||
| `i` | open promote to insert text |
|
| `i` | open promote to insert text |
|
||||||
|
|
||||||
### Read Eval Print Loop
|
### REPL(read eval print loop)
|
||||||
|
|
||||||
The REPL(Read Eval Print Loop) plugin provides a framework to run REPL command asynchronously.
|
The REPL(Read Eval Print Loop) plugin provides a framework to run REPL command asynchronously.
|
||||||
|
|
||||||
For different language, you need to checkout the doc of language layer. The repl key bindings are defined in language layer.
|
For different language, you need to checkout the doc of language layer. The repl key bindings are defined in language layer.
|
||||||
|
|
||||||
|
Key bindings within repl buffer:
|
||||||
|
|
||||||
|
| key binding | description |
|
||||||
|
| ----------- | --------------------------- |
|
||||||
|
| `i` | open promote to insert text |
|
||||||
|
|
||||||
### Highlight current symbol
|
### Highlight current symbol
|
||||||
|
|
||||||
SpaceVim supports highlighting of the current symbol on demand and add a transient state to easily navigate and rename these symbols.
|
SpaceVim supports highlighting of the current symbol on demand and add a transient state to easily navigate and rename these symbols.
|
||||||
|
Loading…
Reference in New Issue
Block a user