gnu-arch-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnu-arch-users] Re: hack request


From: Alexey Voinov
Subject: Re: [Gnu-arch-users] Re: hack request
Date: Mon, 4 Oct 2004 13:33:09 +0400
User-agent: Mutt/1.4.2.1i

Zenaan Harkness wrote
> > > when I run "tla changes -scD --diffs|less", I'd love to have the feature
> > > that the diff lines that contain the file names of the diffed files,
> > > were in some color, like blue, so that they are highlighted, like
> > > "ls --color" does.
> > Pipe it to vimless instead; provided you have vim around.  less.sh
> > (vimless) can be found in $VIMRUNTIME/macros/.
> 
> I edit in vim, and it syntax highlights rather nicely.
> 
> When I run the above (or Phil's version) it just comes up plain.
> 
> If I first pipe the output to "t.diff" then open that file in
> vim, it does syntax highlight.
> 
> Anyone know if vim can be forced to syntax highlight when loading
> from stdin?
I have following in my ~/.vim/scripts.vim
if getline(1) =~ '^\*\slooking\sfor\s'
        setf tladiff
elseif
...
endif

This autodetects output from tla changes --diffs almost always.
And this is content of ~/.vim/syntax/tladiff.vim:

if version < 600
        syntax clear
elseif exists("b:current_syntax")
        finish
endif

runtime! syntax/diff.vim
unlet b:current_syntax

syn match diffRemoved   "^D.*"
syn match diffAdded     "^A.*"
syn match diffChanged   "^M.*"
syn match diffOldFile   "^\* looking for .*$"
syn match diffNewFile   "^\* comparing to .*$"
syn match diffComment   "^* \(added\|modified\) files$"

let b:current_syntax = "tladiff"

This colorizes some tla-specific lines.

-- 
Best Regards!
Alexey Voinov
             
address@hidden
address@hidden

Attachment: pgp0hJfQSqFMP.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]