diff --git a/autoload/EasyMotion/overwin.vim b/autoload/EasyMotion/overwin.vim index aa57f8d..55486d8 100644 --- a/autoload/EasyMotion/overwin.vim +++ b/autoload/EasyMotion/overwin.vim @@ -9,6 +9,9 @@ function! EasyMotion#overwin#move(pattern) abort \ 'shade': g:EasyMotion_hl_group_shade, \ 'target': g:EasyMotion_hl_group_target, \ }, + \ 'jump_first_target_keys': + \ (g:EasyMotion_enter_jump_first ? ["\"] : []) + + \ (g:EasyMotion_space_jump_first ? ["\"] : []) \ }) endfunction diff --git a/autoload/vital/_easymotion/HitAHint/Motion.vim b/autoload/vital/_easymotion/HitAHint/Motion.vim index de74cea..62c8697 100644 --- a/autoload/vital/_easymotion/HitAHint/Motion.vim +++ b/autoload/vital/_easymotion/HitAHint/Motion.vim @@ -53,12 +53,13 @@ let s:overwin = { \ 'shade': 'HitAHintShade', \ 'target': 'HitAHintTarget', \ }, +\ 'jump_first_target_keys': [], \ } \ } function! s:_init_hl() abort - highlight HitAHintShade ctermfg=242 guifg=#777777 - highlight HitAHintTarget ctermfg=81 guifg=#66D9EF + highlight default HitAHintShade ctermfg=242 guifg=#777777 + highlight default HitAHintTarget ctermfg=81 guifg=#66D9EF endfunction call s:_init_hl() @@ -181,6 +182,11 @@ function! s:overwin.choose_prompt(hint_dict) abort call hinter.after() endtry + " Jump to first target if target key is in config.jump_first_target_keys. + if index(self.config.jump_first_target_keys, c) isnot# -1 + let c = split(self.config.keys, '\zs')[0] + endif + if has_key(a:hint_dict, c) let target = a:hint_dict[c] return type(target) is# type({}) ? self.choose_prompt(target) : target