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

[FR] Allow different cfg_{editor|pager} config options for Markdown notes #120

Open
pataquets opened this issue Sep 12, 2022 · 7 comments
Open

Comments

@pataquets
Copy link
Contributor

pataquets commented Sep 12, 2022

Markdown notes may benefit from specific, customized pager and editor command, eg: vim +'set ft=markdown'. Some cfg_editor_markdown configuration setting (with fallback to cfg_editor if not present) might do.
Alternatively, passing note flags as command-line parameters (as done with {fname}) would enable writing a script to solve this.

@samuelallan72
Copy link

@pataquets I don't think this is necessary, because sncli is supposed create a tempfile with a filename extension depending on the type (.mkd for markdown and .txt for plain text). So your editor should automatically pick up the filetype=markdown for markdown notes, or you can run an autocmd based on the extension *.mkd or anything specific to sncli notes by matching on sncli-temp-*.

However I do notice there's a bug(?) where sncli will set the filetype based on cfg_default_markdown, rather than checking with the note... that might be worth addressing.

@samuelallan72
Copy link

@pataquets #122 may address your request, albeit in a slightly different way. Would you like to test it out? :)

@pataquets
Copy link
Contributor Author

pataquets commented Sep 13, 2022

@swalladge : I didn't noticed the bug, as I was using the pager most of the time. But opening with $EDITOR makes it visible. PR now correctly sets temp file extensions according to note type. LGTM.

However, I've noticed the extension mkd being used. Although it's recognized almost everywhere, I've found the most commonly used extension to be md, which is always recognized. Check out this SU thread. For the widest compatibility, I would bet safe on md as temp file extension. WDYT?

I've stumbled on this, since I'm using bat as my pager, and it's not detecting mkd as Markdown (although there is a workaround). I'll see if I manage to sort out my issue, but the PR helps, indeed.

@samuelallan72
Copy link

PR now correctly sets temp file extensions according to note type. LGTM.

Thanks. :)

However, I've noticed the extension mkd being used. Although it's recognized almost everywhere, ... For the widest compatibility, I would bet safe on md as temp file extension. WDYT?

I 100% agree. I just have a minor concern about backwards compatibility - I don't know how many users have scripts and such that depend on the *.mkd naming... So perhaps we could open a pull request and keep it open for comments for a period of time?

@samuelallan72
Copy link

PR now correctly sets temp file extensions according to note type. LGTM.
Thanks. :)

Oops, meant to add: would you mind adding your comment to the PR just for records sake? Just so I'm not merging a new PR with no reviews or comments 😬

@pataquets
Copy link
Contributor Author

[...]

However, I've noticed the extension mkd being used. Although it's recognized almost everywhere, ... For the widest compatibility, I would bet safe on md as temp file extension. WDYT?

I 100% agree. I just have a minor concern about backwards compatibility - I don't know how many users have scripts and such that depend on the *.mkd naming... So perhaps we could open a pull request and keep it open for comments for a period of time?

Me too. A PR open for a while seems like a nice compromise.

@samuelallan72
Copy link

@pataquets #123 :)

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

No branches or pull requests

2 participants