...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()
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
" }}}
OK. That looks fine. I even tried putting it in my .vimrc and it seems
to work.
I can't explain the error message. There's nowhere in that script that
Refresh_firefox is attempted to be used like a command.
My next-best guess is then that it has inappropriate line endings.
IIRC, Unix line endings will work on all platforms, but DOS line endings
will not work on Unix machines.
Try opening it and doing :set ff=unix and then :w to ensure it has Unix
line endings and see if that helps. (Be sure to restart Vim after doing
it, as .vimrc is read at startup.)
Another possibility...because you copy/pasted it from the web, maybe
it's got some non-breaking spaces or something like that in it, rather
than normal spaces. Put your cursor on a few spaces and press ga and
check Vim tells you < > 32, Hex 20, Octal 040. Check spaces used for
indenting as well as those used between tokens in the script.
Ben.
--
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