On 2011-10-05, Eddine wrote:
> Hi Marcin,
>  
> thank you for your reply.
> I tried your command, but there's somehow a bug
>  
> 
>     map <F11> :write \| :split /tmp/eval.ml \| %d \|setlocal ft=omlet \|
>     setlocal autowrite \| r!ocaml < # \| wincmd p<CR>
>     map <F12> :write \| :dr /tmp/eval.ml \| %d \|setlocal ft=omlet \|setlocal
>     autowrite \| r!ocaml < # \| wincmd p<CR>
> 
>  
>  
> as the "wincmd" seems to be sent to ms-dos command;
> Im' receiving 
> shell returned 255
> "wincmd is not recognized as internal or external command etc.." in the 
> eval.ml
> file.
>  
> Can somone help ?

The :r! command sees the bar (|) as part of its argument and
includes it and the following wincmd in the text it passes to the
shell.  See

    :help :bar

The solution is to enclose the :r! command in an :execute command.
I think these versions of your mappings will work, but I have not
tested them.

    map <F11> :write \| :split /tmp/eval.ml \| %d \|setlocal ft=omlet \| 
setlocal autowrite \| exe 'r!ocaml < #' \| wincmd p<CR>

    map <F12> :write \| :dr /tmp/eval.ml \| %d \|setlocal ft=omlet \|setlocal 
autowrite \| exe 'r!ocaml < #' \| wincmd p<CR>

See

    :help :exe

Regards,
Gary

-- 
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