Vim working natively on Android phones

Source: Internet
Author: User

Introduction

I own a HTC Dream. While one may discuss on its usability as a phone, it makes a great portable Internet access machine. I have installed a Debian chroot on this machine and used to boot it when I wanted to edit some stuff on the go-it had V IM, git, svn and anything else need. It is, however, tiring to enable it each and every time I wanted to edit something, and it used up some memory this only Could is freed by rebooting.

So I ' ve grabbed the NDK and built Vim for Android

Screenshot

Warning

This is only works for rooted phones. I have only tested it on G1 a.k.a. HTC Dream.

Download

Grab this archive with Vim 7.3 for Android.

Install using computer and ADB
ADB push vim-android.tar.gz/sdcardadb shell# su# CD/# tar-zxf/sdcard/vim-android.tar.gz# ^d

After this step, you should has a vim binary in/data/local/bin/vim-the directory should is in your $PATH, but can Ensure by typing:

# echo $PATH
Install using your phone only

Connect to your phone's shell using Connectbot, Better Terminal or other software. Then type as following:

$ su# CD/# wget-o-http://gdr.geekhood.net/gdrwpl/heavy/vim-android.tar.gz | TAR-ZXF-
Details

Vim is built using NDK. This means it doesn ' t link statically to libc or any libraries that is already present. The only library it had built-in is ncurses.

All vim-specific files is placed In/data/local/usr/share. It's equipped in syntax highlighting for VIM and shell files and some scripts I found in Ubuntu ' s vim distribution. More scripts can installed To/data/local/usr/share/vim. The default VIMRC file can also is found in that directory. The package also have a terminfo database stolen from Ubuntu-it's needed for color display. It ' s placed in/data/local/usr/share/terminfo

The list of options can be viewed Here:vim--version output. Mouse support are available if you apply my patches to Connectbot (vote for it inclusion into mainline!)

The binary size is about 1.3 MB.

Source

Put the content of the source pack in the sources/directory of Android NDK. Chdir to, directory and issue ndk-build to produce Vim binary in Libs/armeabi/vim.

The actual sources is in jni/directory. Ncurses is to being found in jni/ncurses/

Vim ' s auto/config.h and other automatically generated files is generated by./configure running on Ubuntu and tweaked mans Ually. Similar thing is do to ncurses ' curses.priv.h.

Simply relacing the source files with newer vim and rebuilding should does the trick of upgrading to the latest version. Adding new files to Android.mk could also be needed.

Vim working natively on Android phones

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.