Skip to content

Commit

Permalink
Basic implementation of CTRL-F (#50)
Browse files Browse the repository at this point in the history
Known issues:
- Returns to normal search instead of Oblique search On CTRL-C
- Does not work in operator-pending mode
- Does not highlight current match
  • Loading branch information
junegunn committed Feb 10, 2015
1 parent e9577bf commit 04c623b
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion plugin/oblique.vim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
" Copyright (c) 2014 Junegunn Choi
" Copyright (c) 2015 Junegunn Choi
"
" MIT License
"
Expand Down Expand Up @@ -233,6 +233,17 @@ function! s:matchadd(...)
endif
endfunction

nnoremap <Plug>(Oblique-o-/) /
nnoremap <Plug>(Oblique-o-?) ?
xnoremap <Plug>(Oblique-o-/) /
xnoremap <Plug>(Oblique-o-?) ?
function! g:_oblique_on_event(evt, new, cursor)
call feedkeys(
\ (s:backward ? "\<Plug>(Oblique-o-?)" : "\<Plug>(Oblique-o-/)") .
\ s:matching . "\<C-F>")
return [g:pseudocl#EXIT, a:new, a:cursor]
endfunction

function! g:_oblique_on_change(new, old, cursor)
if getchar(1) != 0
return
Expand Down Expand Up @@ -442,6 +453,7 @@ function! s:oblique(gv, backward, fuzzy)
\ 'prompt': ['ObliquePrompt', (s:count > 1 ? s:count : '') . (s:fuzzy ? 'F' : '') . sym],
\ 'input': s:optval('prefix') . vmagic,
\ 'history': history,
\ 'on_event': function('g:_oblique_on_event'),
\ 'map': s:optval('enable_cmap'),
\ 'highlight': 'ObliqueLine'
\ }
Expand Down

0 comments on commit 04c623b

Please sign in to comment.