Showing 1 of 1 files from the diff.

@@ -0,0 +1,124 @@
Loading
1 +
"=============================================================================
2 +
" sml.vim --- SpaceVim lang#sml layer
3 +
" Copyright (c) 2016-2020 Wang Shidong & Contributors
4 +
" Author: Tommy Tam < thawk009 # gmail.com >
5 +
" URL: https://spacevim.org
6 +
" License: GPLv3
7 +
"=============================================================================
8 +
9 +
""
10 +
" @section lang#sml, layer-lang-sml
11 +
" @parentsection layers
12 +
" This layer is for Standard ML development.
13 +
" This layer provides basic syntax highlighting and code completion , and it
14 +
" is disabled by default, to enable this
15 +
" layer, add following snippet to your @section(options) file.
16 +
" >
17 +
"   [[layers]]
18 +
"     name = 'lang#sml'
19 +
" <
20 +
"
21 +
" You can run `:SMLCheckHealth` to check whether the environment if OK.
22 +
"
23 +
" @subsection Layer options
24 +
"
25 +
" `smlnj_path`: Set the path to the smlnj executable, by default, it is
26 +
" `sml`.
27 +
"
28 +
" `mlton_path`: Set the path to the mlton executable, by default, it is
29 +
" `mlton`.
30 +
"
31 +
" `repl_options`: Options used for REPL, by default, it is ''.
32 +
"
33 +
" `auto_create_def_use`: Whether to build def-use files on save automatically.
34 +
" By default, it is `mlb`. Valid values is:
35 +
" >
36 +
"    'mlb': Auto build def-use if there's a *.mlb file
37 +
"    'always': Always build def-use file
38 +
"    'never': Never build def-use file
39 +
" <
40 +
"
41 +
" `enable_conceal`: `0`/`1`. Whether to enable concealing for SML files. `0` by defaults.
42 +
"    `'a` becomes `α` (or `'α`).
43 +
"    `fn` becomes `λ.`
44 +
"
45 +
" `enable_conceal_show_tick`: `0`/`1`. When conceal is enabled, show `'α` for `'a` instead of `α`.
46 +
"    Helps for alignment. `0` by default.
47 +
"
48 +
" `sml_file_head`: Template for new sml file.
49 +
"
50 +
" Here is an example how to use above options:
51 +
" >
52 +
"   [[layers]]
53 +
"     name = "lang#sml"
54 +
"     smlnj_path = "/usr/local/smlnj/bin/sml"
55 +
"     mlton_path = "/usr/local/bin/mlton"
56 +
"     repl_options = ''
57 +
"     conceal = 1
58 +
"     conceal_show_tick = 1
59 +
"     auto_create_def_use = 'always'
60 +
" <
61 +
62 +
function! SpaceVim#layers#lang#sml#plugins() abort
63 +
  let l:plugins = []
64 +
  call add(l:plugins, ['jez/vim-better-sml', { 'on_ft' : 'sml', 'build' : 'make' }])
65 +
  return l:plugins
66 +
endfunction
67 +
68 +
function! SpaceVim#layers#lang#sml#config() abort
69 +
  call SpaceVim#layers#edit#add_ft_head_tamplate('sml', s:sml_file_head)
70 +
  augroup spacevim_layer_lang_sml
71 +
    autocmd!
72 +
    " autocmd FileType sml setlocal omnifunc=SpaceVim#plugins#bashcomplete#omnicomplete
73 +
    if s:sml_enable_conceal
74 +
        autocmd FileType sml setlocal conceallevel=2
75 +
    endif
76 +
  augroup END
77 +
  call SpaceVim#mapping#gd#add('sml', function('bettersml#jumptodef#JumpToDef'))
78 +
  call SpaceVim#mapping#space#regesit_lang_mappings('sml', function('s:language_specified_mappings'))
79 +
80 +
  let l:runner = {
81 +
        \ 'exe' : g:sml_smlnj_executable,
82 +
        \ 'opt' : [],
83 +
        \ 'usestdin' : 1,
84 +
        \ }
85 +
  call SpaceVim#plugins#runner#reg_runner('sml', l:runner)
86 +
  call SpaceVim#plugins#repl#reg('sml', g:sml_smlnj_executable . s:sml_repl_options)
87 +
endfunction
88 +
89 +
function! s:language_specified_mappings() abort
90 +
  nnoremap <silent><buffer> K :call bettersml#typequery#TypeQuery()<CR>
91 +
92 +
  call SpaceVim#mapping#space#langSPC('nmap', ['l','r'],
