How can I set up Vim for Android development?

AndroidVim

Android Problem Overview


Can anyone describe a good Vim setup for Android Development? I'm using Eclipse for now but I would really like to use Vim because it's faster and I like it better. I'm not interested in Eclim for example.

I'm interested in what Vim plugins are used (for Java, autocomplete etc.), how the .vimrc looks like and how the whole process of building/running applications works (as efficiently as possible).

Android Solutions


Solution 1 - Android

I've once had to do some Android development on a netbook, and set up a nice Vim setup for this purpose. Seriously, it's easier than it seems:

  • Run emulator from the command line. It's better to do it anyway. I started mine with something like this:

    emulator -avd BlaDevice -no-boot-anim -scale 0.65 -show-kernel

  • To build and reinstall your modified app to the emulator, simply run ant reinstall from the project root. Map this command in Vim to your key combination of choice.

  • I've used typical Vim setup: NERDTree, FuzzyFinder, and omnicomplete. Java syntax highlighting works out of the box.

  • Never bothered to install Eclim, omnicomplete works just fine in most cases.

Solution 2 - Android

I have been working on a vim plugin for android development: https://github.com/hsanson/vim-android. Still work in progress but it has most functionality needed for android development using vim.

I still have some issues to solve but most are not related to the plugin:

  • Gradle errors from aapt report the wrong file. This makes jumping to the error from the quickfix window a pain as it opens the wrong file.
  • I cannot make javacomplete work correctly. When auto completing a class I wrote it gets stuck in "Searching..." and when auto completing a library or external JAR method javacomplete spits hundreds of errors making it impossible to use.

Solution 3 - Android

I've only done a little bit of Android development with VIM, but I'd very much suggest getting your head around Ant (which the SDK uses to build projects from the command line), and perhaps Maven if you're daring. You'll be using Ant a lot!

There are a few tab/auto-complete VIM scripts around, but don't expect them to be anywhere near as quick or useful as Eclipse. I've found myself doing a lot more typing than I'm used to from Eclipse...

Solution 4 - Android

Both of what @Dave and @buru suggested led me to work on a plugin for Vim that'd help you work on development in Vim for Android applications. Feature parity to top-level tools like the visual development isn't there yet, but I was wondering if we could generate some components by using Fries and extending it.

The plugin is called android.vim and it was on Github @ jalcine.github.io/android.vim. I'm very open to ideas and pull-requests so feel free!

Edit: I've taken down this plugin because I haven't the time or focus to work on it :(

Solution 5 - Android

I have just create a vim script for android development, it is called adt.vim, and I am using it, hope you will like it. http://www.vim.org/scripts/script.php?script_id=4330

If any suggestion, please tell me, it is still under improve

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionCatalin MorosanView Question on Stackoverflow
Solution 1 - AndroidburuView Answer on Stackoverflow
Solution 2 - AndroidHoracioView Answer on Stackoverflow
Solution 3 - AndroidDaveView Answer on Stackoverflow
Solution 4 - AndroidjackyalcineView Answer on Stackoverflow
Solution 5 - AndroidCook ChenView Answer on Stackoverflow