From d7e6828166620d058b17e18e64e441468c5203a1 Mon Sep 17 00:00:00 2001 From: Wang Shidong Date: Wed, 2 Oct 2019 13:29:26 +0800 Subject: [PATCH] Add lang#gosu layer (#3106) --- autoload/SpaceVim/layers/lang/gosu.vim | 25 +++++++++++++++++ docs/cn/layers.md | 1 + docs/cn/layers/lang/gosu.md | 34 ++++++++++++++++++++++ docs/layers.md | 1 + docs/layers/lang/gosu.md | 39 ++++++++++++++++++++++++++ wiki/en/programming-languages.md | 5 ++-- 6 files changed, 102 insertions(+), 3 deletions(-) create mode 100644 autoload/SpaceVim/layers/lang/gosu.vim create mode 100644 docs/cn/layers/lang/gosu.md create mode 100644 docs/layers/lang/gosu.md diff --git a/autoload/SpaceVim/layers/lang/gosu.vim b/autoload/SpaceVim/layers/lang/gosu.vim new file mode 100644 index 000000000..a9518eb8e --- /dev/null +++ b/autoload/SpaceVim/layers/lang/gosu.vim @@ -0,0 +1,25 @@ +"============================================================================= +" gosu.vim --- gosu language support +" Copyright (c) 2016-2019 Wang Shidong & Contributors +" Author: Wang Shidong < wsdjeg@outlook.com > +" URL: https://spacevim.org +" License: GPLv3 +"============================================================================= + +function! SpaceVim#layers#lang#gosu#plugins() abort + let plugins = [] + call add(plugins, ['wsdjeg/vim-gosu', { 'merged' : 0}]) + return plugins +endfunction + +function! SpaceVim#layers#lang#gosu#config() abort + call SpaceVim#plugins#runner#reg_runner('gosu', 'gosu %s') + call SpaceVim#mapping#space#regesit_lang_mappings('gosu', function('s:language_specified_mappings')) + " @todo add repl support for gosu + " gosu language do not support repl as I know, here is issue link: + " https://github.com/gosu-lang/gosu-lang/issues/155 +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/docs/cn/layers.md b/docs/cn/layers.md index b1e337028..822726f12 100644 --- a/docs/cn/layers.md +++ b/docs/cn/layers.md @@ -103,6 +103,7 @@ Vim 插件以及相关配置。而 SpaceVim 是以模块的方式来组织和管 | [lang#fsharp](lang/fsharp/) | 这一模块为 SpaceVim 提供了 FSharp 的开发支持,包括代码补全、语法检查、代码格式化等特性。 | | [lang#go](lang/go/) | 这一模块为 SpaceVim 提供了 Go 的开发支持,包括代码补全、语法检查、代码格式化等特性。 | | [lang#goby](lang/goby/) | 这一模块为 goby 开发提供支持,包括交互式编程、一键运行等特性。 | +| [lang#gosu](lang/gosu/) | 这一模块为 gosu 开发提供支持,包括交互式编程、一键运行等特性。 | | [lang#groovy](lang/groovy/) | 这一模块为 Groovy 开发提供支持,包括交互式编程、一键运行等特性。 | | [lang#hack](lang/hack/) | 这一模块为 hack 开发提供支持,包括交互式编程、一键运行等特性。 | | [lang#haskell](lang/haskell/) | 这一模块为 SpaceVim 提供了 Haskell 的开发支持,包括代码补全、语法检查、代码格式化等特性。 | diff --git a/docs/cn/layers/lang/gosu.md b/docs/cn/layers/lang/gosu.md new file mode 100644 index 000000000..28d7646ac --- /dev/null +++ b/docs/cn/layers/lang/gosu.md @@ -0,0 +1,34 @@ +--- +title: "SpaceVim lang#gosu 模块" +description: "这一模块为 gosu 开发提供支持,包括交互式编程、一键运行等特性。" +lang: cn +--- + +# [可用模块](../../) >> lang#gosu + + + +- [模块简介](#模块简介) +- [启用模块](#启用模块) +- [快捷键](#快捷键) + + + +## 模块简介 + +这一模块为在 SpaceVim 中进行 gosu 开发提供了支持。 + +## 启用模块 + +可通过在配置文件内加入如下配置来启用该模块: + +```toml +[[layers]] + name = "lang#gosu" +``` + +## 快捷键 + +在编辑 gosu 文件时,可通过快捷键 `SPC l r` 快速异步运行当前文件,运行结果会展示在一个独立的执行窗口内。 + + diff --git a/docs/layers.md b/docs/layers.md index d1f7e7869..9ed4c4570 100644 --- a/docs/layers.md +++ b/docs/layers.md @@ -110,6 +110,7 @@ Some layers are enabled by default. The following example shows how to disable ` | [lang#fsharp](lang/fsharp/) | This layer adds FSharp language support to SpaceVim | | [lang#go](lang/go/) | This layer is for golang development. It also provides additional language-specific key mappings. | | [lang#goby](lang/goby/) | This layer is for goby development, provide syntax checking, code runner and repl support for goby file. | +| [lang#gosu](lang/gosu/) | This layer is for gosu development, provide syntax checking, code runner and repl support for gosu file. | | [lang#graphql](lang/graphql/) | This layer adds GraphQL file support to SpaceVim | | [lang#groovy](lang/groovy/) | This layer is for Groovy development, provide syntax checking, code runner and repl support for groovy file. | | [lang#hack](lang/hack/) | This layer is for hack development, provide syntax checking, code runner and repl support for hack file. | diff --git a/docs/layers/lang/gosu.md b/docs/layers/lang/gosu.md new file mode 100644 index 000000000..0d8597357 --- /dev/null +++ b/docs/layers/lang/gosu.md @@ -0,0 +1,39 @@ +--- +title: "SpaceVim lang#gosu layer" +description: "This layer is for gosu development, provide syntax checking, code runner and repl support for gosu file." +--- + +# [Available Layers](../../) >> lang#gosu + + + +- [Description](#description) +- [Install](#install) +- [Features](#features) +- [Key bindings](#key-bindings) + - [Running current script](#running-current-script) + + + +## Description + +This layer is for gosu development. + +## Install + +To use this configuration layer, update custom configuration file with: + +```toml +[[layers]] + name = "lang#gosu" +``` +## Features + +- code runner + +## Key bindings + +### Running current script + +To running a gosu file, you can press `SPC l r` to run current file without loss focus, and the result will be shown in a runner buffer. + diff --git a/wiki/en/programming-languages.md b/wiki/en/programming-languages.md index 551fb12ae..c64b4e982 100644 --- a/wiki/en/programming-languages.md +++ b/wiki/en/programming-languages.md @@ -6,6 +6,8 @@ | Assembly | lang#assemble | | AutoHotkey | lang#autohotkey | | Bash, Fish, zsh | lang#sh | +| Gosu | lang#gosu | +| Idris | lang#idris | | C# | lang#csharp | | C/C++ | lang#c | | CoffeeScript | lang#coffeescript | @@ -129,14 +131,12 @@ | GLSL | | | GML | | | GNU Octave | | -| Gosu | | | Haxe | | | Heron | | | HPL | | | HyperTalk | | | Icon | | | IDL | | -| Idris | lang#idris | | Inform | | | Informix-4GL | | | INTERCAL | | @@ -277,7 +277,6 @@ - chapel-lang/chapel - lucee/Lucee - eclipse/golo-lang -- gosu-lang/gosu-lang - ziglang/zig - HaxeFoundation/haxe - livecode/livecode