1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-02 21:00:03 +08:00

Fix key bindings

This commit is contained in:
wsdjeg 2018-04-01 13:16:14 +08:00
parent 39151c8e78
commit 3635c58129
3 changed files with 23 additions and 24 deletions

View File

@ -45,17 +45,6 @@ function! SpaceVim#autocmds#init() abort
autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags
autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS
autocmd Filetype qf setlocal nobuflisted
autocmd BufEnter *
\ if empty(&buftype) && has('nvim') && &filetype != 'help'
\| nnoremap <silent><buffer> <C-]> :call MyTagfunc()<CR>
\| nnoremap <silent><buffer> <C-[> :call MyTagfuncBack()<CR>
\| else
\| if empty(maparg('<leader>[', 'n', 0, 1)) && empty(maparg('<leader>]', 'n', 0, 1))
\| nnoremap <silent><buffer> <leader>] :call MyTagfunc()<CR>
\| nnoremap <silent><buffer> <leader>[ :call MyTagfuncBack()<CR>
\| endif
\| endif
"}}}
autocmd FileType python,coffee call zvim#util#check_if_expand_tab()
au StdinReadPost * call s:disable_welcome()
autocmd InsertEnter * call s:fixindentline()

View File

@ -10,6 +10,7 @@ function! SpaceVim#layers#tags#plugins() abort
return [
\ ['ludovicchabant/vim-gutentags', {'merged' : 0}],
\ ['SpaceVim/gtags.vim', {'merged' : 0}],
\ ['tsukkee/unite-tag', {'merged' : 0}],
\ ]
endfunction
@ -30,4 +31,26 @@ function! SpaceVim#layers#tags#config() abort
call SpaceVim#mapping#space#def('nnoremap', ['m', 'g', 'd'], 'exe "Gtags -d " . expand("<cword>")', 'find definitions', 1)
call SpaceVim#mapping#space#def('nnoremap', ['m', 'g', 'r'], 'exe "Gtags -r " . expand("<cword>")', 'find references', 1)
endif
augroup spacevim_layer_tags
autocmd!
autocmd BufEnter *
\ if empty(&buftype) && &filetype != 'help'
\| nnoremap <silent><buffer> <C-]> :call MyTagfunc()<CR>
\| nnoremap <silent><buffer> <C-[> :call MyTagfuncBack()<CR>
\| endif
augroup END
endfunction
function! MyTagfunc() abort
mark H
let s:MyTagfunc_flag = 1
UniteWithCursorWord -immediately tag
endfunction
function! MyTagfuncBack() abort
if exists('s:MyTagfunc_flag')&&s:MyTagfunc_flag
exe "normal! `H"
let s:MyTagfunc_flag =0
endif
endfunction

View File

@ -120,19 +120,6 @@ function! JspFileTypeInit()
nnoremap <F4> :JCimportAdd<cr>
inoremap <F4> <esc>:JCimportAddI<cr>
endfunction
function! MyTagfunc() abort
mark H
let s:MyTagfunc_flag = 1
UniteWithCursorWord -immediately tag
endfunction
function! MyTagfuncBack() abort
if exists('s:MyTagfunc_flag')&&s:MyTagfunc_flag
exe "normal! `H"
let s:MyTagfunc_flag =0
endif
endfunction
function! MyLeaderTabfunc() abort
if g:spacevim_autocomplete_method == 'deoplete'