summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2005-02-14 07:47:31 +0000
committerJohn Wiegley <johnw@newartisans.com>2008-04-13 02:41:00 -0400
commit219492564c6a4f6027c2eff37bc0a7b1455ad969 (patch)
tree21782fb8efe325ee855c4260f801d19625d9c060
parent1895ae6653c6d9b77744f7b50d4dc7082d844da2 (diff)
downloadfork-ledger-219492564c6a4f6027c2eff37bc0a7b1455ad969.tar.gz
fork-ledger-219492564c6a4f6027c2eff37bc0a7b1455ad969.tar.bz2
fork-ledger-219492564c6a4f6027c2eff37bc0a7b1455ad969.zip
*** empty log message ***
-rw-r--r--Makefile.am3
-rw-r--r--ledger.vim44
2 files changed, 46 insertions, 1 deletions
diff --git a/Makefile.am b/Makefile.am
index 2cfca6e6..814f80cd 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -123,4 +123,5 @@ all-clean: maintainer-clean
.gdb_history gmon.out h out TAGS ledger valexpr .deps \
build AUTHORS COPYING INSTALL Makefile aclocal.m4 autom4te \
acconf.h acconf.h.in config.guess config.sub configure \
- depcomp install-sh missing stamp texinfo.tex Makefile.in
+ depcomp install-sh missing stamp texinfo.tex Makefile.in \
+ results.out
diff --git a/ledger.vim b/ledger.vim
new file mode 100644
index 00000000..c817c752
--- /dev/null
+++ b/ledger.vim
@@ -0,0 +1,44 @@
+" Vim syntax file
+" filetype: ledger
+" Version: 0.0.2
+" by Wolfgang Oertl; Use according to the terms of the GPL>=2.
+" Revision history
+" 2005-02-05 first version (partly copied from ledger.vim 0.0.1)
+
+if version < 600
+ syntax clear
+elseif exists("b:current_sytax")
+ finish
+endif
+
+" for debugging
+syntax clear
+
+" region: a normal transaction
+syn region transNorm start=/^\d/ skip=/^\s/ end=/^/ fold keepend transparent contains=transDate
+syn match transDate /^\d\S\+/ contained
+syn match Comment /^;.*$/
+" highlight default link transNorm Question
+highlight default link Comment SpecialKey
+highlight default link transDate Question
+
+" folding: how to represent a transaction in one line.
+function! MyFoldText()
+ let line = strpart(getline(v:foldstart), 0, 65)
+ let line2 = getline(v:foldstart+1)
+ let line2 = substitute(line2, ".* ", "", "")
+ let pad_len = 80 - strlen(line) - strlen(line2)
+ if (pad_len < 0) then
+ pad_len = 0
+ endif
+ let pad = strpart(" ", 0, pad_len)
+ return line . pad . line2
+endfunction
+set foldtext=MyFoldText()
+set foldmethod=syntax
+
+" syncinc is easy: search for the first transaction.
+syn sync clear
+syn sync match ledgerSync grouphere transNorm "^\d"
+
+let b:current_syntax = "ledger"