function! VisualSearch(direction) range
let l:saved_reg = @"
execute "normal! vgvy"
let l:pattern = escape(@", '\\/.*$^~[]')
let l:pattern = substitute(l:pattern, "\n$", "", "")
if a:direction == 'b'
execute "normal ?" . l:pattern . "^M"
elseif a:direction == 'gv'
execute "vimgrep /" . l:pattern . "/" . " **/*"
elseif a:direction == 'f'
execute "normal /" . l:pattern . "^M"
endif
let @/ = l:pattern
let @" = l:saved_reg
endfunction
command :normal /pattern always show EasyMotion Cancelled. I think function of chooing some word and search it is useful. How can i combine with EasyMotion
since i want to implement function like
command
:normal /pattern
always show EasyMotion Cancelled. I think function of chooing some word and search it is useful. How can i combine with EasyMotion