Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I set up Vim for Android development?

Tags:

android

vim

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).

like image 535
Catalin Morosan Avatar asked Jul 02 '10 11:07

Catalin Morosan


People also ask

Can you develop Android on Linux?

Android Studio will then download and configure Gradle in the background. Once Gradle has completed its installation and configuration, you can then start developing your Android app on Ubuntu.

What is IdeaVim Android studio?

The IdeaVim plugin emulates Vim in the IntelliJ IDEA editor, including normal, insert, and visual modes, Command-line and Ex modes, Vim regexp and configuration, and other features.


2 Answers

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.

like image 166
buru Avatar answered Oct 03 '22 09:10

buru


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.
like image 29
Horacio Avatar answered Oct 03 '22 07:10

Horacio