Add option to suggest words in different cases #60
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a feature I wanted for a long time and after posting my fork on Reddit many people have expressed their interest in having this feature upstream.
The design right now is that you can add this to your options
cases = { "snake", "pascal" }
to get suggestions of the words in your buffer in those cases. Out of the box I implementedsnake case
,camel case
,pascal case
,kebab case
, andmacro case
. Users can also provide functions that take a sequence of strings and return a string to add custom cases.Here is a screenshot of it working as intended:
I am relatively new to vim plugins so I was unsure about things like error messages and validation. For example, if the user specifies an incorrect case or provides a function that does not return a string there is currently no error message, it will simply not show the suggestion. If that is desirable I can add extra validation in those places.