Tonight I managed to compile vim to run natively on my android phone! My phone is rooted and running cyanogenmod CM6 rc3. Rooting is necessary to run vim, but cyanogen probably isn't necessary.
First I had to compile ncurses using the ndk. Follow that link and compile ncurses the way I did if you want to have any hope of compiling vim using these instructions.
Once I had ncurses built, I had to make just a few changes to vim to get it to work.
I downloaded vim from the mercurial archive, which as of today is pretty much the same as the 7.3 release, I think. I figured out how to call configure by trial and error:
vim_cv_memcpy_handles_overlap=no \ vim_cv_bcopy_handles_overlap=no \ vim_cv_memmove_handles_overlap=no \ vim_cv_stat_ignores_slash=no \ vim_cv_getcwd_broken=no \ vim_cv_tty_group=world \ vim_cv_terminfo=yes \ LDFLAGS="-L/path/to/ncurses-5.7/lib" \ CFLAGS="-I/path/to/ncurses-5.7/lib" \ vim_cv_toupper_broken=no \ CC=agcc.pl \ ./configure --host=arm-eabi --with-tlib=ncurses
I got this error message: "could not compile program using uint32_t", and manually patched the configure script because I couldn't remember how to regenerate the script from the configure.in:
$as_echo_n "checking uint32_t is 32 bits... " >&6; } if test "$cross_compiling" = yes; then : true # as_fn_error "could not compile program using uint32_t." "$LINENO" 5 else
I also got an "undefined reference to sysinfo" error due to an android bug that omitted the sysinfo() call. So I commented out the HAVE_SYSINFO and HAVE_SYSINFO_MEM_UNIT lines in src/auto/config.h.
I think that was it! Once it finished compiling, I copied over the runtime/ directory and the src/vim binary to /data/vim on my phone. I did an "export VIMRUNTIME=/data/vim/runtime", and vim worked great!
Once I got my VIMRUNTIME set, I was able to ":syntax on", although I'm not getting any color. But otherwise it seems to work great!
You can find a tarball of vim for android on the Downloads page: look for vim-7.3-android-binary.tar.gz. There's also a tarred-up copy of my build directory, although I'm not sure why anyone would want that.