1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-09 09:40:04 +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

@ -1,6 +1,6 @@
# SpaceVim development # SpaceVim development
## Bumb version ## Bumb version
1. change the value of `g:spacevim_version` 1. change the value of `g:spacevim_version`
2. change version in docs/install.sh, docs/install.cmd, docs/cn/install.sh, docs/cn/install.cmd 2. change version in docs/install.sh, docs/install.cmd, docs/cn/install.sh, docs/cn/install.cmd

View File

@ -1,62 +1,62 @@
"============================================================================= "=============================================================================
" followHEAD.vim --- generate follow HEAD page " followHEAD.vim --- generate follow HEAD page
" Copyright (c) 2016-2017 Wang Shidong & Contributors " Copyright (c) 2016-2017 Wang Shidong & Contributors
" Author: Wang Shidong < wsdjeg at 163.com > " Author: Wang Shidong < wsdjeg at 163.com >
" URL: https://spacevim.org " URL: https://spacevim.org
" License: GPLv3 " License: GPLv3
"============================================================================= "=============================================================================
let s:AUTODOC = SpaceVim#api#import('dev#autodoc') let s:AUTODOC = SpaceVim#api#import('dev#autodoc')
let s:AUTODOC.begin = '^<!-- SpaceVim follow HEAD en start -->$' let s:AUTODOC.begin = '^<!-- SpaceVim follow HEAD en start -->$'
let s:AUTODOC.end = '^<!-- SpaceVim follow HEAD en end -->$' let s:AUTODOC.end = '^<!-- SpaceVim follow HEAD en end -->$'
function! s:generate_content() abort function! s:generate_content() abort
let content = s:follow_head_content() let content = s:follow_head_content()
return content return content
endfunction endfunction
let s:AUTODOC.content_func = function('s:generate_content') let s:AUTODOC.content_func = function('s:generate_content')
let s:AUTODOC.autoformat = 1 let s:AUTODOC.autoformat = 1
let s:lang = 'en' let s:lang = 'en'
function! SpaceVim#dev#followHEAD#update(lang) abort function! SpaceVim#dev#followHEAD#update(lang) abort
let s:lang = a:lang let s:lang = a:lang
call s:AUTODOC.update() call s:AUTODOC.update()
endfunction endfunction
function! s:list_closed_prs(owner, repo, page) abort function! s:list_closed_prs(owner, repo, page) abort
return github#api#util#Get('repos/' . a:owner . '/' . a:repo . '/issues?state=closed&page=' . a:page , []) return github#api#util#Get('repos/' . a:owner . '/' . a:repo . '/issues?state=closed&page=' . a:page , [])
endfunction endfunction
function! s:get_list_of_PRs() abort function! s:get_list_of_PRs() abort
let prs = [] let prs = []
for i in range(1, 2) for i in range(1, 2)
let issues = s:list_closed_prs('SpaceVim','SpaceVim', i) let issues = s:list_closed_prs('SpaceVim','SpaceVim', i)
call extend(prs, call extend(prs,
\ filter(issues, \ filter(issues,
\ "v:val['number'] > " \ "v:val['number'] > "
\ . SpaceVim#dev#releases#last_release_number() \ . SpaceVim#dev#releases#last_release_number()
\ . " && v:val['number'] < " \ . " && v:val['number'] < "
\ . SpaceVim#dev#releases#current_release_number() \ . SpaceVim#dev#releases#current_release_number()
\ . " && index(SpaceVim#dev#releases#unmerged_prs_since_current_release(), v:val['number']) == -1 " \ . " && index(SpaceVim#dev#releases#unmerged_prs_since_current_release(), v:val['number']) == -1 "
\ )) \ ))
endfor endfor
for i in SpaceVim#dev#releases#get_unmerged_prs() for i in SpaceVim#dev#releases#get_unmerged_prs()
let pr = github#api#issues#Get_issue('SpaceVim', 'SpaceVim', i) let pr = github#api#issues#Get_issue('SpaceVim', 'SpaceVim', i)
if get(pr, 'state', '') ==# 'closed' if get(pr, 'state', '') ==# 'closed'
call add(prs, pr) call add(prs, pr)
endif endif
endfor endfor
return filter(prs, "has_key(v:val, 'pull_request')") return filter(prs, "has_key(v:val, 'pull_request')")
endfunction endfunction
let s:prs = [] let s:prs = []
function! s:follow_head_content() abort function! s:follow_head_content() abort
let md = [] let md = []
if s:prs == [] if s:prs == []
let s:prs =s:get_list_of_PRs() let s:prs =s:get_list_of_PRs()
endif endif
let md = md + SpaceVim#dev#releases#parser_prs(s:prs, s:lang) let md = md + SpaceVim#dev#releases#parser_prs(s:prs, s:lang)
return md return md
endfunction endfunction

