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:
parent
bb3952f3e7
commit
ef2969c122
@ -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
|
||||
|
10
autoload/SpaceVim/layers/lang/vim.vim
Normal file
10
autoload/SpaceVim/layers/lang/vim.vim
Normal 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
|
@ -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
|
||||
|
8
autoload/SpaceVim/mapping/gd.vim
Normal file
8
autoload/SpaceVim/mapping/gd.vim
Normal 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
|
Loading…
x
Reference in New Issue
Block a user