mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-03-22 08:45:42 +08:00
Add test command in zig language plugin (#3970)
This commit is contained in:
parent
3d525cb8c4
commit
a9e36e0e1a
@ -19,6 +19,7 @@ endfunction
|
|||||||
|
|
||||||
function! SpaceVim#layers#lang#zig#config() abort
|
function! SpaceVim#layers#lang#zig#config() abort
|
||||||
call SpaceVim#plugins#runner#reg_runner('zig', 'zig run %s')
|
call SpaceVim#plugins#runner#reg_runner('zig', 'zig run %s')
|
||||||
|
call SpaceVim#plugins#runner#reg_runner('zig', 'zig test %s')
|
||||||
call SpaceVim#mapping#space#regesit_lang_mappings('zig', function('s:language_specified_mappings'))
|
call SpaceVim#mapping#space#regesit_lang_mappings('zig', function('s:language_specified_mappings'))
|
||||||
if executable(s:ztagsbin) && !exists('g:tagbar_type_zig')
|
if executable(s:ztagsbin) && !exists('g:tagbar_type_zig')
|
||||||
let g:tagbar_type_zig = {
|
let g:tagbar_type_zig = {
|
||||||
@ -53,6 +54,7 @@ endfunction
|
|||||||
|
|
||||||
function! s:language_specified_mappings() abort
|
function! s:language_specified_mappings() abort
|
||||||
call SpaceVim#mapping#space#langSPC('nmap', ['l','r'], 'call SpaceVim#plugins#runner#open()', 'execute current file', 1)
|
call SpaceVim#mapping#space#langSPC('nmap', ['l','r'], 'call SpaceVim#plugins#runner#open()', 'execute current file', 1)
|
||||||
|
call SpaceVim#mapping#space#langSPC('nmap', ['l','t'], 'call SpaceVim#plugins#runner#open()', 'test current file', 1)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! SpaceVim#layers#lang#zig#set_variable(opt) abort
|
function! SpaceVim#layers#lang#zig#set_variable(opt) abort
|
||||||
|
@ -34,6 +34,16 @@ To use this configuration layer, update custom configuration file with:
|
|||||||
|
|
||||||
## Key bindings
|
## Key bindings
|
||||||
|
|
||||||
### Running current script
|
### Run current file
|
||||||
|
|
||||||
|
| Mode | Key Bindings | Description |
|
||||||
|
| ------ | ------------ | ------------------------------ |
|
||||||
|
| normal | `SPC l r` | build and run the current file |
|
||||||
|
|
||||||
|
### Test current file
|
||||||
|
|
||||||
|
| Mode | Key Bindings | Description |
|
||||||
|
| ------ | ------------ | ------------------------------ |
|
||||||
|
| normal | `SPC l t` | run all tests in current file |
|
||||||
|
|
||||||
|
|
||||||
To running a zig file, you can press `SPC l r` to run current file without loss focus, and the result will be shown in a runner buffer.
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user