1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-14 06:58:00 +08:00
SpaceVim/autoload/SpaceVim/layers/chinese.vim
2021-09-19 22:23:23 +08:00

35 lines
1.4 KiB
VimL

"=============================================================================
" chinese.vim --- SpaceVim chinese layer
" Copyright (c) 2016-2021 Wang Shidong & Contributors
" Author: Wang Shidong < wsdjeg at 163.com >
" URL: https://spacevim.org
" License: GPLv3
"=============================================================================
function! SpaceVim#layers#chinese#plugins() abort
let plugins = [
\ ['yianwillis/vimcdoc' , {'merged' : 0}],
\ ['voldikss/vim-translator' , {'merged' : 0, 'on_cmd' : ['Translate', 'TranslateW', 'TranslateR', 'TranslateX']}],
\ ['wsdjeg/ChineseLinter.vim' , {'merged' : 0, 'on_cmd' : 'CheckChinese', 'on_ft' : ['markdown', 'text']}],
\ ]
if SpaceVim#layers#isLoaded('ctrlp')
call add(plugins, ['vimcn/ctrlp.cnx', {'merged' : 0}])
endif
return plugins
endfunction
function! SpaceVim#layers#chinese#config() abort
let g:_spacevim_mappings_space.x.g = {'name' : '+translate'}
call SpaceVim#mapping#space#def('nnoremap', ['x', 'g', 't'], 'Translate' , 'translate current word' , 1)
call SpaceVim#mapping#space#def('nnoremap', ['l', 'c'] , 'CheckChinese', 'Check with ChineseLinter', 1)
" do not load vimcdoc plugin
let g:loaded_vimcdoc = 1
endfunction
function! SpaceVim#layers#chinese#health() abort
call SpaceVim#layers#chinese#plugins()
call SpaceVim#layers#chinese#config()
return 1
endfunction