View File

@ -1,41 +1,41 @@
"============================================================================= "=============================================================================
" issuemanager.vim --- issue manager for SpaceVim development " issuemanager.vim --- issue manager for SpaceVim development
" Copyright (c) 2016-2017 Wang Shidong & Contributors " Copyright (c) 2016-2017 Wang Shidong & Contributors
" Author: Wang Shidong < wsdjeg at 163.com > " Author: Wang Shidong < wsdjeg at 163.com >
" URL: https://spacevim.org " URL: https://spacevim.org
" License: GPLv3 " License: GPLv3
"============================================================================= "=============================================================================
function! SpaceVim#dev#issuemanager#edit(id) abort function! SpaceVim#dev#issuemanager#edit(id) abort
let issue = github#api#issues#Get_issue('SpaceVim', 'SpaceVim', a:id) let issue = github#api#issues#Get_issue('SpaceVim', 'SpaceVim', a:id)
exe 'silent tabnew ++ff=unix ' . tempname() . '/issue_' . a:id . '.md' exe 'silent tabnew ++ff=unix ' . tempname() . '/issue_' . a:id . '.md'
let content = split(issue.body, "\n") let content = split(issue.body, "\n")
let b:current_issue = issue let b:current_issue = issue
call setline(1, map(content, "substitute(v:val, ' $', '', 'g')")) call setline(1, map(content, "substitute(v:val, ' $', '', 'g')"))
augroup spacevim_dev_issuemanager augroup spacevim_dev_issuemanager
autocmd! autocmd!
autocmd BufWritePost <buffer> call <SID>update_issue() autocmd BufWritePost <buffer> call <SID>update_issue()
augroup END augroup END
endfunction endfunction
function! s:update_issue() abort function! s:update_issue() abort
let issue = get(b:, 'current_issue', {}) let issue = get(b:, 'current_issue', {})
if !empty(issue) if !empty(issue)
let new = {'title' : issue.title, let new = {'title' : issue.title,
\ 'body' : join(getline(1, '$'), "\n")} \ 'body' : join(getline(1, '$'), "\n")}
redraw redraw
call inputsave() call inputsave()
let username = input('github username:') let username = input('github username:')
let password = input('github password:') let password = input('github password:')
call inputrestore() call inputrestore()
let respons = github#api#issues#Edit('SpaceVim', 'SpaceVim', issue.number, username, password, new) let respons = github#api#issues#Edit('SpaceVim', 'SpaceVim', issue.number, username, password, new)
normal! : normal! :
if !empty(respons) && get(respons, 'number', 0) == issue.number if !empty(respons) && get(respons, 'number', 0) == issue.number
echon 'Issue ' . issue.number . ' has been updated!' echon 'Issue ' . issue.number . ' has been updated!'
elseif !empty(respons) elseif !empty(respons)
let msg = get(respons, 'message', '') let msg = get(respons, 'message', '')
echon 'Failed to update issue ' . issue.number . ':' . msg echon 'Failed to update issue ' . issue.number . ':' . msg
endif endif
endif endif
endfunction endfunction

