{"id":48541,"date":"2025-07-18T13:58:04","date_gmt":"2025-07-18T17:58:04","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=48541"},"modified":"2025-07-18T13:58:04","modified_gmt":"2025-07-18T17:58:04","slug":"xcode-key-bindings-to-make-refactoring-less-painful","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2025\/07\/18\/xcode-key-bindings-to-make-refactoring-less-painful\/","title":{"rendered":"Xcode Key Bindings to Make Refactoring Less Painful"},"content":{"rendered":"<p><a href=\"https:\/\/qualitycoding.org\/xcode-key-bindings-refactoring\/\">Jon Reid<\/a>:<\/p>\n<blockquote cite=\"https:\/\/qualitycoding.org\/xcode-key-bindings-refactoring\/\">\n<p>Xcode supports automated refactoring. Supposedly.<\/p>\n<p>In practice, the options are limited and often unavailable. You&rsquo;ll right-click something, navigate to the Refactor submenu&#8230; only to find that the command you want is grayed out. It&rsquo;s a waste of time.<\/p>\n<p>[&#8230;]<\/p>\n<p>With these shortcuts, I can try an automated refactoring in less than a second. If it&rsquo;s not available, I get feedback right away &mdash; no wasted mouse clicks. And when it is available, I stay in the flow.<\/p>\n<\/blockquote>\n\n<p>The one I&rsquo;ve had the best luck with is <strong>Edit All in Scope<\/strong> (Command-Control-E), which isn&rsquo;t in the <strong>Refactor<\/strong> menu.<\/p>\n\n<p>Previously:<\/p>\n<ul>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2019\/09\/16\/faster-xcode-rename-refactoring\/\">Faster Xcode Rename Refactoring<\/a><\/li>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2017\/08\/23\/swift-local-refactoring\/\">Swift Local Refactoring<\/a><\/li>\n<\/ul>","protected":false},"excerpt":{"rendered":"<p>Jon Reid: Xcode supports automated refactoring. Supposedly. In practice, the options are limited and often unavailable. You&rsquo;ll right-click something, navigate to the Refactor submenu&#8230; only to find that the command you want is grayed out. It&rsquo;s a waste of time. [&#8230;] With these shortcuts, I can try an automated refactoring in less than a second. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"2025-07-18T17:58:06Z","apple_news_api_id":"f2ab4eb1-0d31-4fbd-9791-6d7a1dd9cb7a","apple_news_api_modified_at":"2025-07-18T17:58:06Z","apple_news_api_revision":"AAAAAAAAAAD\/\/\/\/\/\/\/\/\/\/w==","apple_news_api_share_url":"https:\/\/apple.news\/A8qtOsQ0xT72XkW16HdnLeg","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[4],"tags":[125,30,2598,71,226],"class_list":["post-48541","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-keyboardshortcuts","tag-mac","tag-macos-15-sequoia","tag-programming","tag-xcode"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/48541","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=48541"}],"version-history":[{"count":1,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/48541\/revisions"}],"predecessor-version":[{"id":48542,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/48541\/revisions\/48542"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=48541"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=48541"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=48541"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}