mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-01-24 05:40:05 +08:00
change lang#java mapping-gd (#3167)
This commit is contained in:
parent
4b00832744
commit
c84dfd174a
@ -102,12 +102,17 @@ function! SpaceVim#layers#lang#java#config() abort
|
|||||||
call SpaceVim#mapping#space#regesit_lang_mappings('java', function('s:language_specified_mappings'))
|
call SpaceVim#mapping#space#regesit_lang_mappings('java', function('s:language_specified_mappings'))
|
||||||
call SpaceVim#plugins#repl#reg('java', 'jshell')
|
call SpaceVim#plugins#repl#reg('java', 'jshell')
|
||||||
call add(g:spacevim_project_rooter_patterns, 'pom.xml')
|
call add(g:spacevim_project_rooter_patterns, 'pom.xml')
|
||||||
|
|
||||||
|
if SpaceVim#layers#lsp#check_filetype('java')
|
||||||
|
call SpaceVim#mapping#gd#add('java', function('SpaceVim#lsp#go_to_def'))
|
||||||
|
else
|
||||||
|
call SpaceVim#mapping#gd#add('java', function('s:go_to_def'))
|
||||||
|
endif
|
||||||
augroup SpaceVim_lang_java
|
augroup SpaceVim_lang_java
|
||||||
au!
|
au!
|
||||||
if !SpaceVim#layers#lsp#check_filetype('java')
|
if !SpaceVim#layers#lsp#check_filetype('java')
|
||||||
" omnifunc will be used only when no java lsp support
|
" omnifunc will be used only when no java lsp support
|
||||||
autocmd FileType java setlocal omnifunc=javacomplete#Complete
|
autocmd FileType java setlocal omnifunc=javacomplete#Complete
|
||||||
call SpaceVim#mapping#gd#add('java', function('s:go_to_def'))
|
|
||||||
endif
|
endif
|
||||||
autocmd FileType jsp call <SID>JspFileTypeInit()
|
autocmd FileType jsp call <SID>JspFileTypeInit()
|
||||||
augroup END
|
augroup END
|
||||||
@ -189,6 +194,9 @@ function! s:language_specified_mappings() abort
|
|||||||
call SpaceVim#mapping#space#langSPC('nmap', ['l', 'g', 't'],
|
call SpaceVim#mapping#space#langSPC('nmap', ['l', 'g', 't'],
|
||||||
\ '<Plug>(JavaComplete-Generate-ToString)',
|
\ '<Plug>(JavaComplete-Generate-ToString)',
|
||||||
\ 'Generate toString function', 0)
|
\ 'Generate toString function', 0)
|
||||||
|
call SpaceVim#mapping#space#langSPC('nmap', ['l', 'g', 'n'],
|
||||||
|
\ '<Plug>(JavaComplete-Generate-NewClass)',
|
||||||
|
\ 'Generate NewClass in current Package', 0)
|
||||||
|
|
||||||
" Jump
|
" Jump
|
||||||
let g:_spacevim_mappings_space.l.j = {'name' : '+Jump'}
|
let g:_spacevim_mappings_space.l.j = {'name' : '+Jump'}
|
||||||
@ -240,6 +248,8 @@ function! s:language_specified_mappings() abort
|
|||||||
call SpaceVim#mapping#space#langSPC('nnoremap', ['l','g', 't'], 'call call('
|
call SpaceVim#mapping#space#langSPC('nnoremap', ['l','g', 't'], 'call call('
|
||||||
\ . string(function('s:execCMD')) . ', ["gradle test"])',
|
\ . string(function('s:execCMD')) . ', ["gradle test"])',
|
||||||
\ 'Run gradle test', 1)
|
\ 'Run gradle test', 1)
|
||||||
|
|
||||||
|
" REPL
|
||||||
let g:_spacevim_mappings_space.l.s = {'name' : '+Send'}
|
let g:_spacevim_mappings_space.l.s = {'name' : '+Send'}
|
||||||
call SpaceVim#mapping#space#langSPC('nmap', ['l','s', 'i'],
|
call SpaceVim#mapping#space#langSPC('nmap', ['l','s', 'i'],
|
||||||
\ 'call SpaceVim#plugins#repl#start("java")',
|
\ 'call SpaceVim#plugins#repl#start("java")',
|
||||||
@ -269,7 +279,7 @@ function! s:java_mappings() abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:go_to_def() abort
|
function! s:go_to_def() abort
|
||||||
call SpaceVim#lsp#go_to_def()
|
exe 'normal! gd'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:execCMD(cmd) abort
|
function! s:execCMD(cmd) abort
|
||||||
|
Loading…
Reference in New Issue
Block a user