Skip to content

Use dict for caser custom mappings #14

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

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

mulias
Copy link
Contributor

@mulias mulias commented Feb 21, 2020

This is a change I made on my fork because I found myself making custom mappings for many caser operations, and it was getting unwieldy. That said, I'm not 100% sure this is a good library API, since the dict approach more directly exposes the plugin internals to the end user.

  • Add more case operations for KEBAB-CASE, DOT.CASE and SPACE CASE
  • Let users override some or all plugin bindings with the g:caser_custom_mappings dictionary
  • Refactor to iterate thorough a dict to set <Plug> bindings.

mulias and others added 9 commits September 29, 2019 11:51
This change rolls back some of the refactors made in the previous
commit. While the code could be cleaner, we no longer get error E523
when trying to change the case of a visual selection. The issue seems to
be with the way <expr> was being used, but the specifics are still
unclear.
* Add TitleKebabCase function

TitleKebabCase converts to Title-Kebab-Case like used, for example, in PowerShell.

* Add K mapping for TitleKebabCase

* Added reference to the TitleKebab case

* Added Title-Kebab-Case to the README
Only sets <Plug> mappings, not default bindings
- Refactor mapping generation code to use a dictionary for default
  mappings.
- Check for the presence of a user defined `g:caser_custom_mappings`
  dictionary to override defaults.
@mulias mulias force-pushed the caser_custom_mappings branch from 684015c to fd6224e Compare February 22, 2021 18:41
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

Successfully merging this pull request may close these issues.

None yet

2 participants