vim-logcat


Ⅰ. 插件描述

Syntax highlighting for Android LogCat logs

Ⅱ. 基本信息

创建日期:  2016-06-10
使用用户:  4
Github星:  6
插件作者:  Gabriel Burca

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'gburca/vim-logcat-would-can-one'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'gburca/vim-logcat-would-can-one'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'gburca/vim-logcat-would-can-one'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/gburca/vim-logcat

Ⅳ. 文档说明

# Android LogCat Syntax/FTDetect

This is a vim syntax file for Android LogCat log files. The log files must be
in the 'time' format: adb logcat -v time *:V

The filetype will be set to logcat for *.lc or *.logcat files or
if the second file line is similar to the example below (the 1st line may not
be a log entry, so that's why it's ignored).

A typical log entry is expected to look like this:

06-09 14:36:00.000 V/AlarmManager( 1484): sending alarm {957ff72 type 3 *alarm*:android.intent.action.TIME_TICK}
06-09 10:42:06.729 I/chatty  ( 1484): uid=1000(system) Binder:1484_5 expire 1 line

The highlighting may be customized from ~/.vimrc by adding tags to highlight
to the myTags group, and words to highlight to the myKeywords group. For
example, this would highlight "BatteryService" or "StatsUtilsManager" if they
appear in the log tag, and "success" if it appears in the log message.

autocmd BufReadPost * if exists("b:current_syntax") && b:current_syntax == "logcat"
autocmd BufReadPost *     syn keyword myTags BatteryService StatsUtilsManager
autocmd BufReadPost *     syn keyword myKeywords success
autocmd BufReadPost * endif

TODO

Handle log files in formats other than 'time' (ex: brief, process, tag,
threadtime, etc...).

添加新评论