Skip to content

Commit aa2f549

Browse files
committed
plug mappings
1 parent 3b6a712 commit aa2f549

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

plugin/quick_scope.vim

+12-5
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,18 @@ if !exists('g:qs_highlight_on_keys')
7373
augroup END
7474
else
7575
" Highlight on key press. Set an 'augmented' mapping for each defined key.
76-
" for motion in filter(g:qs_highlight_on_keys, "v:val =~# '^[fFtT]$'")
77-
" for mapmode in ['nnoremap', 'onoremap', 'xnoremap']
78-
" execute printf(mapmode . ' <unique> <silent> <expr> %s quick_scope#Ready() . quick_scope#Aim("%s") . quick_scope#Reload() . quick_scope#DoubleTap()', motion, motion)
79-
" endfor
80-
" endfor
76+
for motion in split('fFtT', '\zs')
77+
for mapmode in ['nnoremap', 'onoremap', 'xnoremap']
78+
execute printf(mapmode . ' <silent> <expr> <Plug>QuickScope%s quick_scope#Ready() . quick_scope#Aim("%s") . quick_scope#Reload() . quick_scope#DoubleTap()', motion, motion)
79+
endfor
80+
endfor
81+
for motion in filter(g:qs_highlight_on_keys, "v:val =~# '^[fFtT]$'")
82+
for mapmode in ['nnoremap', 'onoremap', 'xnoremap']
83+
if empty(mapcheck(motion, mapmode[0]))
84+
execute printf(mapmode . ' <unique> <silent> <expr> %s <Plug>QuickScope%s', motion, motion)
85+
endif
86+
endfor
87+
endfor
8188
endif
8289

8390
" User commands --------------------------------------------------------------

0 commit comments

Comments
 (0)