Vim plugin to do android development.

Related tags

Plugin vim-android
Overview

vim-android

Develop for Android using vim.

Overview

There are three vim scripts that are included in this setup. Those scripts are:

  1. SuperTab

    SuperTab allows us to autocomplete with the tab key.

  2. snipMate

    snipMate gives us the ability to add some abilities of the text editor TextMate.

  3. javacomplete2

    Javacomplete does the omnicompletion for the java and android classes/functions.

How it works

findAndroidManifest is a custom vim script that uses python to do the heavy lifting. This script will try and find an AndroidManifest.xml file in the current directory. If the file is not found in the current directory. It will serach up the directory tree until it finds one or it hits the root directory. Everytime vim is started up and a java file is detected, the script is ran to find the AndroidManifest.xml. If the manifest file is found, it will detect the version of android that you are targeting. It then adds the jar file for the target version of android to the classpath. This way javacomplete can omnicomplete android classes/functions. The way omnicompletion works is by pressing either the tab key or [Ctrl + X] and [Ctrl + U].

adblogcat is another custom vim script that uses some python. The current binding to use this script is . Pressing loads up a preview window with the output of adb logcat. The output of adb logcat is piped out to a file in the /tmp directory. The exact file is /tmp/adb-logcat-output.adb. The preview window is loaded up with this file. The preview window will be updated every second. As of right now, while the preview window is opened, you cannot edit the file you are working on. Before the preview window is updated, it jumps back to preview buffer and then updates. To turn this off and stop adb logcat hit again.

Requirements

  • ctags
  • Vim with Python bindings
  • Python
  • Android SDK
  • make
  • git

Installation

First-time installation:

chmod +x android-install.sh
./android-install.sh

The installer for this setup generates a ctags file that is placed in your ~/.vim folder. This is only ran once. Anytime that the Android SDK is updated you should run the following command:

ctags --recurse --langmap=Java:.java --languages=Java --verbose -f ~/.vim/tags $ANDROID_SDK/sources

This is what javacomplete uses for the android omnicompletion.

Comments
  • This fails on some Linux distros because of ctags and ctags-exuberant being incompatible

    This fails on some Linux distros because of ctags and ctags-exuberant being incompatible

    If you get the error:

    ctags: unrecognized option '--recurse'
    

    then you should change (in android-install.sh):

    if ! ctags --recurse --langmap=Java:.java --languages=Java --verbose -f ~/.vim/tags $ANDROID_SDK/sources 
    

    to if ! ctags-exuberant --recurse --langmap=Java:.java --languages=Java --verbose -f ~/.vim/tags $ANDROID_SDK/sources

    This is because ctags usually points to exuberant-ctags but on some distros (such as Ubuntu) it points to etags instead.

    opened by daniel-levin 2
  • Javacomplete git repo

    Javacomplete git repo

    https://github.com/vim-scripts/javacomplete

    This is a git mirror to javacomplete hosted by http://vim-scripts.org/. It'll be good for people using Pathogen or Vundle.

    opened by bilalq 1
  • javacomplete GitHub repo

    javacomplete GitHub repo

    Hi,

    The readme said to let you know if there was a GitHub repo for javacomplete, and it just so happens that the vim-scripts mirrors the plugin.

    Cheers!

    opened by andschwa 1
  • (feat) Clean up Makefile

    (feat) Clean up Makefile

    Changes:

    • Updated dependances for dist to auto copy only when needed
    • Removed all 'cd' commands for in favor of make chdir flag.
    • substituted make for $(MAKE) for cross compatible make
    opened by denzuko 0
  • check if ANDROID_SDK directory exists

    check if ANDROID_SDK directory exists

    As it is the install script only checks if the ANDROID_SDK variable is set, not if the directory it points to exists, that would be helpful since I ran into it while installing that I mistyped the path.

    opened by olijens 0
  • Fix overriding ctags in vimrc

    Fix overriding ctags in vimrc

    Currently the install script over writes the ctags declaration in the ~/.vimrc file. Find a way to append to the ctags declaration so people don't lose there setup.

    bug 
    opened by bpowell 0
  • E117: Unknown function: vam#DefineAndBind

    E117: Unknown function: vam#DefineAndBind

    when i run android-install.sh, it display the error

    Error detected while processing /home/yang/.vim/plugin/vim-addon-mw-utils/autoload/glob.vim:
    line    1:
    E117: Unknown function: vam#DefineAndBind
    E15: Invalid expression: vam#DefineAndBind('s:c','g:glob_like', '{}')
    line    4:
    E121: Undefined variable: s:c
    line    5:
    E121: Undefined variable: s:c
    E116: Invalid arguments for function get(s:c, 'glob_cache', {})
    E15: Invalid expression: get(s:c, 'glob_cache', {})
    line    6:
    E121: Undefined variable: s:c
    E15: Invalid expression: s:c['glob_cache']
    Error detected while processing /home/yang/.vim/bundle/vim-addon-mw-utils/autoload/glob.vim:
    line    1:
    E117: Unknown function: vam#DefineAndBind
    E15: Invalid expression: vam#DefineAndBind('s:c','g:glob_like', '{}')
    line    4:
    E121: Undefined variable: s:c
    line    5:
    E121: Undefined variable: s:c
    E116: Invalid arguments for function get(s:c, 'glob_cache', {})
    E15: Invalid expression: get(s:c, 'glob_cache', {})
    line    6:
    E121: Undefined variable: s:c
    E15: Invalid expression: s:c['glob_cache']
    Error detected while processing /home/yang/.vim/plugin/vim-addon-mw-utils/autoload/tiny_cmd.vim:
    line    3:
    E117: Unknown function: vam#DefineAndBind
    E15: Invalid expression: vam#DefineAndBind('s:c','g:vim_tiny_cmd', '{}')
    Error detected while processing /home/yang/.vim/bundle/vim-addon-mw-utils/autoload/tiny_cmd.vim:
    line    3:
    E117: Unknown function: vam#DefineAndBind
    E15: Invalid expression: vam#DefineAndBind('s:c','g:vim_tiny_cmd', '{}')`
    

    how can i reslove it??????

    @bpowell

    opened by yangzhanlong 1
  • Move adbLogCat and findAndroidManifest into separate repos

    Move adbLogCat and findAndroidManifest into separate repos

    This is really a minor niggle, but it would allow users to integrate your plugins with existing vim setups by adding them as submodules, rather than cloning the entire repo and symlinking them.

    enhancement 
    opened by glsignal 1
  • Add overview of commands to documentation.

    Add overview of commands to documentation.

    Add overview of commands for all scripts to the documentation. Something similar to this:

    Script Example command Overview supertab complete line: CTRL-X CTRL-L :help ins-completion

    documentation 
    opened by bpowell 0
Owner
Brandon Powell
Brandon Powell
Maven Plugin for Android Application development and more

ANDROID MAVEN PLUGIN A plugin for Android application development with Apache Maven 3.0.5+ and the Android SDK. Please check out our website for furth

simpligility 1k Jan 4, 2023
A plugin for Android Studio that speeds up your day-to-day flutter development.

Flutter-Toolkit 中文文档 A plugin for Android Studio that speeds up your day-to-day flutter development. Flutter ToolKit(Flutter Build Runner Helper), to

苏晟 4 Oct 19, 2022
A playground to development intellij plugin

pluginExporlor Template ToDo list Create a new IntelliJ Platform Plugin Template project. Get familiar with the template documentation. Verify the plu

Woody Hu 0 Nov 23, 2021
gradle-android-scala-plugin adds scala language support to official gradle android plugin

gradle-android-scala-plugin gradle-android-scala-plugin adds scala language support to official gradle android plugin. See also sample projects at htt

saturday06 345 Dec 10, 2022
eventbus-intellij-plugin 3.8 0.0 L1 Java Plugin to navigate between events posted by EventBus.

eventbus-intellij-plugin Plugin to navigate between events posted by EventBus. Post to onEvent and onEvent to Post Install There are two ways. Prefere

Shinnosuke Kugimiya 315 Aug 8, 2022
IntelliJ Idea Astor Plugin is a plugin that integrates Astor in Intellij Idea

IntelliJ Idea Astor Plugin IntelliJ Idea Astor Plugin is a plugin that integrates Astor in Intellij Idea. It communicates with a local/remote program

null 4 Aug 28, 2021
Intellij-platform-plugin-template - IntelliJ Platform Plugin Template

IntelliJ Platform Plugin Template TL;DR: Click the Use this template button and

null 0 Jan 1, 2022
BuildPlots-Plugin - PaperMC-Plugin for build contests written in Kotlin.

BuildPlotsPlugin PaperMC-Plugin for build contests. This is my first time using Kotlin and the first plugin I've written after a long time. It is stil

Lukas Heinzl 0 Jan 1, 2022
K6-intellij-plugin - IntelliJ-based Plugin to run k6 tests locally or in the k6 Cloud from your IntelliJ IDE

IntelliJ-based Plugin to run k6 tests locally or in the k6 Cloud from your Intel

Mikhail Bolotov 8 Jan 2, 2023
Ownership-gradle-plugin - Gradle code ownership verification plugin

Gradle code ownership verification plugin A gradle plugin that will verify owner

null 4 Dec 15, 2022
Maven Archetypes for Android development

android-archetypes This projects provides several Maven archetypes for Android. Those archetypes allows to quickly bootstrap a Maven project to develo

akquinet AG 444 Nov 25, 2022
Development environment for methodic projects

Methodic Super Project Get started developing faster! This superproject helps you get started building on the Methodic platform by providing a single

null 1 Mar 24, 2022
IntelliJ / Android Studio plugin for Android Holo Colors

This project is not maintained anymore. Holo Colors doesn't make sense since the introduction of Material Design and the ability to set the primary co

Jérôme Van Der Linden 644 Nov 10, 2022
ADB WIFI Android Studio plugin for debug android app over Wi-Fi.

ADB WIFI ADB WIFI Android Studio plugin for debug android app over Wi-Fi. How to install in Android Studio: go to Preferences

Sutachad Wichai 298 Jan 3, 2023
GPP is Android's unofficial release automation Gradle Plugin. It can do anything from building, uploading, and then promoting your App Bundle or APK to publishing app listings and other metadata.

Gradle Play Publisher Gradle Play Publisher is Android's unofficial release automation Gradle Plugin. It can do anything from building, uploading, and

null 3.9k Dec 30, 2022
IntelliJ Plugin for Android Parcelable boilerplate code generation.

IntelliJ/Android Studio Plugin for Android Parcelable boilerplate code generation This tool generates an Android Parcelable implementation based on fi

Michał Charmas 2.1k Dec 27, 2022
Android Studio plugin which automatically generates drawable selectors from appropriately named resources.

SelectorChapek for Android This Android Studio plugin automatically generates drawable selectors from appropriately named Android resources. How to in

Inmite s.r.o. 1.6k Dec 29, 2022
Gradle plugin which downloads and manages your Android SDK.

DEPRECATED This plugin is deprecated and is no longer being developed. Tools and dependencies are automatically downloaded using version 2.2.0 of the

Jake Wharton 1.4k Dec 29, 2022