{"id":650,"date":"2012-05-11T15:10:20","date_gmt":"2012-05-11T19:10:20","guid":{"rendered":"http:\/\/www.jetmore.org\/john\/blog\/?p=650"},"modified":"2012-05-11T15:10:20","modified_gmt":"2012-05-11T19:10:20","slug":"adding-an-icon-to-the-edit-with-sublime-text-2-contextual-menu-item","status":"publish","type":"post","link":"https:\/\/www.jetmore.org\/john\/blog\/2012\/05\/adding-an-icon-to-the-edit-with-sublime-text-2-contextual-menu-item\/","title":{"rendered":"Adding An Icon To The &#8220;Edit With Sublime Text 2&#8221; Contextual Menu Item"},"content":{"rendered":"<p>As <a href=\"https:\/\/www.jetmore.org\/john\/blog\/2012\/05\/getting-up-to-speed-with-sublime-text-2-a-guide-for-notepad-users\/\">mentioned elsewhere<\/a> I&#8217;ve totally fallen in love with Sublime Text 2 as an editor.  One of the issues I&#8217;ve had switching to using it on Windows, though, is the muscle memory I&#8217;ve developed for selecting the &#8220;Edit With Notepad++&#8221; contextual menu option.  I think part of the reason I&#8217;m having trouble switching is that the Notepad++ item has an icon and, by default, the Sublime Text 2 item does not.  Several weeks ago I figured out how to add an icon to the Sublime Text 2 item and it has definitely reduced the number of times I&#8217;ve accidentally chosen Notepad++.  Better write it down before I forget how I did it&#8230;<\/p>\n<p><!--more--><\/p>\n<p>The basics of what I did were taken from a <a href=\"http:\/\/www.sublimetext.com\/forum\/viewtopic.php?t=3159&#038;f=4\">forum posting<\/a> which ultimately yielded the information I was looking for, but which presented commands I wasn&#8217;t prepared to run unvetted, and presented several different possible actions to take without being obvious which ones ended up being &#8220;correct&#8221;.<\/p>\n<p>For full disclosure, the steps below worked for me on a Win7 x86_64 machine.<\/p>\n<p>If I were to distill the action I took into a single command, ala the ones presented in the forum, it would be this:<\/p>\n<pre class=\"brush: powershell; title: ; notranslate\" title=\"\">\r\nreg add &quot;HKEY_LOCAL_MACHINE\\SOFTWARE\\Classes\\*\\shell\\Open with Sublime Text 2&quot; \/t REG_EXPAND_SZ \/v &quot;Icon&quot; \/d &quot;C:\\Program Files\\Sublime Text 2\\sublime_text.exe,0&quot;\r\n<\/pre>\n<p>In truth though I was too chicken to run that actual command without fully understanding what I was doing.  So here are the actual steps I took to add the icon:<\/p>\n<ul>\n<li>run `regedit` (windows-R -> &#8220;regedit&#8221; -> enter)<\/li>\n<li>Find (ctrl-F) &#8220;Open with Sublime Text 2&#8221;.\n<ul>\n<li>On my machine there were two results, one in HKEY_CLASSES_ROOT and one in HKEY_LOCAL_MACHINE.  Based on the discussion in the forum post above I chose to use the one in HKEY_LOCAL_MACHINE<\/li>\n<\/ul>\n<\/li>\n<li>Find the path to the executable being referenced by clicking on the &#8220;command&#8221; key under HKEY_LOCAL_MACHINE.  It&#8217;s the &#8220;Data&#8221; portion of the Default key, minus the %1.\n<ul>\n<li>On my machine it was &#8220;C:\\Program Files\\Sublime Text 2\\sublime_text.exe&#8221;<\/li>\n<\/ul>\n<\/li>\n<li>Add new key:\n<ul>\n<li>select &#8220;Open with Sublime Text 2&#8221;<\/li>\n<li>Choose the Edit->New->Expandable String Value menu item<\/li>\n<li>Change name of new entry to &#8220;Icon&#8221;<\/li>\n<li>Right click new value, select modify<\/li>\n<li>Enter the value you picked up from the command key into the &#8220;Value data&#8221; field, with &#8220;,0&#8221; added to the end\n<ul>\n<li>Example: &#8220;C:\\Program Files\\Sublime Text 2\\sublime_text.exe,0&#8221;<\/li>\n<\/ul>\n<\/li>\n<li>Click &#8220;OK&#8221;<\/li>\n<\/ul>\n<\/li>\n<li>Exit regedit<\/li>\n<\/ul>\n<p>After those steps, you should have an Icon next to the &#8220;Edit with Sublime Text 2&#8221; contextual menu item, like so:<\/p>\n<p><a href=\"https:\/\/www.jetmore.org\/john\/blog\/wp-content\/uploads\/2012\/04\/sublime-context-icon.png\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/www.jetmore.org\/john\/blog\/wp-content\/uploads\/2012\/04\/sublime-context-icon.png\" alt=\"\" title=\"sublime-context-icon\" width=\"327\" height=\"114\" class=\"aligncenter size-full wp-image-584\" srcset=\"https:\/\/www.jetmore.org\/john\/blog\/wp-content\/uploads\/2012\/04\/sublime-context-icon.png 327w, https:\/\/www.jetmore.org\/john\/blog\/wp-content\/uploads\/2012\/04\/sublime-context-icon-300x104.png 300w\" sizes=\"(max-width: 327px) 100vw, 327px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>As mentioned elsewhere I&#8217;ve totally fallen in love with Sublime Text 2 as an editor. One of the issues I&#8217;ve had switching to using it on Windows, though, is the muscle memory I&#8217;ve developed for selecting the &#8220;Edit With Notepad++&#8221; &hellip; <a href=\"https:\/\/www.jetmore.org\/john\/blog\/2012\/05\/adding-an-icon-to-the-edit-with-sublime-text-2-contextual-menu-item\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[5],"tags":[14],"_links":{"self":[{"href":"https:\/\/www.jetmore.org\/john\/blog\/wp-json\/wp\/v2\/posts\/650"}],"collection":[{"href":"https:\/\/www.jetmore.org\/john\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.jetmore.org\/john\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.jetmore.org\/john\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.jetmore.org\/john\/blog\/wp-json\/wp\/v2\/comments?post=650"}],"version-history":[{"count":10,"href":"https:\/\/www.jetmore.org\/john\/blog\/wp-json\/wp\/v2\/posts\/650\/revisions"}],"predecessor-version":[{"id":680,"href":"https:\/\/www.jetmore.org\/john\/blog\/wp-json\/wp\/v2\/posts\/650\/revisions\/680"}],"wp:attachment":[{"href":"https:\/\/www.jetmore.org\/john\/blog\/wp-json\/wp\/v2\/media?parent=650"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.jetmore.org\/john\/blog\/wp-json\/wp\/v2\/categories?post=650"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.jetmore.org\/john\/blog\/wp-json\/wp\/v2\/tags?post=650"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}