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

Add lang#fsharp layer (#2081)

* Add lang#fsharp layer
This commit is contained in:
Wang Shidong 2018-08-25 20:48:00 +08:00 committed by GitHub
parent e9e0950b77
commit cef2c5bf8d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 127 additions and 0 deletions

View File

@ -0,0 +1,36 @@
"=============================================================================
" fsharp.vim --- lang#fsharp layer
" Copyright (c) 2016-2017 Wang Shidong & Contributors
" Author: Wang Shidong < wsdjeg at 163.com >
" URL: https://spacevim.org
" License: GPLv3
"=============================================================================
function! SpaceVim#layers#lang#fsharp#plugins() abort
let plugins = []
call add(plugins, ['wsdjeg/vim-fsharp', {'on_ft' : 'fsharp'}])
call add(plugins, ['wsdjeg/deoplete-fsharp', {'on_ft' : 'fsharp', 'make' : 'bash install.bash'}])
return plugins
endfunction
function! SpaceVim#layers#lang#fsharp#config()
call SpaceVim#plugins#repl#reg('fsharp', ['fsharpi', '--readline-'])
call SpaceVim#mapping#space#regesit_lang_mappings('python', function('s:language_specified_mappings'))
endfunction
function! s:language_specified_mappings() abort
let g:_spacevim_mappings_space.l.s = {'name' : '+Send'}
call SpaceVim#mapping#space#langSPC('nmap', ['l','s', 'i'],
\ 'call SpaceVim#plugins#repl#start("scala")',
\ 'start REPL process', 1)
call SpaceVim#mapping#space#langSPC('nmap', ['l','s', 'l'],
\ 'call SpaceVim#plugins#repl#send("line")',
\ 'send line and keep code buffer focused', 1)
call SpaceVim#mapping#space#langSPC('nmap', ['l','s', 'b'],
\ 'call SpaceVim#plugins#repl#send("buffer")',
\ 'send buffer and keep code buffer focused', 1)
call SpaceVim#mapping#space#langSPC('nmap', ['l','s', 's'],
\ 'call SpaceVim#plugins#repl#send("selection")',
\ 'send selection and keep code buffer focused', 1)
endfunction

View File

@ -77,6 +77,7 @@ Vim 插件以及相关配置。而 SpaceVim 是以模块的方式来组织和管
| [lang#dart](lang/dart/) | 这一模块为 dart 开发提供支持,包括代码补全、语法检查、代码格式化等特性。 |
| [lang#elixir](lang/elixir/) | 这一模块为 elixir 开发提供支持,包括代码补全、语法检查、代码格式化等特性。 |
| [lang#erlang](lang/erlang/) | 这一模块为 erlang 开发提供支持,包括代码补全、语法检查、代码格式化等特性。 |
| [lang#fsharp](lang/fsharp/) | 这一模块为 fsharp 开发提供支持,包括代码补全、语法检查、代码格式化等特性。 |
| [lang#go](lang/go/) | 这一模块为 go 开发提供支持,包括代码补全、语法检查、代码格式化等特性。 |
| [lang#haskell](lang/haskell/) | 这一模块为 haskell 开发提供支持,包括代码补全、语法检查、代码格式化等特性。 |
| [lang#html](lang/html/) | 这一模块为 html 开发提供支持,包括代码补全、语法检查、代码格式化等特性。 |

View File

@ -0,0 +1,33 @@
---
title: "SpaceVim lang#fsharp 模块"
description: "这一模块为 fsharp 开发提供支持,包括代码补全、语法检查、代码格式化等特性。"
lang: cn
---
# [可用模块](../../) >> lang#fsharp
<!-- vim-markdown-toc GFM -->
- [模块简介](#模块简介)
- [功能特性](#功能特性)
- [启用模块](#启用模块)
<!-- vim-markdown-toc -->
## 模块简介
这一模块为在 SpaceVim 中进行 fsharp 开发提供了支持.
## 功能特性
- 语法高亮、对齐,由插件 [vim-fsharp](https://github.com/wsdjeg/vim-fsharp) 提供。
## 启用模块
可通过在配置文件内加入如下配置来启用该模块:
```toml
[[layers]]
name = "lang#fsharp"
```

View File

@ -76,6 +76,7 @@ enable = false
| [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#erlang](lang/erlang/) | This layer is for erlang development, provide autocompletion, syntax checking, code format for erlang file. |
| [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#haskell](lang/haskell/) | haskell language support for SpaceVim, includes code completion, syntax checking, jumping to definition, also provides language server protocol support for haskell |
| [lang#html](lang/html/) | Edit html in SpaceVim, with this layer, this layer provides code completion, syntax checking and code formatting for html. |

View File

@ -0,0 +1,55 @@
---
title: "SpaceVim lang#fsharp layer"
description: "This layer adds fsharp language support to SpaceVim"
---
# [Available Layers](../../) >> lang#fsharp
<!-- vim-markdown-toc GFM -->
- [Description](#description)
- [Features](#features)
- [Install](#install)
- [Key bindings](#key-bindings)
- [Inferior REPL process](#inferior-repl-process)
<!-- vim-markdown-toc -->
## Description
This layer adds fsharp language support to SpaceVim.
## Features
- syntax highlighting, indent provide by [vim-fsharp](https://github.com/wsdjeg/vim-fsharp)
- REPL support
## Install
**Install fsharp on Archlinux:**
```sh
yaourt -S fsharp-git
```
To use this configuration layer, update custom configuration file with:
```toml
[[layers]]
name = "lang#fsharp"
```
## Key bindings
### Inferior REPL process
Start a `fsharpi --readline-` inferior REPL process with `SPC l s i`.
Send code to inferior process commands:
| Key Binding | Description |
| ----------- | ------------------------------------------------ |
| `SPC l s b` | send buffer and keep code buffer focused |
| `SPC l s l` | send line and keep code buffer focused |
| `SPC l s s` | send selection text and keep code buffer focused |

View File

@ -26,6 +26,7 @@ The next release is v0.9.0.
- Add `lang#purescript` layer ([#2054](https://github.com/SpaceVim/SpaceVim/pull/2054))
- Add `lang#WebAssembly` layer ([#2068](https://github.com/SpaceVim/SpaceVim/pull/2068))
- Add `lang#erlang` layer ([#2074](https://github.com/SpaceVim/SpaceVim/pull/2074))
- Add `lang#fsharp` layer ([#2081](https://github.com/SpaceVim/SpaceVim/pull/2081))
### Improvement