1. Steve Losh
  2. clam.vim

Commits

Steve Losh  committed ad458d7

Add syntax support for the ls command (from Ümit Kablan).

  • Participants
  • Parent commits ed67c49
  • Branches default

Comments (0)

Files changed (2)

File clamsyntax/pacman.vim

View file
  • Ignore whitespace
+" 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

File plugin/clam.vim

View file
  • Ignore whitespace
         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
 
     silent! redraw
 
+    call s:ApplySyntaxFileForCommand(command)
+
     echo 'Shell command executed: ' . command
 endfunction " }}}