Commit graph

40 commits

Author SHA1 Message Date
Johann Klähn
e2613d30d2 vim. fix handling of automated/recurring xacts 2011-07-31 17:43:57 +02:00
Johann Klähn
ecb5dac1da vim. improve completion and cache invalidation
The completion cache for account names will be updated
if there were no exact matches and the file was changed
since the cache has been generated.
2011-07-31 17:39:02 +02:00
Johann Klähn
24226c890e vim. allow cleared state for single postings
This should fix problems with account completion when using
marks with single postings as in:

2000/01/01 Whatever
  * account  5$
  some other account
2011-07-31 16:58:16 +02:00
Johann Klähn
1ef5e525be vim. add completion cache and payee completion 2011-05-09 19:57:50 +02:00
Johann Klähn
2da33a83e5 vim. update documentation somewhat 2011-05-09 19:57:50 +02:00
Johann Klähn
976d9e5d8b vim. correctly parse first lines of transactions
This fixes trailing comments being chopped of
and later readded with too few spaces. (when calling format_head())
2011-05-09 19:57:50 +02:00
Johann Klähn
67aadeb808 vim. fix unset completion type 2011-01-04 16:30:04 -05:00
Johann Klähn
4d56417f75 vim. parse comments at eol in parse_body() 2010-09-15 21:18:23 +02:00
Johann Klähn
4886646614 vim. fix off-by-one bug in ToggleTransactionState 2010-09-15 20:08:22 +02:00
Johann Klähn
453327a180 vim. fix issue with description in from_lnum()
Thanks to Chad Voegele, see mailing list ledger-cli@googlegroups.com:
  Whenever I had a transaction such as
  2010/09/10 * castle bar, nyc (beer)
  the transaction.from_lnum function would recognize (beer) as the code
  for the transaction which is incorrect since it comes at the end of
  the line.

Message ID:
73e397f4-234e-46fe-87e5-45f86f934bf1@k30g2000vbn.googlegroups.com
2010-09-15 20:03:27 +02:00
Johann Klähn
86153f670d vim. remove tag completion for now 2010-09-12 14:23:30 +02:00
Johann Klähn
3a679a695d vim. avoid misinterpretion of 1 char words 2010-09-12 14:18:06 +02:00
Johann Klähn
1be3a79385 vim. check for most common case first (parse_body) 2010-09-08 23:29:36 +02:00
Johann Klähn
6c0ccd5ffd vim. add LedgerToggleTransactionState()
By using
  call LedgerToggleTransactionState(line('.'), ' *?')
the state of the transaction will toggle through:
  no state -> * -> ? -> no state -> …
beginning at what ever state it currently has.
Adjust to your liking.

Thanks to Chad Voegele for the suggestion.
2010-09-08 23:24:39 +02:00
Johann Klähn
58fcb0f30f vim. make sure cursor/line is on a transaction
Thanks to Chad Voegele for reporting and fixing this in
the first place.
2010-09-08 22:31:42 +02:00
Johann Klähn
019a60e6d1 vim. update s:get_columns() 2010-09-08 22:18:28 +02:00
Johann Klähn
e4060eb421 vim. get transactions in a range of lines 2010-09-08 17:34:38 +02:00
Johann Klähn
eea6f33a2e vim. fix return type of s:transaction.from_lnum() 2010-09-08 17:34:05 +02:00
Johann Klähn
f7f8432c52 vim. add function to parse postings 2010-09-08 14:48:28 +02:00
Johann Klähn
ae3a8b6e11 vim. add case of automatic transactions 2010-09-08 14:44:34 +02:00
Johann Klähn
84fea7f136 vim. reimplement function to change state
Note: You now have to provide the line number:
  call LedgerSetTransactionState(line('.', '*')
2010-09-08 10:23:06 +02:00
Johann Klähn
f8c804ac79 vim. allow use of 0 as timestamp
To remove the effective date you would now call the function like this:
  call LedgerSetDate(line('.'), 'effective', -1)
2010-09-08 10:10:09 +02:00
Johann Klähn
66b39c46d1 vim. add function to modify actual/effective date
This allows you to set the effective date in a convenient way.
Maybe I will add date selection using calendar.vim by Yasuhiro
Matsumoto. Until then, you can map this to use today's date:
  call LedgerSetDate(line('.'), 'effective')
2010-09-08 10:01:44 +02:00
Johann Klähn
cf40d1c9d7 vim. introduce basic transaction 'class'/concept 2010-09-08 10:00:17 +02:00
Johann Klähn
2dff4dea3f vim. add function to change item state ~ reconcile
To try this, map or call the following function:
  LedgerSetTransactionState('') – removes state
  LedgerSetTransactionState('*') – sets 'checked' state
  …

The logic used to distinguish the different parts
of the first line of a transaction is rather basic
but proved to work so far.
2010-09-07 21:05:08 +02:00
Johann Klähn
04f564f01c vim. use ledger print as 'formatprg'
You can now try to select some lines using V (visual mode)
and have them automatically formatted using gq
2010-09-07 17:59:26 +02:00
Johann Klähn
2aa9f5115c vim. remove old completion by keyword 2009-06-29 16:41:36 +02:00
Johann Klähn
396e1a5002 Fix account completion for virtual transactions 2009-06-29 16:41:35 +02:00
Johann Klähn
84e6a6e926 vim. list 'deeper' entries first (completion) 2009-06-29 16:41:35 +02:00
Johann Klähn
a853a1c59a vim. some refactoring 2009-06-29 16:41:35 +02:00
Johann Klähn
fbf211c95e vim. basic support for tag completion 2009-06-29 16:41:35 +02:00
Johann Klähn
7aabf29285 vim. add function to collect all tags in a file 2009-06-29 16:41:34 +02:00
Johann Klähn
4156a0488c vim. fix for accounts with spaces 2009-06-29 16:41:34 +02:00
Johann Klähn
3b1898f3e8 vim: add current text to completion 2009-06-29 16:41:33 +02:00
Johann Klähn
4621f1117e vim: First try on omni completion for account names
That is a completion which is aware of what it should complete.
Currently only account names are supported.
When you insert an account name like this:
  Asse<C-X><C-O>
You will get a list of top-level accounts that start like this.
Go ahead and try something like:
  As:Ban:Che<C-X><C-O>
When you have an account like this, 'Assets:Bank:Checking'
should show up.
2009-06-29 16:41:33 +02:00
Johann Klähn
8e8d9e5c85 vim: add README 2009-06-17 23:27:33 +02:00
Johann Klähn
360025ac2f vim: fill text for "table" can be modified 2009-06-17 23:24:01 +02:00
Johann Klähn
7654ecc102 vim: complete account names with compl-keyword
Basic support for keyword completion (<C-X> <C-N>)
Will only work on account names with no spaces
2009-06-17 21:48:11 +02:00
Johann Klähn
9701548f7e vim: highlight account names
This helps to avoid confusion when an account is not
seperated from the amount by two spaces or a tab but only by one space.
In these cases the amount will now be highlighted
as if it belongs to the account name.

Thanks to user 'plaindocs' for reporting this.
2009-06-17 12:40:50 +02:00
Johann Klähn
b96df34d75 ledger.vim: split into multiple files
for better extendability
2009-06-15 23:37:57 +02:00