1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-03-29 06:12:39 +08:00
2021-09-20 22:16:14 +08:00

66 lines
2.2 KiB
VimL

"=============================================================================
" pony.vim --- SpaceVim lang#pony layer
" Copyright (c) 2016-2021 Wang Shidong & Contributors
" Author: Wang Shidong < wsdjeg at 163.com >
" URL: https://spacevim.org
" License: GPLv3
"=============================================================================
""
" @section lang#pony, layers-lang-pony
" @parentsection layers
" This layer is for pony development, disabled by default, to enable this
" layer, add following snippet to your SpaceVim configuration file.
" >
" [[layers]]
" name = 'lang#pony'
" <
"
" @subsection Key bindings
" >
" Mode Key Function
" ---------------------------------------------
" normal SPC l r run current file
" <
function! SpaceVim#layers#lang#pony#plugins() abort
let plugins = []
" .pony file type
call add(plugins, ['wsdjeg/vim-pony', { 'on_ft' : 'pony'}])
return plugins
endfunction
function! SpaceVim#layers#lang#pony#config() abort
" @todo pony neomake support
" in github, there is a plugin https://github.com/killerswan/pony-currycomb.vim which provides syntastic suppotr
" checker layer configuration
if SpaceVim#layers#isLoaded('checkers') && g:spacevim_lint_engine ==# 'neomake'
let g:neomake_pony_enabled_makers = ['ponyc']
let g:neomake_pony_ponyc_maker = {
\ 'args': ['--pass=expr', '.'],
\ 'errorformat': '%f:%l:%c: %m',
\ 'cwd': '%:p:h',
\ }
let g:neomake_livescript_lsc_remove_invalid_entries = 1
endif
let runner = {
\ 'exe' : 'ponyc',
\ 'targetopt' : '-o',
\ 'opt' : [],
\ }
call SpaceVim#plugins#runner#reg_runner('pony', [runner, '#TEMP#'])
call SpaceVim#mapping#space#regesit_lang_mappings('pony', 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
function! SpaceVim#layers#lang#pony#health() abort
call SpaceVim#layers#lang#pony#plugins()
call SpaceVim#layers#lang#pony#config()
return 1
endfunction