# HG changeset patch
# User Steve Losh <steve@stevelosh.com>
# Date 1347127309 14400
# Node ID ad458d7e3e8d04449d30b46db0c7aa767a2c1d6d
# Parent  ed67c4908fa033eef6cdfacc8141750e99f1345b
Add syntax support for the ls command (from Ümit Kablan).

diff -r ed67c4908fa0 -r ad458d7e3e8d clamsyntax/pacman.vim
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/clamsyntax/pacman.vim	Sat Sep 08 14:01:49 2012 -0400
@@ -0,0 +1,17 @@
+" pacman program output syntax rules for Clam.vim
+
+" syn match outputItemLineFirst "\^\S\+/\.\+\>"
+syn match packageName "/\S\+\>"
+
+syn keyword packageGroupExtra extra
+syn keyword packageGroupCommunity community
+syn keyword packageGroupMultilib multilib
+syn keyword packageInstalledMark installed
+
+
+hi def link packageGroupCommunity Type
+hi def link packageGroupExtra     Type
+hi def link packageGroupMultilib  Type
+hi def link packageInstalledMark  Error
+hi def link packageName           String
+" hi def link outputItemLineFirst Comment
diff -r ed67c4908fa0 -r ad458d7e3e8d plugin/clam.vim
--- a/plugin/clam.vim	Fri May 04 00:09:55 2012 -0700
+++ b/plugin/clam.vim	Sat Sep 08 14:01:49 2012 -0400
@@ -38,6 +38,18 @@
         silent! execute winnr . 'wincmd w'
     endif
 endfunction " }}}
+function! s:ExtractBareCommanName(fullCommand)
+    let j = stridx(a:fullCommand, " ")
+    if j > -1
+        return a:fullCommand[0:j-1]
+    endif
+    return a:fullCommand
+endfunction
+function! s:ApplySyntaxFileForCommand(command)
+    let barecommand = s:ExtractBareCommanName(a:command)
+    let syntaxfile = "clamsyntax/" . barecommand . ".vim"
+    exe "runtime! " . syntaxfile
+endfunction
 function! s:ConfigureCurrentClamBuffer(command) " {{{
     " Set some basic options for the output window.
     setlocal buftype=nowrite bufhidden=wipe nobuflisted noswapfile nowrap nonumber
@@ -104,6 +116,8 @@
 
     silent! redraw
 
+    call s:ApplySyntaxFileForCommand(command)
+
     echo 'Shell command executed: ' . command
 endfunction " }}}