From 28756293085e3462b7dd76c70e844031ff4944ce Mon Sep 17 00:00:00 2001 From: Shidong Wang Date: Fri, 21 Jun 2019 21:41:17 +0800 Subject: [PATCH] Add lang#groovy layer --- autoload/SpaceVim/layers/lang/groovy.vim | 34 ++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 autoload/SpaceVim/layers/lang/groovy.vim diff --git a/autoload/SpaceVim/layers/lang/groovy.vim b/autoload/SpaceVim/layers/lang/groovy.vim new file mode 100644 index 000000000..50a3ee59e --- /dev/null +++ b/autoload/SpaceVim/layers/lang/groovy.vim @@ -0,0 +1,34 @@ +"============================================================================= +" groovy.vim --- groovy support for SpaceVim +" Copyright (c) 2016-2019 Wang Shidong & Contributors +" Author: Wang Shidong < wsdjeg@outlook.com > +" URL: https://spacevim.org +" License: GPLv3 +"============================================================================= + +function! SpaceVim#layers#lang#groovy#plugin() abort + let plugins = [] + call add(plugins, ['wsdjeg/groovy.vim', {'merged' : 0}]) + return plugins +endfunction + +function! SpaceVim#layers#lang#groovy#config() abort + call SpaceVim#plugins#repl#reg('groovy', 'groovysh') + call SpaceVim#mapping#space#regesit_lang_mappings('groovy', 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("groovy")', + \ '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