Skip to content

Case-Aware Transformations

Renamify’s most powerful feature is its ability to understand and convert between different naming conventions automatically.

When you provide a search and replace pattern, Renamify automatically applies the transformation to all detected case variants:

  • snake_caseold_namenew_name
  • kebab-caseold-namenew-name
  • camelCaseoldNamenewName
  • PascalCaseOldNameNewName
  • SCREAMING_SNAKE_CASEOLD_NAMENEW_NAME
  • Title CaseOld NameNew Name
  • Train-CaseOld-NameNew-Name
  • dot.caseold.namenew.name

Renamify includes intelligent contextual separator coercion that adapts the replacement style based on the surrounding code context:

  • Context-aware replacement: renamify_core::Engine becomes renamed_renaming_tool_core::Engine (snake_case context)
  • Path-aware: src/renamify/main.rs becomes src/renamed-renaming-tool/main.rs (kebab-case for paths)
  • URL-aware: https://github.com/user/renamify becomes https://github.com/user/renamed-renaming-tool
  • Module-aware: renamify::core::apply() becomes renamed_renaming_tool::core::apply()

The coercion analyzes the immediate context around each match to determine the most appropriate separator style, making renaming feel more natural and reducing manual corrections.

Terminal window
# Only handle camelCase and snake_case
renamify plan old_name new_name --only-styles camel,snake
Terminal window
# Use defaults but exclude SCREAMING_SNAKE_CASE
renamify plan old_name new_name --exclude-styles screaming-snake
Terminal window
# Add Title Case and dot.case to the defaults
renamify plan old_name new_name --include-styles title,dot
Style NameExample
snakesnake_case
kebabkebab-case
camelcamelCase
pascalPascalCase
screaming-snakeSCREAMING_SNAKE_CASE
titleTitle Case
trainTrain-Case
dotdot.case
Terminal window
renamify plan getUserName fetchUserProfile

This will find and replace:

  • getUserNamefetchUserProfile
  • get_user_namefetch_user_profile
  • GetUserNameFetchUserProfile
  • GET_USER_NAMEFETCH_USER_PROFILE
  • get-user-namefetch-user-profile
Terminal window
# Only transform camelCase and PascalCase (common in TypeScript/React)
renamify plan oldComponent newComponent --only-styles camel,pascal
# Exclude SCREAMING_SNAKE_CASE (maybe it's used for constants you don't want to change)
renamify plan apiKey secretKey --exclude-styles screaming-snake
Terminal window
# Include title case for documentation or UI text
renamify plan user_profile account_settings --include-styles title

This would also transform:

  • User ProfileAccount Settings

Renamify is smart about word boundaries to avoid partial matches:

Good matches:

  • getUserName() - function call
  • const getUserName - variable declaration
  • getUserName: - object property
  • get_user_name.py - filename

Avoided:

  • getUserNameFromAPI - part of a longer identifier
  • prefixgetUserName - not at word boundary