* Meino Christian Cramer [2006.11.23 02:45]:
>  I want to search a longer string totally
>  literally...regexp totally switched of, no
>  exceptions.

function! LiteralSearch(string) range
   let l:pattern = escape(a:string, '\\/.*$^~[]')
   let @/ = l:pattern
   normal n
endfunction

:command -nargs=1 LS call LiteralSearch (<f-args>)

Then:

:LS .*$

Will match one time in this message, in the
function code above instead of matching every
line.

Map as desired.

HTH,

-- 
JR

Reply via email to