{"id":93,"date":"2007-11-30T18:42:24","date_gmt":"2007-11-30T17:42:24","guid":{"rendered":"http:\/\/www.jurecuhalev.com\/blog\/2007\/11\/30\/textmate-tip-making-single-apostrophes-double\/"},"modified":"2007-11-30T18:42:24","modified_gmt":"2007-11-30T17:42:24","slug":"textmate-tip-making-single-apostrophes-double","status":"publish","type":"post","link":"https:\/\/www.jurecuhalev.com\/blog\/textmate-tip-making-single-apostrophes-double\/","title":{"rendered":"TextMate tip: Making single apostrophes double"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/upload.wikimedia.org\/wikipedia\/commons\/thumb\/1\/1c\/Quotation_Marks.svg\/200px-Quotation_Marks.svg.png\" class=\"zem_image\" alt=\"image\" style=\"margin: 5px; float: right\" height=\"142\" width=\"200\" \/>Coming from Python world where most of text is in double apostrophes like:<\/p>\n<p><code><br \/>\n\"Hello world\"<br \/>\n<\/code><\/p>\n<p>to <a href=\"http:\/\/en.wikipedia.org\/wiki\/JavaScript\" title=\"JavaScript\" class=\"zem_slink\"> JavaScript <\/a> where, e.g. <a href=\"http:\/\/en.wikipedia.org\/wiki\/JQuery\" title=\"JQuery\" class=\"zem_slink\"> jQuery <\/a>, expects you to write:<\/p>\n<p><code><br \/>\n$('#foobar')<br \/>\n<\/code><\/p>\n<p>with single quotes, it can be quite annoying to always have to type it twice, since for double quotes (&#8220;), <a href=\"http:\/\/en.wikipedia.org\/wiki\/TextMate\" title=\"TextMate\" class=\"zem_slink\"> TextMate <\/a> it always does it automatically. This feature is called <a href=\"http:\/\/macromates.com\/textmate\/manual\/working_with_text#auto-paired_characters_quotes_etc\">Auto-Paired Characters<\/a>.<\/p>\n<p>Here is a procedure how to extend your Auto-Paired characters to also include &#8216;, in the default list (or any other character for that matter).<\/p>\n<p>Go to <strong>Bundle Editor<\/strong>, and locate <strong>Text<\/strong> bundle (you might have to turn it on using <em>Filter List in bottom left corner). Now locate <strong>Text -&gt; Miscellaneous<\/strong> with (p) next to it. Inside it you should see a snippet of text that says:<\/em><\/p>\n<p><code><em><br \/>\n...<br \/>\nsmartTypingPairs = (<br \/>\n( '\"', '\"' ),<br \/>\n( '(', ')' ),<br \/>\n( '{', '}' ),<br \/>\n( '[', ']' ),<br \/>\n( '\u00e2\u20ac\u0153', '\u00e2\u20ac\u009d' ),<br \/>\n( \"', '\" ),<br \/>\n);<br \/>\n...<br \/>\n<\/em><\/code><\/p>\n<p><em>edit that snippet to look like this:<\/em><\/p>\n<p><code><br \/>\n...<br \/>\nsmartTypingPairs = (<br \/>\n( '\"', '\"' ),<br \/>\n( '(', ')' ),<br \/>\n( '{', '}' ),<br \/>\n( '[', ']' ),<br \/>\n( '\u00e2\u20ac\u0153', '\u00e2\u20ac\u009d' ),<br \/>\n( \"', '\" ),<br \/>\n<strong>\t\t( \"'\", \"'\" ),         &lt;--- insert this line<br \/>\n<\/strong> );<br \/>\n...<br \/>\n<\/code><\/p>\n<p>And that&#8217;s it! Just restart TextMate  for Bundle to reload and try it out by typing &#8216; and observe its new auto-pairing powers.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Coming from Python world where most of text is in double apostrophes like: &#8220;Hello world&#8221; to JavaScript where, e.g. jQuery , expects you to write: $(&#8216;#foobar&#8217;) with single quotes, it can be quite annoying to always have to type it twice, since for double quotes (&#8220;), TextMate it always does it automatically. This feature is [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[18,14],"tags":[54,56,55,57,935,52,53],"class_list":["post-93","post","type-post","status-publish","format-standard","hentry","category-javascript","category-tech","tag-apostrophe","tag-bundles","tag-double-apostrophe","tag-hack","tag-javascript","tag-textmate","tag-tip"],"acf":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.jurecuhalev.com\/blog\/wp-json\/wp\/v2\/posts\/93","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.jurecuhalev.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.jurecuhalev.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.jurecuhalev.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.jurecuhalev.com\/blog\/wp-json\/wp\/v2\/comments?post=93"}],"version-history":[{"count":0,"href":"https:\/\/www.jurecuhalev.com\/blog\/wp-json\/wp\/v2\/posts\/93\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.jurecuhalev.com\/blog\/wp-json\/wp\/v2\/media?parent=93"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.jurecuhalev.com\/blog\/wp-json\/wp\/v2\/categories?post=93"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.jurecuhalev.com\/blog\/wp-json\/wp\/v2\/tags?post=93"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}