android+shell+vim,GitHub - bpowell/vim-android: Vim plugin to do android development.

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
安卓系统下的bash shell,ssh服务器,gcc编译器以及vim文本编辑器等 使用vim编辑多个文件 vim file1 file2 file3 ... :next查看或编辑后一个文档的内容 :prev查看或编辑前一个文档的内容 :first查看或编辑第一个文档的内容 :last查看或编辑最后一个文档的内容 vim -o|-O file1 file2 file3 -o:水平显示多个文件 -O:垂直显示多个文件 Ctrl+w arrow(箭头) 光标移动 Ctrl+w,s讲一个文件水平分屏显示 Ctrl+w,v将一个文件垂直分屏显示 :qa 全部退出 :wa 全部保存 将其他文件中的内容填充到当前文件中 :r (/PATH/TO/SOMEFILE)这是解释 跟shell交互 :!命令(command) 部分另存为 :w(全部保存) :m,nw(从第m行到第n行) :m,+n :.,$w 默认系统中所支持的shell cat /etc/shells bash特性 命令别名:自定义命令 alias:可以用来定义和设置命令的别名 注意:使用alias命令定义的别名其生命周期仅限于当前shell的生命期;如果修改.bashrc配置文件,其中保存的别名并不会立即生效,只有在重新加载该文件内容之后才会生效且永久生效;为了能够保证设置别名有效,通常两种操作都做 撤销别名:unalias . .bashrc:将.bashrc的命令读取 命令历史: bash进程会保存其会话中用户曾经执行的命令,以方便用户重复执行某个命令通过bash提供的历史命令文件来持久保存此前执行过的命令,用户由私有历史文件 登陆shell的时候,bash会自动读取~/.bash_history文件中所记录的所有命令 history命令: -c:清空历史缓冲区中的历史命令; -d OFFSET:删除特定历史命令条目; 重复执行前一个命令的方法: 使用上方向箭头,回车执行 Ctrl+p !-1 !! 重复执行历史缓冲区的命令 !#(#=数字):重复执行历史命令中的编号为#的命令 !(string)字符串:从历史缓冲区中查找最近一次执行过的以string开头的命令并执行 !?string:从历史缓冲区中查找最近一次包含string的命令并执行 !- number:执行历史缓冲区中倒数第number个命令 Ctrl+r:在历史缓冲区中实施搜索,回车执行即可: 重复使用历史命令中的一部分: !$ 、ESC .、ALT+:表示最后一次命令中最后一个参数; !^:第一个位置的参数 !:number:最后一次命令中第number个位置的参数 !number1:number2在历史缓冲区中第number1个命令的第number2个参数 快捷键 C-->Ctrl M-->Alt E-->Esc DEL-->Backspace C-l:clear 清屏 C-a:将光标跳至命令行行首 C-e:将光标跳至命令行行尾 C-k:删除光标所在位置至行尾的命令行信息 C-u:删除光标所在位置至行首的命令行信息 C-c:结束前台进程。取消命令的运行 命令补全机制: 命令本身字符串的补全 参数的补全 使用TAB键可以完成命令补全: 如果给出的字符串不能作为唯一标识,则bash不予补全;再次敲击TAB键,bash会给出参考列表;如果参考列表中的内容过多,bash会询问是否显示该列表;根据提供的参数路径来进行补全,如果参数没有任何提示信息,则默认从工作目录进行查找; 命令行展开: ~:bash会自动将其展开为当前登陆用户的家目录 ~STRING:bash会自动将其展开为以STRING为用户名为用户的家目录 ~+:调用shell变量pwd的值 ~-:调用shell变量oldpwd的值 {}:在花括号中可以填充一个以","分隔的路径列表,bash会将其展开为多个独立的路径; 命令的执行结果 任何以个Linux命令都有两种执行结果: 命令的正常输出结果:跟用户需求相关的返回内容: ``:反向单引号,反引号 $():标准的命令引用格式 wc:统计一个文件中的行数、字数及字节数 -c:只显示字节数 -l:只显示行数 -w:只显示字数 命令的执行状态返回值;跟命令执行成与否相关的返回命令 引用功能: '':强引用 凡是被单引号引用的内容,bash一律将其视为普通字符,即便本身有特殊功能和作用也是如此,但是单引号本身是个例外 "":弱引用 被双引号引用的内容有一些特殊字符仍然会保留器特殊含义 比如:$、\、"" 转义功能:
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值