vim/syntax: Add android logcat syntax
Change-Id: I84ce4010688086350a4cf1ce2d3cdcb0e6aaac02
syntax: add logcat hilighting
Change-Id: I7f232c06eb29ceb022c43e616aa9f57ed588ec6e
vim: Update logcat syntax detection
Change-Id: I73a18fa273753086779fce1e8a47efba7908ab95
diff --git a/runtime/scripts.vim b/runtime/scripts.vim
index ab66c0c..077b51c 100644
--- a/runtime/scripts.vim
+++ b/runtime/scripts.vim
@@ -360,6 +360,10 @@
elseif s:line1 =~# '^\(commit\|tree\|object\) \x\{40\}\>\|^tag \S\+$'
set ft=git
+ " Logcat
+ elseif s:line1 == '--------- beginning of '
+ set ft=logcat
+
" Gprof (gnu profiler)
elseif s:line1 == 'Flat profile:'
\ && s:line2 == ''
diff --git a/runtime/syntax/logcat.vim b/runtime/syntax/logcat.vim
new file mode 100644
index 0000000..595d0a2
--- /dev/null
+++ b/runtime/syntax/logcat.vim
@@ -0,0 +1,31 @@
+" Vim syntax file
+" Language: logcat
+" Maintainer: Naseer Ahmed <naseer.ahmed@gmail.com>
+" Latest Revision: 2014-07-06 <tpruvot@github>
+
+if exists("b:current_syntax")
+ finish
+endif
+
+" Define colors
+hi def LogF_color ctermfg=white guifg=white ctermbg=red guibg=red
+hi def LogE_color ctermfg=red guifg=red
+hi def LogW_color ctermfg=brown guifg=brown
+hi def LogI_color ctermfg=darkgreen guifg=darkgreen
+hi def LogD_color ctermfg=blue guifg=blue
+hi def LogV_color ctermfg=gray guifg=gray
+
+syn match LogF 'F/.*'
+syn match LogE 'E/.*'
+syn match LogW 'W/.*'
+syn match LogI 'I/.*'
+syn match LogD 'D/.*'
+syn match LogV 'V/.*'
+
+hi def link LogF LogF_color
+hi def link LogE LogE_color
+hi def link LogW LogW_color
+hi def link LogI LogI_color
+hi def link LogD LogD_color
+hi def link LogV LogV_color
+