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

Inject current date at start of a new entry being composed in an editor #1906

Open
alichtman opened this issue Jun 27, 2024 · 1 comment
Open
Labels
enhancement New feature or request 📌 This can't go stale

Comments

@alichtman
Copy link
Contributor

Use Case/Motivation

When I run $ jrnl, with my editor set to vim, I see an empty editor:

image

If I edit an entry, the datetime is at the top left
image

Can we pre-place that value for the editor?

Example Usage

^

Other Information

No response

@micahellison
Copy link
Member

Hi @alichtman, thanks for filing this.

I think this is a good idea, though with some caveats. Right now, the default new entry datetime is the moment you finish your entry, and I don't want to break that functionality with a new default.

However, I still want jrnl to support this use case and I think the best long-term way to do that would be through a combination of two enhancements:

  • Support the journal storage datetime format when composing new entries. Currently, you can start an entry with the command line format (e.g. "tomorrow:") but you can't use this bracketed format. I just filed this: Support bracketed date style when composing new entry #1915.
  • Support a templating format such as Jinja (Support Jinja syntax in templates #1661) and add a custom variable for time in brackets. Then a template could be made with this time in it. Since the template would get evaluated before it goes to the editor, it would populate your editor with the time that you ran jrnl, rather than the time that you finish writing the entry.

@micahellison micahellison added the 📌 This can't go stale label Aug 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request 📌 This can't go stale
Projects
None yet
Development

No branches or pull requests

3 participants