1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-03 00:50:05 +08:00

Add lang#d layer (#2923)

This commit is contained in:
Wang Shidong 2019-07-05 22:59:13 +08:00 committed by GitHub
parent 50761ff92b
commit 04893990f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 377 additions and 273 deletions

View File

@ -0,0 +1,27 @@
"=============================================================================
" d.vim --- D programming 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#d#plugins() abort
let plugins = []
call add(plugins, ['wsdjeg/vim-dlang', {'merged' : 0}])
if g:spacevim_autocomplete_method ==# 'deoplete'
call add(plugins, ['landaire/deoplete-d', {'merged' : 0}])
endif
return plugins
endfunction
function! SpaceVim#layers#lang#d#config() abort
call SpaceVim#plugins#runner#reg_runner('d', 'dmd -run %s')
call SpaceVim#mapping#space#regesit_lang_mappings('d', 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

View File

@ -89,6 +89,7 @@ Vim 插件以及相关配置。而 SpaceVim 是以模块的方式来组织和管
| [lang#c](lang/c/) | 这一模块为 SpaceVim 提供了 C/C++/Object-C 的开发支持,包括代码补全、语法检查等特性。 |
| [lang#clojure](lang/clojure/) | 这一模块为 SpaceVim 提供了 Clojure 的开发支持,包括代码补全、语法检查、代码格式化等特性。 |
| [lang#csharp](lang/csharp/) | 这一模块为 SpaceVim 提供了 CSharp 的开发支持,包括代码高亮、对齐、补全等特性。 |
| [lang#d](lang/d/) | 这一模块为 d 开发提供支持,包括语法高亮、自动补全、一键运行等特性。 |
| [lang#dart](lang/dart/) | 这一模块为 SpaceVim 提供了 Dart 的开发支持,包括代码补全、语法检查、代码格式化等特性。 |
| [lang#dockerfile](lang/dockerfile/) | 这一模块为 SpaceVim 提供了 Dockerfile 编辑的部分功能支持,包括语法高亮和自动补全。 |
| [lang#elixir](lang/elixir/) | 这一模块为 SpaceVim 提供了 Elixir 的开发支持,包括代码补全、语法检查、代码格式化等特性。 |
@ -101,7 +102,7 @@ Vim 插件以及相关配置。而 SpaceVim 是以模块的方式来组织和管
| [lang#haskell](lang/haskell/) | 这一模块为 SpaceVim 提供了 Haskell 的开发支持,包括代码补全、语法检查、代码格式化等特性。 |
| [lang#html](lang/html/) | 这一模块为 SpaceVim 提供了 HTML 的开发支持,包括代码补全、语法检查、代码格式化等特性。 |
| [lang#hy](lang/hy/) | 这一模块为 hy 开发提供支持,包括交互式编程、一键运行等特性。 |
| [lang#ipynb](lang/ipynb/) | 该模块为SpaceVim添加了 Jupyter Notebook 支持,包括语法高亮、代码折叠等特点。 |
| [lang#ipynb](lang/ipynb/) | 该模块为 SpaceVim 添加了 Jupyter Notebook 支持,包括语法高亮、代码折叠等特点。 |
| [lang#java](lang/java/) | 这一模块为 Java 开发提供支持,包括代码补全、语法检查、代码格式化等特性。 |
| [lang#javascript](lang/javascript/) | 这一模块为 JavaScript 开发提供支持,包括代码补全、语法检查、代码格式化等特性。 |
| [lang#julia](lang/julia/) | 这一模块为 Julia 开发提供支持,包括代码补全、语法检查、代码格式化等特性。 |

36
docs/cn/layers/lang/d.md Normal file
View File

@ -0,0 +1,36 @@
---
title: "SpaceVim lang#d 模块"
description: "这一模块为 d 开发提供支持,包括语法高亮、自动补全、一键运行等特性。"
lang: cn
---
# [可用模块](../../) >> lang#d
<!-- vim-markdown-toc GFM -->
- [模块简介](#模块简介)
- [启用模块](#启用模块)
- [快捷键](#快捷键)
- [运行当前脚本](#运行当前脚本)
<!-- vim-markdown-toc -->
## 模块简介
这一模块为在 SpaceVim 中进行 d 开发提供了支持。
## 启用模块
可通过在配置文件内加入如下配置来启用该模块:
```toml
[[layers]]
name = "lang#d"
```
## 快捷键
### 运行当前脚本
在编辑 d 文件时,可通过快捷键 `SPC l r` 快速异步运行当前文件,运行结果会展示在一个独立的执行窗口内。

View File

@ -96,6 +96,7 @@ Some layers are enabled by default. The following example shows how to disable `
| [lang#clojure](lang/clojure/) | This layer is for Clojure development, provide autocompletion, syntax checking, code format for Clojure file. |
| [lang#coffeescript](lang/coffeescript/) | This layer is for CoffeeScript development, provide autocompletion, syntax checking, code format for CoffeeScript file. |
| [lang#csharp](lang/csharp/) | This layer is for csharp development |
| [lang#d](lang/d/) | This layer is for d development, provide syntax checking, code runner support for d file. |
| [lang#dart](lang/dart/) | This layer is for Dart development, provide autocompletion, syntax checking, code format for Dart file. |
| [lang#dockerfile](lang/dockerfile/) | This layer adds DockerFile to SpaceVim |
| [lang#elixir](lang/elixir/) | This layer is for Elixir development, provide autocompletion, syntax checking, code format for Elixir file. |

39
docs/layers/lang/d.md Normal file
View File

@ -0,0 +1,39 @@
---
title: "SpaceVim lang#d layer"
description: "This layer is for d development, provide syntax checking, code runner support for d file."
---
# [Available Layers](../../) >> lang#d
<!-- vim-markdown-toc GFM -->
- [Description](#description)
- [Install](#install)
- [Features](#features)
- [Key bindings](#key-bindings)
- [Running current script](#running-current-script)
<!-- vim-markdown-toc -->
## Description
This layer is for d development.
## Install
To use this configuration layer, update custom configuration file with:
```toml
[[layers]]
name = "lang#d"
```
## Features
- code runner
## Key bindings
### Running current script
To running a d file, you can press `SPC l r` to run current file without loss focus, and the result will be shown in a runner buffer.