{"id":34550046,"url":"https://github.com/avin/vscode-split-spaced-strings","last_synced_at":"2025-12-25T08:17:45.171Z","repository":{"id":329325223,"uuid":"1119107220","full_name":"avin/vscode-split-spaced-strings","owner":"avin","description":"Toggle single-line to multi-line string formats","archived":false,"fork":false,"pushed_at":"2025-12-21T10:17:41.000Z","size":757,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-12-21T21:41:21.399Z","etag":null,"topics":["vscode-extension"],"latest_commit_sha":null,"homepage":"https://marketplace.visualstudio.com/items?itemName=c75.split-spaced-strings","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/avin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-18T18:52:47.000Z","updated_at":"2025-12-21T10:17:44.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/avin/vscode-split-spaced-strings","commit_stats":null,"previous_names":["avin/vscode-split-spaced-strings"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/avin/vscode-split-spaced-strings","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avin%2Fvscode-split-spaced-strings","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avin%2Fvscode-split-spaced-strings/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avin%2Fvscode-split-spaced-strings/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avin%2Fvscode-split-spaced-strings/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/avin","download_url":"https://codeload.github.com/avin/vscode-split-spaced-strings/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avin%2Fvscode-split-spaced-strings/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28024502,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-25T02:00:05.988Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["vscode-extension"],"created_at":"2025-12-24T07:54:04.000Z","updated_at":"2025-12-25T08:17:45.156Z","avatar_url":"https://github.com/avin.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Split Spaced Strings\n\nToggle between single-line and multi-line string formats with a simple keyboard shortcut. Perfect for working with CSS classes, particularly Tailwind CSS, and improving code readability.\n\n![Demo](images/demo.gif)\n\n## Features\n\n- **Smart String Detection**: Automatically detects if your cursor is inside a string literal (single quotes, double quotes, or template literals)\n- **One-Key Toggle**: Seamlessly switch between single-line and multi-line formats\n- **Word-Per-Line Splitting**: Each word in the string gets its own line for better readability\n- **Preserves Indentation**: Maintains proper code indentation when splitting strings\n- **Reversible**: Toggle back and forth as many times as needed\n- **Auto-Collapse on Save**: Optional feature to automatically collapse split strings back to single line when saving (disabled by default)\n- **Visual Tracking**: Split strings are highlighted with a subtle background color to indicate they will be auto-collapsed on save\n\n## Use Cases\n\nPerfect for:\n- **Tailwind CSS Classes**: Manage long className strings in React/JSX\n- **CSS Classes**: Organize multiple class names\n- **String Lists**: Any space-separated string that becomes hard to read when long\n- **Code Review**: Make strings more readable before committing\n\n## Usage\n\n### Keyboard Shortcut\n\nPress `Alt+Shift+S` with your cursor inside any string literal.\n\n### Command Palette\n\n1. Open Command Palette (`Ctrl+Shift+P` or `Cmd+Shift+P`)\n2. Type \"Toggle Split/Merge String\"\n3. Press Enter\n\n### Customizing the Keyboard Shortcut\n\n1. Go to `File` → `Preferences` → `Keyboard Shortcuts` (or press `Ctrl+K Ctrl+S`)\n2. Search for \"Toggle Split/Merge String\"\n3. Click on the current keybinding and assign your preferred shortcut\n\n## Settings\n\n### Auto-Collapse on Save\n\nBy default, split strings remain in their multi-line format. However, you can enable automatic collapsing back to single line when saving the file:\n\n1. Open Settings (`Ctrl+,` or `Cmd+,`)\n2. Search for \"Split Spaced Strings\"\n3. Enable \"Auto Collapse On Save\"\n\nOr add to your `settings.json`:\n```json\n{\n  \"splitSpacedStrings.autoCollapseOnSave\": true\n}\n```\n\nWhen enabled:\n- Any string you split using `Alt+Shift+S` will be highlighted with a subtle yellow background\n- When you save the file (`Ctrl+S`), all highlighted strings will automatically collapse back to single line\n- This is useful for temporary formatting while editing, ensuring committed code stays compact\n\n### Customizing Highlight Appearance\n\nYou can customize how split strings are highlighted in the editor. All color values support CSS color formats (hex, rgba, etc.):\n\n```json\n{\n  \"splitSpacedStrings.highlightBackgroundColor\": \"rgba(255, 200, 0, 0.1)\",\n  \"splitSpacedStrings.highlightBorderColor\": \"rgba(255, 200, 0, 0.3)\",\n  \"splitSpacedStrings.highlightBorderWidth\": \"1px\",\n  \"splitSpacedStrings.highlightBorderStyle\": \"solid\",\n  \"splitSpacedStrings.overviewRulerColor\": \"rgba(255, 200, 0, 0.5)\",\n  \"splitSpacedStrings.overviewRulerLane\": \"right\",\n  \"splitSpacedStrings.highlightWholeLine\": true\n}\n```\n\n**Available Settings:**\n\n- **highlightBackgroundColor**: Background color for highlighted split strings (default: `rgba(255, 200, 0, 0.1)`)\n- **highlightBorderColor**: Border color for highlighted split strings (default: `rgba(255, 200, 0, 0.3)`)\n- **highlightBorderWidth**: Border width (default: `1px`)\n- **highlightBorderStyle**: Border style - `solid`, `dashed`, `dotted`, `double`, or `none` (default: `solid`)\n- **overviewRulerColor**: Color for markers in the editor scrollbar (default: `rgba(255, 200, 0, 0.5)`)\n- **overviewRulerLane**: Position of scrollbar markers - `left`, `center`, `right`, or `full` (default: `right`)\n- **highlightWholeLine**: Highlight the entire line width or just the text range (default: `true`)\n\n## Example\n```tsx\n// Before\n\u003cdiv className=\"flex items-center justify-between p-4 bg-white rounded-lg shadow-md hover:shadow-lg transition-shadow duration-200\"\u003e\n\n// After splitting (Alt+Shift+S)\n\u003cdiv className=\"\n  flex\n  items-center\n  justify-between\n  p-4\n  bg-white\n  rounded-lg\n  shadow-md\n  hover:shadow-lg\n  transition-shadow\n  duration-200\n\"\u003e\n```\n\n## Supported String Types\n\n- Single quotes: `'string'`\n- Double quotes: `\"string\"`\n- Template literals: `` `string` ``\n\nAll string types work with both single-line and multi-line formats.\n\n## Smart Quote Conversion\n\nThe extension intelligently handles quote types based on the programming language:\n\n### JavaScript / TypeScript / JSX / TSX\n- **On Split**: Converts `'` or `\"` → `` ` `` (template literals) for proper multiline support\n- **On Merge**: Restores original quotes (`'` or `\"`) if no template features are used\n- **Keeps backticks**: When template interpolation like `${...}` is detected\n- **JSX Attributes**: Preserves double quotes in JSX attributes (multiline is allowed)\n\n**Example:**\n```javascript\n// Original\nconst msg = 'hello world test';\n\n// After split - uses backticks\nconst msg = `\n  hello\n  world\n  test\n`;\n\n// After merge - restores single quotes\nconst msg = 'hello world test';\n\n// With template interpolation - keeps backticks\nconst msg = `hello ${name} test`; // Won't convert back to single quotes\n```\n\n### Python\n- **On Split**: Converts `'` or `\"` to `\"\"\"` for multiline strings\n- **On Merge**: Restores original quotes if no interpolation features are used\n\n### Go\n- **On Split**: Converts `\"` → `` ` `` (raw string literals)\n- **On Merge**: Restores `\"` if no special features used\n\n### C#, Java, Kotlin\n- **On Split**: Converts `\"` to `\"\"\"` for multiline strings\n- **On Merge**: Restores `\"` if no special features are used\n\n### PHP, Ruby\n- Preserves original quote type\n- Detects variable interpolation (`$variable`, `#{...}`) and maintains appropriate quotes\n\n### Other Languages\n- Works with any language\n- Preserves original quote type by default\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favin%2Fvscode-split-spaced-strings","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Favin%2Fvscode-split-spaced-strings","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favin%2Fvscode-split-spaced-strings/lists"}