Need help with vim-android?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

hsanson
318 Stars 34 Forks BSD 2-Clause "Simplified" License 288 Commits 8 Opened issues

Description

Android development plugin for vim

Services available

!
?

Need anything else?

Contributors list

# 43,171
Kotlin
syntax-...
neovim-...
Vim
146 commits
# 117,480
sed
session...
cli-uti...
Flask
8 commits
# 76,082
Vim
syntax-...
neovim-...
React
7 commits
# 700,649
C#
sed
2 commits
# 446,911
sed
pony-la...
prose
vim-plu...
1 commit
# 687,477
Shell
sed
Perl
1 commit
# 231,392
sed
C++
C
Shell
1 commit
# 9,699
Shell
opal
Elixir
rubynlp
1 commit
# 737,199
sed
1 commit
# 61,172
HTML
Terrafo...
Kotlin
materia...
1 commit
# 285,808
HTML
sed
Flask
CSS
1 commit
# 794,400
sed
1 commit
# 29,042
Go
React
google-...
Lua
1 commit
# 230,747
dragonf...
netbsd
C
C++
1 commit

What is this?

This plugin provides functions for development of Gradle based projects. It also provides functions to support Android projects.

Installation Start

Install the plugin using your favorite plugin manager (e.g. NeoBundle):

NeoBundle "hsanson/vim-android"

If you have a gradle wrapper script (e.g gradlew or gradlew.bat) in your project root directory or if you have gradle in your PATH environment, then you are good to go. If you prefer to setup a specific gradle version then you need to set g:gradle_path to the absolute path where gradle is installed:

let g:gradle_path = /path/to/gradle/folder

this results in the plugin using the gradle binary located at:

/path/to/gradle/folder/bin/gradle

If you are working in an Android project then set the g:androidsdkpath with the absolute path where the android sdk is installed:

let g:android_sdk_path = /path/to/android-sdk

Usage

Open a java, kotlin or xml source file and this plugin will automatically kick in and perform some tasks:

  • Execute a custom vim gradle task to inspect the project and extract dependencies, project names, and android sdk versions.
  • Set CLASSPATH environment variable with the JAR dependencies of the project and the Android SDK jar.
  • Set SRCPATH environment variables with the project source sets.
  • Create Gradle and Android commands that can be used to invoke gradle tasks.

Once the plugin finishes loading the Gradle command becomes available to use:

:Gradle 

If the project is also an Android project then the android command also becomes available:

:Android 

Customizing Status Line

Using the Fantasque Sans font patched with the Nerd Fonts these are the status line glyphs I use in my own configuration:

Configuration

Combined with the ligthline plugin my status line looks like the following screen:

Lightline Status

Features

  • Automatically detect if file belongs to an android project when opening a java, kotlin or xml file.
  • Adds custom tasks to gradle build using Init scripts.
  • Updates the CLASSPATH environment variable with all jar and class files for the target Android API and gradle dependencies.
  • Updates the SRCPATH environment variable to include the current project source path and any other dependency source files available.
  • Sets custom gradle vim compiler.
  • Sets an extensive errorformat that captures java errors, kotlin errors, linter errors, test errors, aapt errors and adds them to the qflist.
  • Adds commands to build and install APK files in one or all devices/emulators present.
  • Adds commands to generate tag files for the Android SDK as well as your Android application.
  • Improved XML omnicompletion for android resource and manifest files. Thanks to Donnie West.
  • Customizable status line method that can be integrated with status line plugins (e.g. airline)

Details

Refer to the doc/vim-android.txt file for details on usage and configuration of this plugin.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.