View File

@ -1,43 +1,43 @@
"============================================================================= "=============================================================================
" gui.vim --- gui api for SpaceVim " gui.vim --- gui api for SpaceVim
" Copyright (c) 2016-2019 Wang Shidong & Contributors " Copyright (c) 2016-2019 Wang Shidong & Contributors
" Author: Wang Shidong < wsdjeg at 163.com > " Author: Wang Shidong < wsdjeg at 163.com >
" URL: https://spacevim.org " URL: https://spacevim.org
" License: GPLv3 " License: GPLv3
"============================================================================= "=============================================================================
let s:self = {} let s:self = {}
function! s:self.gui_name() abort function! s:self.gui_name() abort
if !has('nvim-0.3') if !has('nvim-0.3')
return '' return ''
endif endif
let uis = nvim_list_uis() let uis = nvim_list_uis()
if len(uis) == 0 if len(uis) == 0
echoerr "No UIs are attached" echoerr "No UIs are attached"
return return
endif endif
" Use the last UI in the list " Use the last UI in the list
let ui_chan = uis[-1].chan let ui_chan = uis[-1].chan
let info = nvim_get_chan_info(ui_chan) let info = nvim_get_chan_info(ui_chan)
return get(info.client, 'name', '') return get(info.client, 'name', '')
endfunction endfunction
function! s:self.toggle_tabline(enable) abort function! s:self.toggle_tabline(enable) abort
call rpcnotify(0, 'Gui', 'Option', 'Tabline', a:enable) call rpcnotify(0, 'Gui', 'Option', 'Tabline', a:enable)
endfunction endfunction
function! s:self.toggle_popupmenu(enable) abort function! s:self.toggle_popupmenu(enable) abort
call rpcnotify(0, 'Gui', 'Option', 'Popupmenu', a:enable) call rpcnotify(0, 'Gui', 'Option', 'Popupmenu', a:enable)
endfunction endfunction
function! SpaceVim#api#neovim#gui#get() function! SpaceVim#api#neovim#gui#get()
return deepcopy(s:self) return deepcopy(s:self)
endfunction endfunction

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

