Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ledger#entry() function. #23

Closed
wants to merge 1 commit into from
Closed

Add ledger#entry() function. #23

wants to merge 1 commit into from

Conversation

lifepillar
Copy link
Contributor

Add a function that acts as a front end to ledger entry.

" enter a new transaction based on the text in the current line.
let l = line('.') - 1 " Insert transaction at current line (i.e., below the line above the current one)
normal "edd
exec l . 'read !ledger -f' shellescape(expand('%')) 'entry' shellescape(@e)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

Maybe we should avoid overwriting the contents of the e register:

let query = getline('.')
delete
exec l . 'read !ledger -f' shellescape(expand('%')) 'entry' shellescape(query)

@lifepillar
Copy link
Contributor Author

The text now is cut into the “black hole register”, so it does not affect any register.

kljohann added a commit that referenced this pull request May 26, 2015
@kljohann
Copy link
Member

Merged, thanks :)

@kljohann kljohann closed this May 26, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants