Skip to content

Instantly share code, notes, and snippets.

@t9md
Created June 30, 2011 07:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save t9md/1055815 to your computer and use it in GitHub Desktop.
Save t9md/1055815 to your computer and use it in GitHub Desktop.
" Emacs's incremental-search forward(/) and backward(?) to occur(Unite lines) with <C-o>
" =====================================================
cnoremap <expr> <C-o> getcmdtype() == '/'
\ ? '<Esc>:<C-u>nohlsearch\|exe "Unite -input=" . escape(@/," ") . " lines:forward"<CR>'
\ : getcmdtype() == '?'
\ ? '<Esc>:<C-u>nohlsearch\|exe "Unite -input=" . escape(@/," ") . " lines:backward"<CR>'
\ : "\<C-o>"
" occur(=Unite lines) forward/backward
nnoremap ]o :UniteWithCursorWord lines:forward<CR>
nnoremap [o :UniteWithCursorWord lines:backward<CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment