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

Give a count to bold/italic/strike mappings #103

Closed
victorkristof opened this issue May 11, 2020 · 8 comments
Closed

Give a count to bold/italic/strike mappings #103

victorkristof opened this issue May 11, 2020 · 8 comments
Assignees
Labels
feature:request Requesting new and additions to existing features.

Comments

@victorkristof
Copy link

I really like how wrapping works, it makes it so easy to add markup to text. Most of the time I want to mark in bold or italic a single word only, so using <prefix>b is really convenient. But when I want to do it for several words, I need to visually select them first.

Would it make sense to add a count to these actions, such that [count]<prefix>b would mark the word under cursor and the [count] following words in bold?

Example

Cursor location indicated by ^.

This is a sentence with bold text.
                        ^

I press 2<prefix>b to obtain

This is a sentence with **bold text**.
                          ^
@SidOfc SidOfc self-assigned this May 11, 2020
@SidOfc SidOfc added the feature:request Requesting new and additions to existing features. label May 11, 2020
@SidOfc
Copy link
Owner

SidOfc commented May 11, 2020

Hi again @victorkristof, you are on 🔥 my man, I like it! 👍

I think this should also not be too hard to implement and would make sense indeed, thank you for yet another good suggestion <3

@victorkristof
Copy link
Author

Glad to hear!

By the way, currently <prefix>b is applied on a Vim word. I think it would make more sense to apply it to a WORD.

In fact:

This is snake-case.
        ^

becomes

This is **snake**-case.
        ^

when I press <prefix>b. But I was expecting

This is **snake-case**.
        ^

@SidOfc
Copy link
Owner

SidOfc commented May 13, 2020

It depends on how WORD is defined for markdown, since if it contains . characters it would cause bolding text to include punctuation within bold style, will check it out!

@SidOfc
Copy link
Owner

SidOfc commented May 16, 2020

@victorkristof yoho!

Been working on this a little bit, I think #104 supports all the behavior in this PR and a bit more and actually also fixes some small deficiencies I noticed while testing.

You can pull master / update mkdx normally to check it out, let me know if anything doesn't work properly for you, otherwise I think this one can be closed :)

@victorkristof
Copy link
Author

See my comment in #101 :)

@SidOfc
Copy link
Owner

SidOfc commented May 16, 2020

@victorkristof if you update again it should be fixed, re-merged all features I removed before

@victorkristof
Copy link
Author

Awesome! The count works perfectly and will be super useful. Thank you!

@SidOfc
Copy link
Owner

SidOfc commented May 16, 2020

Aight, with that I'll close this one, let me know if you see any more issues, feel free to reopen if you do!

Cheers for the suggestion, I may end up using this one myself now as well :)

@SidOfc SidOfc closed this as completed May 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature:request Requesting new and additions to existing features.
Projects
None yet
Development

No branches or pull requests

2 participants