Skip to content

Add "Full Formatting" Option#31

Merged
zhisme merged 11 commits intozhisme:masterfrom
t-dub:feat/fuller-formatting
Jan 29, 2026
Merged

Add "Full Formatting" Option#31
zhisme merged 11 commits intozhisme:masterfrom
t-dub:feat/fuller-formatting

Conversation

@t-dub
Copy link
Copy Markdown
Contributor

@t-dub t-dub commented Nov 29, 2025

Enhancement Adding "Full Format" Option

README delta should clearly explain the new feature.

This addresses a desire I had which was to be able to copy code formatted as markdown in addition to a reference to the "remote" version. My use case is for sharing code with context via Slack to coworkers. In order to achieve that, I needed to be able to have a bit more control over the output.

This introduces a new output_formats format which takes an optional {code} token. That allows for both the case I described above but also for omitting the code altogether to quickly be able to pull a reference to the remote URL line. These are definitely secondary to the original intent here, but once I started using this plugin, I realized this was within reach.

This is intended to be a fully backward-compatible, non-breaking change. I'm happy to rework it in such a way that is "cleaner" but breaking if desired, but for an unsolicited PR, this seemed the best way to start.

- Introduce {code} output token
- Introduce output_formats alternative to formats as mechanism for
  specifying complete output format
@codecov
Copy link
Copy Markdown

codecov bot commented Nov 30, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown
Owner

@zhisme zhisme left a comment

Choose a reason for hiding this comment

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

Thank you @t-dub for the contribution! I think this is useful enhancement, plugin users will find it useful for sure (I do already)

I would like to merge this PR after requested changes, also please check test-coverage reported

@zhisme zhisme added the feature New feature or request label Dec 3, 2025
@t-dub
Copy link
Copy Markdown
Contributor Author

t-dub commented Dec 11, 2025

@zhisme OK, I think I got everything you raised if you wouldn't mind giving it another look.

I also snuck in another change, which is to add automatically-derived descriptions to the keymaps so that things like which-key.nvim will have something to display alongside the mapping.

@t-dub t-dub requested a review from zhisme December 11, 2025 22:17
Copy link
Copy Markdown
Owner

@zhisme zhisme left a comment

Choose a reason for hiding this comment

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

Agreed on which-key.nvim, that would be cool!

Regarding the code one small bug I spotted, once solved we are ready to merge

- output_formats must contain {copied_text} to include the copied code
- formats cannot contain {copied_text} (auto-prepended, would cause
duplication)
@zhisme
Copy link
Copy Markdown
Owner

zhisme commented Jan 29, 2026

@t-dub Thank you very much for this feature, this is very useful 🎉

@zhisme zhisme merged commit 2a72782 into zhisme:master Jan 29, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants