Coder Social home page Coder Social logo

vim-android's Introduction

README

This sets up vim to do Android development. There are three vim scripts that are included 
in this setup. Those scripts are:
1. supertab
	a. http://github.com/ervandew/supertab.git
	b. http://www.vim.org/scripts/script.php?script_id=1643
2. Snipmate
	a. http://github.com/msanders/snipmate.vim.git
	b. http://www.vim.org/scripts/script.php?script_id=2540
3. javacomplete
	a. http://www.vim.org/scripts/script.php?script_id=1785

Supertab allows us to autocomplete with the tab key. Snipmate gives us the ability to 
add some abilities of the text editor TextMate. Javacomplete does the omnicompletion 
for the java and android classes/functions. Javacomplete does not have a git repo on
GitHub(that I could find. If someone knows if there is one, please let me know).

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> <ctrl>+<u>.

adblogcat is another custom vim script that uses some python. The current binding
to use this script is <F2>. Pressing <F2> 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 <F2> again.

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 this
command again:
ctags --recurse --langmap=Java:.java --languages=Java --verbose -f ~/.vim/tags $ANDROID_SDK/sources
This is what javacomplete uses for the android omnicompletion.

Requirements:
ctags
vim with python bindings
python
Android SDK
make
git

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


vim-android's People

Contributors

bpowell avatar funayman avatar

Watchers

RocknrollMarc avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.