diff --git a/autoload/SpaceVim/layers/lang/pony.vim b/autoload/SpaceVim/layers/lang/pony.vim index 42a6baeea..518dd8524 100644 --- a/autoload/SpaceVim/layers/lang/pony.vim +++ b/autoload/SpaceVim/layers/lang/pony.vim @@ -9,10 +9,44 @@ "" " @section lang#pony, layer-lang-pony " @parentsection layers +" This layer includes utilities and language-specific mappings for pony development. +" > +" [[layers]] +" name = 'lang#pony' +" < +" function! SpaceVim#layers#lang#pony#plugins() abort - let plugins = [] - " .pony file type - call add(plugins, ['jakwings/vim-pony', { 'on_ft' : 'pony'}]) - return plugins + let plugins = [] + " .pony file type + call add(plugins, ['wsdjeg/vim-pony', { 'on_ft' : 'pony'}]) + return plugins +endfunction + +function! SpaceVim#layers#lang#pony#config() abort + " @todo pony neomake support + " in github, there is a plugin https://github.com/killerswan/pony-currycomb.vim which provides syntastic suppotr + " checker layer configuration + if SpaceVim#layers#isLoaded('checkers') && g:spacevim_enable_neomake + let g:neomake_pony_enabled_makers = ['ponyc'] + let g:neomake_pony_ponyc_maker = { + \ 'args': ['--pass=expr', '.'], + \ 'errorformat': '%f:%l:%c: %m', + \ 'cwd': '%:p:h', + \ } + let g:neomake_livescript_lsc_remove_invalid_entries = 1 + endif + let runner = { + \ 'exe' : 'ponyc', + \ 'targetopt' : '-o', + \ 'opt' : [], + \ } + call SpaceVim#plugins#runner#reg_runner('pony', [runner, '#TEMP#']) + call SpaceVim#mapping#space#regesit_lang_mappings('pony', function('s:language_specified_mappings')) +endfunction +function! s:language_specified_mappings() abort + + call SpaceVim#mapping#space#langSPC('nmap', ['l','r'], + \ 'call SpaceVim#plugins#runner#open()', + \ 'execute current file', 1) endfunction diff --git a/doc/SpaceVim.txt b/doc/SpaceVim.txt index 3570ac840..a263cda00 100644 --- a/doc/SpaceVim.txt +++ b/doc/SpaceVim.txt @@ -1659,6 +1659,14 @@ checking, and jump to definition. ============================================================================== LANG#PONY *SpaceVim-layer-lang-pony* +This layer includes utilities and language-specific mappings for pony +development. +> + [[layers]] + name = 'lang#pony' +< + + ============================================================================== LANG#PROCESSING *SpaceVim-layer-lang-processing* diff --git a/docs/cn/layers.md b/docs/cn/layers.md index 45497085b..acff5bf13 100644 --- a/docs/cn/layers.md +++ b/docs/cn/layers.md @@ -119,6 +119,7 @@ Vim 插件以及相关配置。而 SpaceVim 是以模块的方式来组织和管 | [lang#perl](lang/perl/) | 这一模块为 Perl 开发提供支持,包括代码补全、语法检查、代码格式化等特性。 | | [lang#php](lang/php/) | 这一模块为 SpaceVim 提供了 PHP 的开发支持,包括代码补全、语法检查、代码格式化等特性。 | | [lang#plantuml](lang/plantuml/) | 这一模块为 SpaceVim 提供了 PlantUML 的开发支持,包括语法高亮、实时预览等特性。 | +| [lang#pony](lang/pony/) | 这一模块为 pony 开发提供支持,包括交互式编程、一键运行等特性。 | | [lang#powershell](lang/powershell/) | 这一模块为 powershell 开发提供支持,包括交互式编程、一键运行等特性。 | | [lang#prolog](lang/prolog/) | 这一模块为 Prolog 开发提供支持,包括交互式编程、一键运行等特性。 | | [lang#puppet](lang/puppet/) | 这一模块为 SpaceVim 提供了 Puppet 的开发支持,包括语法高亮、语言服务器支持。 | diff --git a/docs/cn/layers/lang/pony.md b/docs/cn/layers/lang/pony.md new file mode 100644 index 000000000..282da546e --- /dev/null +++ b/docs/cn/layers/lang/pony.md @@ -0,0 +1,37 @@ +--- +title: "SpaceVim lang#pony 模块" +description: "这一模块为 pony 开发提供支持,包括交互式编程、一键运行等特性。" +lang: cn +--- + +# [可用模块](../../) >> lang#pony + + + +- [模块简介](#模块简介) +- [启用模块](#启用模块) +- [快捷键](#快捷键) + - [运行当前脚本](#运行当前脚本) + + + +## 模块简介 + +这一模块为在 SpaceVim 中进行 pony 开发提供了支持。 + +## 启用模块 + +可通过在配置文件内加入如下配置来启用该模块: + +```toml +[[layers]] + name = "lang#pony" +``` + +## 快捷键 + +### 运行当前脚本 + +在编辑 pony 文件时,可通过快捷键 `SPC l r` 快速异步运行当前文件,运行结果会展示在一个独立的执行窗口内。 + + diff --git a/docs/layers.md b/docs/layers.md index 571d9f126..168df16e7 100644 --- a/docs/layers.md +++ b/docs/layers.md @@ -127,6 +127,7 @@ Some layers are enabled by default. The following example shows how to disable ` | [lang#perl](lang/perl/) | This layer is for Perl development, provide autocompletion, syntax checking, code format for Perl file. | | [lang#php](lang/php/) | PHP language support, including code completion, syntax lint and code runner | | [lang#plantuml](lang/plantuml/) | This layer is for PlantUML development, syntax highlighting for PlantUML file. | +| [lang#pony](lang/pony/) | This layer is for pony development, provide syntax checking, code runner and repl support for pony file. | | [lang#powershell](lang/powershell/) | This layer is for powershell development, provide syntax checking, code runner and repl support for powershell file. | | [lang#processing](lang/processing/) | This layer is for working on Processing sketches. It provides sytnax checking and an app runner | | [lang#prolog](lang/prolog/) | This layer is for Prolog development, provide syntax checking, code runner and repl support for prolog file. | diff --git a/docs/layers/lang/pony.md b/docs/layers/lang/pony.md new file mode 100644 index 000000000..829c70c5a --- /dev/null +++ b/docs/layers/lang/pony.md @@ -0,0 +1,39 @@ +--- +title: "SpaceVim lang#pony layer" +description: "This layer is for pony development, provide syntax checking, code runner and repl support for pony file." +--- + +# [Available Layers](../../) >> lang#pony + + + +- [Description](#description) +- [Install](#install) +- [Features](#features) +- [Key bindings](#key-bindings) + - [Running current script](#running-current-script) + + + +## Description + +This layer is for pony development. + +## Install + +To use this configuration layer, update custom configuration file with: + +```toml +[[layers]] + name = "lang#pony" +``` +## Features + +- code runner + +## Key bindings + +### Running current script + +To running a pony file, you can press `SPC l r` to run current file without loss focus, and the result will be shown in a runner buffer. +