@ -1,108 +1,108 @@
@PowerShell -ExecutionPolicy Bypass -Command Invoke-Expression $('$args=@(^&{$args} %*);'+[String]::Join(';',(Get-Content '%~f0') -notmatch '^^@PowerShell.*EOF$')) & goto :EOF @PowerShell -ExecutionPolicy Bypass -Command Invoke-Expression $('$args=@(^&{$args} %*);'+[String]::Join(';',(Get-Content '%~f0') -notmatch '^^@PowerShell.*EOF$')) & goto :EOF
echo " /###### /## /##/## " echo " /###### /## /##/## "
echo " /##__ ## | ## | #|__/ " echo " /##__ ## | ## | #|__/ "
echo " | ## \__/ /###### /###### /####### /######| ## | ##/##/######/#### " echo " | ## \__/ /###### /###### /####### /######| ## | ##/##/######/#### "
echo " | ###### /##__ ##|____ ##/##_____//##__ #| ## / ##| #| ##_ ##_ ##" echo " | ###### /##__ ##|____ ##/##_____//##__ #| ## / ##| #| ##_ ##_ ##"
echo " \____ #| ## \ ## /######| ## | ########\ ## ##/| #| ## \ ## \ ##" echo " \____ #| ## \ ## /######| ## | ########\ ## ##/| #| ## \ ## \ ##"
echo " /## \ #| ## | ##/##__ #| ## | ##_____/ \ ###/ | #| ## | ## | ##" echo " /## \ #| ## | ##/##__ #| ## | ##_____/ \ ###/ | #| ## | ## | ##"
echo " | ######| #######| ######| ######| ####### \ #/ | #| ## | ## | ##" echo " | ######| #######| ######| ######| ####### \ #/ | #| ## | ## | ##"
echo " \______/| ##____/ \_______/\_______/\_______/ \_/ |__|__/ |__/ |__/" echo " \______/| ##____/ \_______/\_______/\_______/ \_/ |__|__/ |__/ |__/"
echo " | ## " echo " | ## "
echo " | ## " echo " | ## "
echo " |__/ " echo " |__/ "
echo " version : 1.2.0-dev by : spacevim.org " echo " version : 1.2.0-dev by : spacevim.org "
Push-Location ~ Push-Location ~
$app_name = "SpaceVim" $app_name = "SpaceVim"
$repo_url = "https://github.com/SpaceVim/SpaceVim.git" $repo_url = "https://github.com/SpaceVim/SpaceVim.git"
$repo_name = "SpaceVim" $repo_name = "SpaceVim"
$repo_path = "$HOME\.SpaceVim" $repo_path = "$HOME\.SpaceVim"
Function Pause ($Message = "Press any key to continue . . . ") { Function Pause ($Message = "Press any key to continue . . . ") {
if ((Test-Path variable:psISE) -and $psISE) { if ((Test-Path variable:psISE) -and $psISE) {
$Shell = New-Object -ComObject "WScript.Shell" $Shell = New-Object -ComObject "WScript.Shell"
$Button = $Shell.Popup("Click OK to continue.", 0, "Script Paused", 0) $Button = $Shell.Popup("Click OK to continue.", 0, "Script Paused", 0)
} else { } else {
Write-Host -NoNewline $Message Write-Host -NoNewline $Message
[void][System.Console]::ReadKey($true) [void][System.Console]::ReadKey($true)
Write-Host Write-Host
} }
} }
echo "==> Starting Testing Procedure..." echo "==> Starting Testing Procedure..."
echo "" echo ""
sleep 1 sleep 1
echo "==> Testing git" echo "==> Testing git"
if (Get-Command "git" -ErrorAction SilentlyContinue) { if (Get-Command "git" -ErrorAction SilentlyContinue) {
git version git version
echo "[OK] Test successfully. Moving to next..." echo "[OK] Test successfully. Moving to next..."
sleep 1 sleep 1
} else { } else {
echo "" echo ""
echo "[ERROR] Unable to find 'git.exe' in your PATH" echo "[ERROR] Unable to find 'git.exe' in your PATH"
echo ">>> Ready to Exit......" echo ">>> Ready to Exit......"
Pause Pause
exit exit
} }
echo "" echo ""
echo "==> Testing vim" echo "==> Testing vim"
if (Get-Command "gvim" -ErrorAction SilentlyContinue) { if (Get-Command "gvim" -ErrorAction SilentlyContinue) {
echo ($(vim --version) -split '\n')[0] echo ($(vim --version) -split '\n')[0]
echo "[OK] Test successfully. Moving to next..." echo "[OK] Test successfully. Moving to next..."
sleep 1 sleep 1
} else { } else {
echo "[WARNING] Unable to find 'gvim.exe' in your PATH. But intallation still can continue..." echo "[WARNING] Unable to find 'gvim.exe' in your PATH. But intallation still can continue..."
echo "" echo ""
echo "[WARNING] Please install gvim later or make your PATH correctly set! " echo "[WARNING] Please install gvim later or make your PATH correctly set! "
Pause Pause
} }
echo "<== Testing Procedure Completed. Moving to next..." echo "<== Testing Procedure Completed. Moving to next..."
sleep 1 sleep 1
echo "" echo ""
echo "" echo ""
if (!(Test-Path "$HOME\.SpaceVim")) { if (!(Test-Path "$HOME\.SpaceVim")) {
echo "==> Trying to clone $app_name" echo "==> Trying to clone $app_name"
git clone $repo_url $repo_path git clone $repo_url $repo_path
} else { } else {
echo "==> Trying to update $app_name" echo "==> Trying to update $app_name"
Push-Location $repo_path Push-Location $repo_path
git pull origin master git pull origin master
} }
echo "" echo ""
if (!(Test-Path "$HOME\vimfiles")) { if (!(Test-Path "$HOME\vimfiles")) {
cmd /c mklink $HOME\vimfiles $repo_path cmd /c mklink $HOME\vimfiles $repo_path
} else { } else {
echo "[OK] vimfiles already exists" echo "[OK] vimfiles already exists"
sleep 1 sleep 1
} }
echo "" echo ""
if (!(Test-Path "$HOME\AppData\Local\nvim")) { if (!(Test-Path "$HOME\AppData\Local\nvim")) {
cmd /c mklink "$HOME\AppData\Local\nvim" $repo_path cmd /c mklink "$HOME\AppData\Local\nvim" $repo_path
} else { } else {
echo "[OK] $HOME\AppData\Local\nvim already exists" echo "[OK] $HOME\AppData\Local\nvim already exists"
sleep 1 sleep 1
} }
echo "" echo ""
echo "Almost done!" echo "Almost done!"
echo "==============================================================================" echo "=============================================================================="
echo "== Open GVim and it will install the plugins automatically ==" echo "== Open GVim and it will install the plugins automatically =="
echo "==============================================================================" echo "=============================================================================="
echo "" echo ""
echo "That's it. Thanks for installing $app_name. Enjoy!" echo "That's it. Thanks for installing $app_name. Enjoy!"
echo "" echo ""
Pause Pause
# vim:set ft=ps1: # vim:set ft=ps1:

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#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#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#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#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#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. | | [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.

