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

Merge pull request #181 from SpaceVim/lang/viml

Add lang/viml layer
This commit is contained in:
Wang Shidong 2017-01-31 20:37:02 +08:00 committed by GitHub
commit 91973f35e1
7 changed files with 33 additions and 2 deletions

View File

@ -365,6 +365,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

@ -22,7 +22,6 @@ function! SpaceVim#layers#autocomplete#plugins() abort
\ ['honza/vim-snippets', {'on_i' : 1, 'loadconf_before' : 1}],
\ ['Shougo/neco-syntax', { 'on_i' : 1}],
\ ['ujihisa/neco-look', { 'on_i' : 1}],
\ ['Shougo/neco-vim', { 'on_i' : 1, 'loadconf_before' : 1}],
\ ['Shougo/context_filetype.vim', { 'on_i' : 1}],
\ ['Shougo/neoinclude.vim', { 'on_i' : 1}],
\ ['Shougo/neosnippet-snippets', { 'merged' : 0}],

View File

@ -19,4 +19,8 @@ function! SpaceVim#layers#git#config() abort
nmap <leader>hk <plug>(signify-prev-hunk)
nmap <leader>hJ 9999<leader>gj
nmap <leader>hK 9999<leader>gk
augroup spacevim_layer_git
autocmd!
autocmd FileType diff nnoremap <buffer><silent> q :bd!<CR>
augroup END
endfunction

View File

@ -0,0 +1,12 @@
function! SpaceVim#layers#lang#vim#plugins() abort
let plugins = []
call add(plugins,['tweekmonster/exception.vim'])
call add(plugins,['mhinz/vim-lookup'])
call add(plugins,['Shougo/neco-vim', { 'on_i' : 1, 'loadconf_before' : 1}])
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')
endfunction

View File

@ -6,7 +6,6 @@ function! SpaceVim#layers#tools#plugins() abort
\ ['junegunn/goyo.vim', { 'on_cmd' : 'Goyo', 'loadconf' : 1}],
\ ['Yggdroot/LeaderF', {'merged' : 0}],
\ ['google/vim-searchindex'],
\ ['tweekmonster/helpful.vim', {'on_cmd': 'HelpfulVersion'}],
\ ['simnalamburt/vim-mundo', { 'on_cmd' : 'MundoToggle'}],
\ ['wsdjeg/MarkDown.pl', { 'on_cmd' : 'MarkDownPreview'}],
\ ['mhinz/vim-grepper' , { 'on_cmd' : 'Grepper', 'loadconf' : 1} ],

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