1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-04-15 08:09:11 +08:00

Livescript2 (#2915)

* Add help file for livescript

* Add neomake support for livescript

* Fix neomake config

* Fix livescript
This commit is contained in:
Wang Shidong 2019-06-29 19:12:28 +08:00 committed by GitHub
parent 8515969dfa
commit 05163aea33
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 106 additions and 19 deletions

View File

@ -6,6 +6,35 @@
" License: GPLv3
"=============================================================================
""
" @section lang#livescript, layer-lang-livescript
" @parentsection layers
" This layer is for livescript development, disabled by default, to enable this
" layer, add following snippet to your SpaceVim configuration file.
" >
" [[layers]]
" name = 'lang#livescript'
" <
"
" @subsection Key bindings
" >
" Mode Key Function
" -------------------------------------------------------------
" normal SPC l r run current file
" <
"
" This layer also provides REPL support for livescript, the key bindings are:
" >
" Key Function
" ---------------------------------------------
" SPC l s i Start a inferior REPL process
" SPC l s b send whole buffer
" SPC l s l send current line
" SPC l s s send selection text
" <
"
function! SpaceVim#layers#lang#livescript#plugins() abort
let plugins = []
call add(plugins, ['wsdjeg/vim-livescript', { 'merged' : 0}])
@ -33,4 +62,32 @@ function! s:language_specified_mappings() abort
call SpaceVim#mapping#space#langSPC('nmap', ['l','s', 's'],
\ 'call SpaceVim#plugins#repl#send("selection")',
\ 'send selection and keep code buffer focused', 1)
call SpaceVim#mapping#space#langSPC('nnoremap', ['l','e'], 'call call('
\ . string(function('s:eval')) . ', [])',
\ 'eval code::String', 1)
" checker layer configuration
if SpaceVim#layers#isLoaded('checkers') && g:spacevim_enable_neomake
let g:neomake_livescript_enabled_makers = ['lsc']
" Failed at: test.ls
" { Error: Parse error on line 1: Unexpected 'NEWLINE'
" at test.ls
let g:neomake_livescript_lsc_maker = {
\ 'args': ['-c',],
\ 'errorformat': '%EFailed at: %f,%C{\ Error:\ Parse\ error\ on\ line\ %l:\ %m',
\ 'cwd': '%:p:h',
\ }
" Failed at: test.ls
" SyntaxError: missing `"` on line 5
" at test.ls
let g:neomake_livescript_lsc_maker.errorformat .= ',%EFailed at: %f,%CSyntaxError:\ %m\ on\ line\ %l'
let g:neomake_livescript_lsc_remove_invalid_entries = 1
endif
endfunction
function! s:eval() abort
let input = input('>>')
let cmd = ['lsc', '-e', input, expand('%:p')]
" @todo fix livescript eval function
endfunction

View File

@ -89,25 +89,26 @@ CONTENTS *SpaceVim-contents*
19. lang#java.................................|SpaceVim-layer-lang-java|
20. lang#julia...............................|SpaceVim-layer-lang-julia|
21. lang#kotlin.............................|SpaceVim-layer-lang-kotlin|
22. lang#lua...................................|SpaceVim-layer-lang-lua|
23. lang#nim...................................|SpaceVim-layer-lang-nim|
24. lang#ocaml...............................|SpaceVim-layer-lang-ocaml|
25. lang#php...................................|SpaceVim-layer-lang-php|
26. lang#pony.................................|SpaceVim-layer-lang-pony|
27. lang#processing.....................|SpaceVim-layer-lang-processing|
28. lang#prolog.............................|SpaceVim-layer-lang-prolog|
29. lang#puppet.............................|SpaceVim-layer-lang-puppet|
30. lang#python.............................|SpaceVim-layer-lang-python|
31. lang#rust.................................|SpaceVim-layer-lang-rust|
32. lang#scala...............................|SpaceVim-layer-lang-scala|
33. lang#tcl...................................|SpaceVim-layer-lang-tcl|
34. lang#xml...................................|SpaceVim-layer-lang-xml|
35. operator...................................|SpaceVim-layer-operator|
36. shell.........................................|SpaceVim-layer-shell|
37. test...........................................|SpaceVim-layer-test|
38. tmux...........................................|SpaceVim-layer-tmux|
39. tools#dash...............................|SpaceVim-layer-tools-dash|
40. tools#zeal...............................|SpaceVim-layer-tools-zeal|
22. lang#livescript.....................|SpaceVim-layer-lang-livescript|
23. lang#lua...................................|SpaceVim-layer-lang-lua|
24. lang#nim...................................|SpaceVim-layer-lang-nim|
25. lang#ocaml...............................|SpaceVim-layer-lang-ocaml|
26. lang#php...................................|SpaceVim-layer-lang-php|
27. lang#pony.................................|SpaceVim-layer-lang-pony|
28. lang#processing.....................|SpaceVim-layer-lang-processing|
29. lang#prolog.............................|SpaceVim-layer-lang-prolog|
30. lang#puppet.............................|SpaceVim-layer-lang-puppet|
31. lang#python.............................|SpaceVim-layer-lang-python|
32. lang#rust.................................|SpaceVim-layer-lang-rust|
33. lang#scala...............................|SpaceVim-layer-lang-scala|
34. lang#tcl...................................|SpaceVim-layer-lang-tcl|
35. lang#xml...................................|SpaceVim-layer-lang-xml|
36. operator...................................|SpaceVim-layer-operator|
37. shell.........................................|SpaceVim-layer-shell|
38. test...........................................|SpaceVim-layer-test|
39. tmux...........................................|SpaceVim-layer-tmux|
40. tools#dash...............................|SpaceVim-layer-tools-dash|
41. tools#zeal...............................|SpaceVim-layer-tools-zeal|
7. API........................................................|SpaceVim-api|
1. cmdlinemenu................................|SpaceVim-api-cmdlinemenu|
2. data#dict....................................|SpaceVim-api-data-dict|
@ -1557,6 +1558,35 @@ LANG#KOTLIN *SpaceVim-layer-lang-kotlin*
This layer is for kotlin development.
==============================================================================
LANG#LIVESCRIPT *SpaceVim-layer-lang-livescript*
This layer is for livescript development, disabled by default, to enable this
layer, add following snippet to your SpaceVim configuration file.
>
[[layers]]
name = 'lang#livescript'
<
KEY BINDINGS
>
Mode Key Function
-------------------------------------------------------------
normal SPC l r run current file
<
This layer also provides REPL support for livescript, the key bindings are:
>
Key Function
---------------------------------------------
SPC l s i Start a inferior REPL process
SPC l s b send whole buffer
SPC l s l send current line
SPC l s s send selection text
<
==============================================================================
LANG#LUA *SpaceVim-layer-lang-lua*