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

Allow custom file extension for jrnl --edit command #1059

Closed
rizaon opened this issue Oct 20, 2020 · 2 comments · Fixed by #1139
Closed

Allow custom file extension for jrnl --edit command #1059

rizaon opened this issue Oct 20, 2020 · 2 comments · Fixed by #1139
Labels
enhancement New feature or request 📌 This can't go stale

Comments

@rizaon
Copy link

rizaon commented Oct 20, 2020

Feature Request

Currently, jrnl --edit comand will open temporary .txt file using user preferred editor.
https://github.com/jrnl-org/jrnl/blob/4ee4f38/jrnl/editor.py#L15
It will be great if there is a config to specify the file extension to use other than .txt.

Use Case/Motivation

Some editor has support for text highlighting depending on what is the file extension, such as markdown-mode (.md) or org-mode (.org) in emacs.
Allowing user to specify the preferred file extension to use in this edit command will in turn let the editor to display the right text highlighting.

@rizaon rizaon added 🆕 New! enhancement New feature or request labels Oct 20, 2020
@wren wren added 📌 This can't go stale and removed 🆕 New! labels Oct 24, 2020
@wren
Copy link
Member

wren commented Oct 24, 2020

This is a good idea. Should we add a config value. What would we name it?

Maybe we can just use the template field we already have? We could just copy the extension that the template has (and allow a blank template, too, in case people just want to give an extension without a full template).

@micahellison
Copy link
Member

I also like using the template field for to resolve this.

We were just talking about this today and toying with the idea of using the whole template file name as a suffix to the temporary file name when editing. So if, for instance, a template is named mytemplate.jrnl the temporary file could look like: jrnlmf1p_rgj-mytemplate.jrnl

This would solve this issue, while also making temporary jrnl entries a little bit more identifiable in editors for people such as myself that have waaaay too many tabs open all the time.

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

Successfully merging a pull request may close this issue.

3 participants