View File

@ -1,12 +1,12 @@
Execute ( SpaceVim plugin: a.vim ): Execute ( SpaceVim plugin: a.vim ):
call SpaceVim#plugins#a#set_config_name('.projections.json') call SpaceVim#plugins#a#set_config_name('.projections.json')
let root = SpaceVim#plugins#a#get_root() let root = SpaceVim#plugins#a#get_root()
AssertEqual SpaceVim#plugins#a#get_alt('docs/index.md', root), 'docs/cn/index.md' AssertEqual SpaceVim#plugins#a#get_alt('docs/index.md', root), 'docs/cn/index.md'
AssertEqual SpaceVim#plugins#a#get_alt('docs/cn/index.md', root), 'docs/index.md' AssertEqual SpaceVim#plugins#a#get_alt('docs/cn/index.md', root), 'docs/index.md'
AssertEqual SpaceVim#plugins#a#get_alt('docs/api/job.md', root), 'docs/cn/api/job.md' AssertEqual SpaceVim#plugins#a#get_alt('docs/api/job.md', root), 'docs/cn/api/job.md'
AssertEqual SpaceVim#plugins#a#get_alt('docs/cn/api/job.md', root), 'docs/api/job.md' AssertEqual SpaceVim#plugins#a#get_alt('docs/cn/api/job.md', root), 'docs/api/job.md'
AssertEqual SpaceVim#plugins#a#get_alt('wiki/en/Project-layout.md', root), 'wiki/cn/Project-layout.md' AssertEqual SpaceVim#plugins#a#get_alt('wiki/en/Project-layout.md', root), 'wiki/cn/Project-layout.md'
AssertEqual SpaceVim#plugins#a#get_alt('wiki/cn/Project-layout.md', root), 'wiki/en/Project-layout.md' AssertEqual SpaceVim#plugins#a#get_alt('wiki/cn/Project-layout.md', root), 'wiki/en/Project-layout.md'
AssertEqual SpaceVim#plugins#a#get_alt('docs/_posts/2018-09-28-use-vim-as-ide.md', root), 'docs/_posts/2018-09-27-use-vim-as-ide.md' AssertEqual SpaceVim#plugins#a#get_alt('docs/_posts/2018-09-28-use-vim-as-ide.md', root), 'docs/_posts/2018-09-27-use-vim-as-ide.md'
unlet root unlet root