Hi!

Bram Moolenaar wrote:
        &/  search for the Visually selected text forward
        &?  same, backward

Is there a good alternative?

I think, this is ok. For the moment I have the following lines
in my vimrc file (I found the original code in a vim tip):

--- 8< ---
" Search in Visual and Selection modes with '*' and '#'
function MakeSearchString(str)
    return substitute(escape(@", '\\/.*$^~[]'), '\n', '\\n', 'g')
endfunction

function! <SID>VisualSearch(direction)
    if a:direction == '#'
        let l:rhs = "y?"
    else
        let l:rhs = "y/"
    endif
    let l:rhs = l:rhs . "^RMakeSearchString(@\")^M^MgV"
    return l:rhs
endfunction

vnoremap <expr> * <SID>VisualSearch('*')
vnoremap <expr> # <SID>VisualSearch('#')
--- 8< ---

(The ^R and ^M are special chars)

This does the job for me and I think, that these mappings
are rather consistent with the rest of Vim, since they
just expand the behavior of * and #.

What exactly do you plan? Which new features shall we expect?

Best wishes,
Georg




                
___________________________________________________________ Copy addresses and emails from any email account to Yahoo! Mail - quick, easy and free. http://uk.docs.yahoo.com/trueswitch2.html

Reply via email to