On Mar 9, 7:24 pm, Ben Schmidt <[email protected]> wrote:
> On 10/03/11 4:09 AM, Fernando Basso wrote:
>
>
>
> > I installed MozRepl in Firefox from here:
> >https://github.com/bard/mozrepl/wiki
>
> > And gnu-netcat is also installed and working.
>
> > This page:
> >http://vim.wikia.com/wiki/Refresh_Firefox_%28preserving_scroll%29_on_...
>
> > ...shows and example function, that I just copied and pasted inside
> > $HOME/.vimrc
> > (arch linux). When I try to :write an .html file I get this error:
>
> > Error detected while processing BufWriteCmd Auto commands for
> > "*.html":
> > E492: Not an editor command: Refresh_firefox()
>
> > Any help would be appreciated.
>
> Looks like you didn't quite copy it properly from the Vim tip, but
> accidentally left out the :call part of the autocommand.
>
> Ben.
Thanks for the reply. This is exactly what I have in $MYVIMRC:
" **** MozRepl **** {{{
autocmd BufWriteCmd *.html,*.css,*.gtpl :call Refresh_firefox()
function! Refresh_firefox()
if &modified
write
silent !echo 'vimYo = content.window.pageYOffset;
\ vimXo = content.window.pageXOffset;
\ BrowserReload();
\ content.window.scrollTo(vimXo,vimYo);
\ repl.quit();' |
\ nc localhost 4242 2>&1 > /dev/null
endif
endfunction
" }}}
--
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