Ⅰ. 插件描述
Vim plugin to do android development.Ⅱ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'bpowell/vim-android-long-live'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'bpowell/vim-android-long-live'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'bpowell/vim-android-long-live'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/bpowell/vim-android
Ⅳ. 文档说明
# vim-android
Develop for Android using vim.
Overview
There are three vim scripts that are included in this setup. Those scripts are:
SuperTab
SuperTab allows us to autocomplete with the tab key.
snipMate
snipMate gives us the ability to add some abilities of the text editor TextMate.
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 <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
- The preview window will be updated every second. As of right now, while the preview
- 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 stopadb logcat hit <F2> again.
Requirements
- ctags
- Vim with Python bindings
- Python
- Android SDK
- make
- git
Installation
First-time installation:
chmod +x android-install.sh
./android-install.shThe 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/sourcesThis is what javacomplete uses for the android omnicompletion.