1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-23 13:30:05 +08:00

Update perl support (#2570)

This commit is contained in:
Wang Shidong 2019-02-10 23:19:10 +08:00 committed by GitHub
parent 1c2aab9c55
commit 972fb6d04d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 4 deletions

View File

@ -6,6 +6,7 @@
" License: GPLv3
"=============================================================================
" let s:SYS = SpaceVim#api#import('system')
function! SpaceVim#layers#lang#perl#plugins() abort
let plugins = []
@ -17,9 +18,17 @@ endfunction
function! SpaceVim#layers#lang#perl#config() abort
let g:perldoc_no_default_key_mappings = 1
call SpaceVim#plugins#runner#reg_runner('perl', 'perl %s')
call SpaceVim#plugins#runner#reg_runner('perl', {
\ 'exe' : 'perl',
\ 'opt' : ['-'],
\ 'usestdin' : 1,
\ })
call SpaceVim#mapping#space#regesit_lang_mappings('perl', function('s:language_specified_mappings'))
call SpaceVim#plugins#repl#reg('perl', ['perl', '-de', '42'])
" if executable('perli')
" call SpaceVim#plugins#repl#reg('perl', ['perli'. (s:SYS.isWindows ? '.CMD' : '')])
" else
call SpaceVim#plugins#repl#reg('perl', ['perl', '-del'])
" endif
endfunction
function! s:language_specified_mappings() abort
nnoremap <silent><buffer> K :Perldoc<CR>

View File

@ -49,7 +49,7 @@ lang: cn
### 交互式编程
启动 `perl -de 42` 交互进程,快捷键为: `SPC l s i`
启动 `perl -del` 交互进程,快捷键为: `SPC l s i`
将代码传输给 REPL 进程执行:

View File

@ -50,7 +50,7 @@ within Perl doc windows, you can use `s` to toggle source code and the documenta
### Inferior REPL process
Start a `perl` inferior REPL process with `SPC l s i`.
Start a `perl -del` inferior REPL process with `SPC l s i`.
Send code to inferior process commands: