{"id":140,"date":"2012-02-26T16:42:58","date_gmt":"2012-02-26T21:42:58","guid":{"rendered":"http:\/\/GetOffMyLawnEntertainment.com\/blog\/?p=140"},"modified":"2012-02-26T16:42:58","modified_gmt":"2012-02-26T21:42:58","slug":"keybinding-beauty","status":"publish","type":"post","link":"http:\/\/GetOffMyLawnEntertainment.com\/blog\/2012\/02\/26\/keybinding-beauty\/","title":{"rendered":"Keybinding beauty"},"content":{"rendered":"<p>When I first jumped into iOS development I obviously had to start using OSX. I hadn&#8217;t used a mac product before and wasn&#8217;t happy when I first moved over cause I had lost all productivity with my hands and my shortcuts. It sorta worked out that my main computer at the died on me so I was &#8216;stuck&#8217; using my new macbook pro for absolutely everything &#8211; not just development. It took a while but I finally picked up the majority of the shortcuts so I could move around fluidly without having to touch that blasted mouse. In fact I&#8217;m able to quickly jump back and forth between Windows and OSX on a daily basis and instantly switch between which keys I press (even though I use the exactly same 101-keyboard type for both).<\/p>\n<p>I still had problems with some of the shortcuts in XCode from an effective coding basis (like camelcase and fullword jumping) and thankfully I was able to change those around in XCode&#8217;s preferences. I think the most important shortcuts I changed were for page up\/down and the home\/end keys. It&#8217;s an automatic for me to jump around a file using home\/end page up\/down and the arrow keys and I was getting frustrated not being able to use them before. My key changes make me happy and more productive in XCode&#8230; but what about the rest of the system? I write a bunch of notes in TextEdit usually and I found lately I&#8217;m starting to get really frustrated when I go for that home\/end key to jump around the line, only to find myself at the top\/bottom of the document. Useless! A little bit of googlin&#8217; and I find myself an <a href=\"http:\/\/blog.macromates.com\/2005\/key-bindings-for-switchers\/\" onclick=\"javascript:_gaq.push(['_trackEvent','outbound-article','http:\/\/blog.macromates.com']);\" title=\"Changing Keybindings\" target=\"_blank\">answer<\/a> &#8211; you can change your key bindings \ud83d\ude42 <\/p>\n<p>So real quick just do the following:<\/p>\n<p><code><\/p>\n<pre>\r\nmkdir ~\/Library\/KeyBindings\r\ncd ~\/Library\/KeyBindings\r\ntouch DefaultKeyBinding.dict\r\n<\/pre>\n<p><\/code><\/p>\n<p>Now edit the new DefaultKeyBinding.dict file and add the following:<br \/>\n<code><\/p>\n<pre>\r\n{\r\n    \/* home *\/\r\n    \"\\UF729\"  = \"moveToBeginningOfLine:\";\r\n    \"$\\UF729\" = \"moveToBeginningOfLineAndModifySelection:\";\r\n\r\n    \/* end *\/\r\n    \"\\UF72B\"  = \"moveToEndOfLine:\";\r\n    \"$\\UF72B\" = \"moveToEndOfLineAndModifySelection:\";\r\n\r\n    \/* page up\/down *\/\r\n    \"\\UF72C\"  = \"pageUp:\";\r\n    \"\\UF72D\"  = \"pageDown:\";\r\n}\r\n<\/pre>\n<p><\/code><\/p>\n<p>Restart any Cocoa apps (like TextEdit) if they&#8217;re open, and then presto! home\/end keys work as expected. I can now jump to the beginning and end of the line with ease. It&#8217;s a small win, but I&#8217;ll take what I can get! \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When I first jumped into iOS development I obviously had to start using OSX. I hadn&#8217;t used a mac product before and wasn&#8217;t happy when I first moved over cause I had lost all productivity with my hands and my shortcuts. It sorta worked out that my main computer at the died on me so [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-140","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"http:\/\/GetOffMyLawnEntertainment.com\/blog\/wp-json\/wp\/v2\/posts\/140","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/GetOffMyLawnEntertainment.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/GetOffMyLawnEntertainment.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/GetOffMyLawnEntertainment.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/GetOffMyLawnEntertainment.com\/blog\/wp-json\/wp\/v2\/comments?post=140"}],"version-history":[{"count":2,"href":"http:\/\/GetOffMyLawnEntertainment.com\/blog\/wp-json\/wp\/v2\/posts\/140\/revisions"}],"predecessor-version":[{"id":142,"href":"http:\/\/GetOffMyLawnEntertainment.com\/blog\/wp-json\/wp\/v2\/posts\/140\/revisions\/142"}],"wp:attachment":[{"href":"http:\/\/GetOffMyLawnEntertainment.com\/blog\/wp-json\/wp\/v2\/media?parent=140"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/GetOffMyLawnEntertainment.com\/blog\/wp-json\/wp\/v2\/categories?post=140"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/GetOffMyLawnEntertainment.com\/blog\/wp-json\/wp\/v2\/tags?post=140"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}