Hi Marco!

On Do, 10 Jan 2013, Marco wrote:

> Hi,
> 
> given the following file
> 
>   \foo
> 
>   ^ (cursor)
> 
>   \bar
> 
> When I run :execute "normal! /\\bar\r" vim yells:
> 
>   E486: Pattern not found: \bar
> 
> If I run /\\bar in normal mode this works. What is wrong with this
> and how do I rewrite the search so that \bar is found including the
> backslash?

You are searching for "\b"ar, where \b translates to the backspace char. 
This is described at :h expr-string.

You want either to use :exe 'norm! /\\bar'."\n" or
:exe "norm! /\\\\bar\n"


Mit freundlichen Grüßen
Christian
-- 
Und wir Deutsche sollen uns dann nur für original halten, wenn 
wir uns nicht über die Anfänge erheben!
                -- Goethe, Maximen und Reflektionen, Nr. 1149

-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Reply via email to