1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-04-14 23:49:19 +08:00

Add lang/viml layer

This commit is contained in:
wsdjeg 2017-01-31 00:00:32 +08:00
parent bb3952f3e7
commit ef2969c122
4 changed files with 27 additions and 0 deletions

View File

@ -362,6 +362,7 @@ function! SpaceVim#default#SetMappings() abort
call SpaceVim#mapping#def('nnoremap <silent>', '<Leader>sg', ':vsplit<CR>:wincmd p<CR>:e#<CR>',
\'Open previous buffer in vsplit window' , 'vsplit|wincmd p|e#')
call SpaceVim#mapping#def('nnoremap <silent>', 'gf', ':call zvim#gf()<CR>', 'Jump to a file under cursor', '')
call SpaceVim#mapping#def('nnoremap <silent>', 'gd', ':call SpaceVim#mapping#gd()<CR>', 'Goto declaration', '')
endfunction
fu! s:tobur(num) abort

View File

@ -0,0 +1,10 @@
function! SpaceVim#layers#lang#vim#plugins() abort
let plugins = []
call add(plugins,['tweekmonster/exception.vim'])
call add(plugins,['mhinz/vim-lookup'])
return plugins
endfunction
function! SpaceVim#layers#lang#vim#config() abort
call SpaceVim#mapping#gd#add('vim','lookup#lookup')
endfunction

View File

@ -56,3 +56,11 @@ function! SpaceVim#mapping#enter() abort
return "\<Enter>"
endif
endfunction
function! SpaceVim#mapping#gd() abort
if !empty(SpaceVim#mapping#gd#get())
call call(SpaceVim#mapping#gd#get(), [])
else
normal! gd
endif
endfunction

View File

@ -0,0 +1,8 @@
let s:gd = {}
function! SpaceVim#mapping#gd#add(ft, func) abort
call extend(s:gd,{a:ft : a:func})
endfunction
function! SpaceVim#mapping#gd#get() abort
return get(s:gd, &filetype, '')
endfunction