93 +
        \ 'call SpaceVim#plugins#runner#open()',
94 +
        \ 'execute current file', 1)
95 +
96 +
  let g:_spacevim_mappings_space.l.s = {'name' : '+Send'}
97 +
  call SpaceVim#mapping#space#langSPC('nmap', ['l','s', 'i'],
98 +
        \ "call SpaceVim#plugins#repl#start('sml')",
99 +
        \ "start REPL process", 1)
100 +
  call SpaceVim#mapping#space#langSPC('nmap', ['l','s', 'l'],
101 +
        \ "call SpaceVim#plugins#repl#send('raw', getline('.') . ';')",
102 +
        \ "send line and keep code buffer focused", 1)
103 +
  call SpaceVim#mapping#space#langSPC('nmap', ['l','s', 'b'],
104 +
        \ 'call SpaceVim#plugins#repl#send("raw", join(getline(1, "$"), "\n") . ";")',
105 +
        \ 'send buffer and keep code buffer focused', 1)
106 +
  call SpaceVim#mapping#space#langSPC('nmap', ['l','s', 's'],
107 +
        \ 'call SpaceVim#plugins#repl#send("raw", join(getline("''<", "''>"), "\n") . ";")',
108 +
        \ 'send selection and keep code buffer focused', 1)
109 +
endfunction
110 +
111 +
let s:sml_file_head = ['']
112 +
let s:sml_repl_options = ''
113 +
let s:sml_enable_conceal = 0
114 +
115 +
function! SpaceVim#layers#lang#sml#set_variable(var) abort
116 +
  let g:sml_smlnj_executable = get(a:var, 'smlnj_path', 'sml')
117 +
  let g:sml_mlton_executable = get(a:var, 'mlton_path', 'mlton')
118 +
  let s:sml_repl_options = get(a:var, 'repl_options', s:sml_repl_options)
119 +
  let g:sml_repl_options = s:sml_repl_options
120 +
  let g:sml_auto_create_def_use = get(a:var, 'auto_create_def_use', 'mlb')
121 +
  let g:sml_greek_tyvar_show_tick = get(a:var, 'enable_conceal_show_tick', '0')
122 +
  let s:sml_enable_conceal = get(a:var, 'enable_conceal', s:sml_enable_conceal)
123 +
  let s:sml_file_head = get(a:var, 'sml_file_head', s:sml_file_head)
124 +
endfunction
Files Coverage
.SpaceVim.d/autoload/SpaceVim 0.00%
autoload 3.12%
bundle 2.43%
config 29.92%
ftplugin 23.33%
syntax 94.48%
.ci/common/github_commenter.vim 0.00%
after/syntax/help.vim 0.00%
colors/SpaceVim.vim 0.00%
filetype.vim 100.00%
ginit.vim 0.00%
init.vim 0.00%
test/vimrc 100.00%
vimrc 30.77%
Project Totals (1597 files) 3.13%
11715.15
TRAVIS_PYTHON_VERSION=3.6
TRAVIS_OS_NAME=linux
11715.14
TRAVIS_PYTHON_VERSION=3.6
TRAVIS_OS_NAME=linux
11715.17
TRAVIS_PYTHON_VERSION=3.6
TRAVIS_OS_NAME=linux
11715.16
TRAVIS_PYTHON_VERSION=3.6
TRAVIS_OS_NAME=linux
11715.19
TRAVIS_PYTHON_VERSION=3.6
TRAVIS_OS_NAME=linux
11715.18
TRAVIS_PYTHON_VERSION=3.6
TRAVIS_OS_NAME=linux
1
comment: off
2
codecov:
3
  branch: master
4
coverage:
5
  status:
6
    patch:
7
      default: false
8
    project:
9
      default: false  # disable the default status that measures entire project
10
      api:  # declare a new status context "api"
11
        target: 1%  # we always want 35% coverage here
12
        paths:
13
          - "autoload/SpaceVim/api/"  # only include coverage in "autoload/SpaceVim/api/" folder
14
      plugins:  # declare a new status context "api"
15
        target: 1%  # we always want 35% coverage here
16
        paths:
17
          - "autoload/SpaceVim/plugins/"  # only include coverage in "autoload/SpaceVim/api/" folder
18
      all:  # declare a new status context "all"
19
        target: 1%  # we always want 35% coverage here
20
        paths:
21
          - "!tests/"  # remove all files in "tests/"
22
          - "!bundle/"  # remove all files in "tests/"
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading