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 extensions when editing (for easier syntax highlighting) #1139

Merged
merged 4 commits into from
Jan 2, 2021

Conversation

KarimPwnz
Copy link
Contributor

@KarimPwnz KarimPwnz commented Jan 2, 2021

With this PR, the temporary filename's suffix will either be its template filename or ".jrnl". This allows custom extensions and formalizes the ".jrnl" extension for "better text editor integration." I have also created the necessary tests.

This closes #1059 and closes #1080.

Checklist

  • I have read the contributing doc.
  • I have included a link to the relevant issue number.
  • I have tested this code locally.
  • I have checked to ensure there aren't other open pull requests
    for the same issue.
  • I have written new tests for these changes, as needed.
  • All tests pass.

@KarimPwnz KarimPwnz changed the title Make temporary filename's suffix be its template's or ".jrnl" (i.e allow custom extensions) Make temporary filename's suffix be its template filename or ".jrnl" (i.e allow custom extensions) Jan 2, 2021
jrnl/editor.py Outdated Show resolved Hide resolved
@wren wren added the enhancement New feature or request label Jan 2, 2021
@wren wren changed the title Make temporary filename's suffix be its template filename or ".jrnl" (i.e allow custom extensions) Allow custom extensions when editing (for easier syntax highlighting) Jan 2, 2021
Copy link
Member

@wren wren left a comment

Choose a reason for hiding this comment

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

This looks fantastic. Thank you!

@wren wren merged commit e9fd5cd into jrnl-org:develop Jan 2, 2021
@KarimPwnz KarimPwnz deleted the feature-customextension branch January 2, 2021 21:25
@alichtman
Copy link
Contributor

Has anyone written a custom syntax highlighting package for vim / neovim for .jrnl files? Is this in the works?

@wren
Copy link
Member

wren commented Jan 31, 2021

@alichtman I have a modified markdown sytnax that I use in my personal dotfiles for jrnl (see here). But there's not a proper package that I know of. We're not currently planning one, but would be happy to accept PRs and/or link to a package in the docs.

@alichtman
Copy link
Contributor

Ever considered making your syntax file a vim plugin? Basically just drop it in a separate repo, and make it importable through plug-in managers. I'd use it.

@wren
Copy link
Member

wren commented Feb 6, 2021

The reason I've put off making it a plugin is because the implementation is brittle, and tailored to my personal preferences. I keep telling myself that I'll clean it up and making a plugin, but haven't made it a priority.

But I think this might be an instance of the perfect being an enemy of the good(ish) enough. If I make it a plugin now, then users would likely file issues and PRs that would help improve it for everyone.

So, why not, I guess. I haven't made a vim plugin before, but I'll give it a shot with this. Thanks for prompting me about it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
3 participants