1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-23 17:31:34 +08:00
SpaceVim/autoload/SpaceVim/layers/lang/vim.vim
2017-11-23 23:57:13 +08:00

44 lines
1.7 KiB
VimL

function! SpaceVim#layers#lang#vim#plugins() abort
let plugins = [
\ ['syngan/vim-vimlint', { 'on_ft' : 'vim'}],
\ ['ynkdir/vim-vimlparser', { 'on_ft' : 'vim'}],
\ ['todesking/vint-syntastic', { 'on_ft' : 'vim'}],
\ ]
call add(plugins,['tweekmonster/exception.vim'])
call add(plugins,['mhinz/vim-lookup'])
call add(plugins,['Shougo/neco-vim', { 'on_event' : 'InsertEnter', 'loadconf_before' : 1}])
if g:spacevim_autocomplete_method == 'asyncomplete'
call add(plugins, ['prabirshrestha/asyncomplete-necovim.vim', {
\ 'loadconf' : 1,
\ 'merged' : 0,
\ }])
endif
call add(plugins,['tweekmonster/helpful.vim', {'on_cmd': 'HelpfulVersion'}])
return plugins
endfunction
function! SpaceVim#layers#lang#vim#config() abort
call SpaceVim#mapping#gd#add('vim','lookup#lookup')
call SpaceVim#mapping#space#regesit_lang_mappings('vim', funcref('s:language_specified_mappings'))
endfunction
function! s:language_specified_mappings() abort
call SpaceVim#mapping#space#langSPC('nmap', ['l','e'], 'call call('
\ . string(function('s:eval_cursor')) . ', [])',
\ 'echo eval under cursor', 1)
call SpaceVim#mapping#space#langSPC('nmap', ['l','v'], 'call call('
\ . string(function('s:helpversion_cursor')) . ', [])',
\ 'echo helpversion under cursor', 1)
endfunction
function! s:eval_cursor() abort
let is_keyword = &iskeyword
set iskeyword+=:
echo expand('<cword>') 'is' eval(expand('<cword>'))
let &iskeyword = is_keyword
endfunction
function! s:helpversion_cursor() abort
exe 'HelpfulVersion' expand('<cword>')
endfunction