zsh-users
 help / color / mirror / code / Atom feed
* Highlighting the command line based on arbitrary rules
@ 2013-06-10 13:54 Richard Hartmann
  2013-06-10 15:23 ` Bart Schaefer
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Hartmann @ 2013-06-10 13:54 UTC (permalink / raw)
  To: zsh-users

Dear all,

this may be approaching the clinically and/or criminally insane, but
is it possible to highlight sections of the command based on arbitrary
rules?

My specific use case is to detect git commit message subjects which
are longer than the recommended 50 characters as such:

    git commit foo/bar -m 'foo/bar: More gizmos, less snafus, and a
general disregard of subject length'

I would want everything after 'general' would be highlighted and,
ideally, not run the highlighting code unless `git ` is at the
beginning of the command line.


Again, this may be a really stupid, or even impossible, idea but being
stuck at an airport without Internet connection but a git repo, a TODO
list, and a massive hangover make this look good.


Thanks,
Richard


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Highlighting the command line based on arbitrary rules
  2013-06-10 13:54 Highlighting the command line based on arbitrary rules Richard Hartmann
@ 2013-06-10 15:23 ` Bart Schaefer
  2013-06-10 15:37   ` Jérémie Roquet
  2013-06-10 15:38   ` Richard Hartmann
  0 siblings, 2 replies; 4+ messages in thread
From: Bart Schaefer @ 2013-06-10 15:23 UTC (permalink / raw)
  To: zsh-users

On Jun 10,  3:54pm, Richard Hartmann wrote:
}
} this may be approaching the clinically and/or criminally insane, but
} is it possible to highlight sections of the command based on arbitrary
} rules?

Definitely.  Google for zsh-syntax-highlight for an extreme example.

Somebody probably even has a git plugin for that, but it's difficult
to search for, because of course the project is stored in github so
the addition of "git" to the search keywords is not helpful.

One caveat is that zsh-syntax-highlighting is currently known to tickle
an obscure memory management bug somewhere in the depths of ZLE.  We're
still hoping for somebody who can reproduce it to give us a valgrind or
similar debugging output.
 
} My specific use case is to detect git commit message subjects which
} are longer than the recommended 50 characters as such:
} 
}     git commit foo/bar -m 'foo/bar: More gizmos, less snafus, and a
} general disregard of subject length'

Yeah, I've been noticing that a bunch of us old CVS-heads (myself
included) don't particularly bother with including a "subject" in our
commit messages.

-- 
Barton E. Schaefer


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Highlighting the command line based on arbitrary rules
  2013-06-10 15:23 ` Bart Schaefer
@ 2013-06-10 15:37   ` Jérémie Roquet
  2013-06-10 15:38   ` Richard Hartmann
  1 sibling, 0 replies; 4+ messages in thread
From: Jérémie Roquet @ 2013-06-10 15:37 UTC (permalink / raw)
  To: zsh-users

2013/6/10 Bart Schaefer <schaefer@brasslantern.com>:
> On Jun 10,  3:54pm, Richard Hartmann wrote:
> }
> } this may be approaching the clinically and/or criminally insane, but
> } is it possible to highlight sections of the command based on arbitrary
> } rules?
>
> Definitely.  Google for zsh-syntax-highlight for an extreme example.
>
> Somebody probably even has a git plugin for that, but it's difficult
> to search for, because of course the project is stored in github so
> the addition of "git" to the search keywords is not helpful.
>
> One caveat is that zsh-syntax-highlighting is currently known to tickle
> an obscure memory management bug somewhere in the depths of ZLE.  We're
> still hoping for somebody who can reproduce it to give us a valgrind or
> similar debugging output.

Probably overkill in this case, but you might be interested in zpython
as well, see http://www.zsh.org/mla/workers/2013/msg00089.html .

Best regards,

-- 
Jérémie


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Highlighting the command line based on arbitrary rules
  2013-06-10 15:23 ` Bart Schaefer
  2013-06-10 15:37   ` Jérémie Roquet
@ 2013-06-10 15:38   ` Richard Hartmann
  1 sibling, 0 replies; 4+ messages in thread
From: Richard Hartmann @ 2013-06-10 15:38 UTC (permalink / raw)
  To: Bart Schaefer; +Cc: zsh-users

On Mon, Jun 10, 2013 at 5:23 PM, Bart Schaefer
<schaefer@brasslantern.com> wrote:

> Definitely.  Google for zsh-syntax-highlight for an extreme example.

Thanks.


> Yeah, I've been noticing that a bunch of us old CVS-heads (myself
> included) don't particularly bother with including a "subject" in our
> commit messages.

If it's any consolation, it took me, a SVN-head, years to really _get_
git. Once you realize (a few times in a row, at deeper and deeper
levels) what "branches are cheap" implies, it's bliss.

Along similar line, you will learn to love the subject lines.


--
Richard


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-06-10 15:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-10 13:54 Highlighting the command line based on arbitrary rules Richard Hartmann
2013-06-10 15:23 ` Bart Schaefer
2013-06-10 15:37   ` Jérémie Roquet
2013-06-10 15:38   ` Richard Hartmann

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).