vim-ledger icon indicating copy to clipboard operation
vim-ledger copied to clipboard

Add syntax highlighting rules for timesheet format

Open colindean opened this issue 10 years ago • 7 comments

I'd love to have timesheet format highlighted.

i 2013/11/06 09:00:00 Billable:Frobnostication
o 2013/11/06 13:00:00 ;
i 2013/11/06 13:00:00 A:Vacation
o 2013/11/06 17:00:00 ;

What would be really awesome is zebra striping of some kind that shows paired lines.

colindean avatar Nov 19 '13 15:11 colindean

That's a pretty neat idea.

jwiegley avatar Nov 19 '13 22:11 jwiegley

I currently do not use timesheets myself. Is it common to have files where clock directives are interspersed with regular transactions? I otherwise quite like the zebra striping idea.

kljohann avatar Nov 23 '13 21:11 kljohann

I don't know of others' usage, but I keep my time separated from transactions.

"Johann Klähn" [email protected] wrote:

I currently do not use timesheets myself. Is it common to have files where clock directives are interspersed with regular transactions? I otherwise quite like the zebra striping idea.


Reply to this email directly or view it on GitHub: https://github.com/ledger/vim-ledger/issues/13#issuecomment-29141861

Sent from Kaiten Mail. Please excuse my brevity.

colindean avatar Nov 23 '13 21:11 colindean

Okay, also to clarify on zebra striping. Do you want one pair of i…⏎o… to have the same color (so that the next pair has a different color)? Or do you just want o-lines to have a color different from i-lines? While I can see both cases as useful, the former has no straight-forward approach that I know of (or could come up with in 10 minutes).

kljohann avatar Nov 23 '13 22:11 kljohann

I envisioned it being pairs, but I could see the use of having all i rows being one color and all o rows being another color, with perhaps some kind of highlighting for two rows of the same type that are together erroneously.

I actually kinda like that latter example better.

i <- these rows get no background color
o <-  
i <- these rows get a barely visible background color
o <-
i <- these rows get a red or other notable background color
i <-  
o <- this row gets the color that it should have if the row above wasn’t in error state
i
o

colindean avatar Nov 24 '13 01:11 colindean

Ah, to come back to having to track time and looking for syntax highlighting for it, only to find that I previously voiced my desire for it!

Maybe I'll get around to doing it myself in the next four years…

colindean avatar Sep 12 '17 16:09 colindean

Contributions welcome! I don't (yet) use time sheet functions, but having support in this plugin would be welcome and I'll be happy to review any PRs to that effect.

alerque avatar Jul 01 '19 14:07 alerque