Popular recipes tagged "komodo" but not "javascript"http://code.activestate.com/recipes/tags/komodo-javascript/2013-11-20T21:15:22-08:00ActiveState Code RecipesCSS line with px value adds a new line with rem (JavaScript) 2013-11-20T21:15:22-08:00Magnus Axelssonhttp://code.activestate.com/recipes/users/4188509/http://code.activestate.com/recipes/578769-css-line-with-px-value-adds-a-new-line-with-rem/ <p style="color: grey"> JavaScript recipe 578769 by <a href="/recipes/users/4188509/">Magnus Axelsson</a> (<a href="/recipes/tags/convert/">convert</a>, <a href="/recipes/tags/css/">css</a>, <a href="/recipes/tags/komodo/">komodo</a>, <a href="/recipes/tags/macro/">macro</a>). </p> <p>Put your cursor on a CSS line that ends with a value in px (do not select any text). Run the script and it will insert a new line there the px value is converted to a rem value. </p> <p>You need to edit the code to modify your rem base matching the one you use in your own CSS. The default value is 16.</p> <p>Example: font-size: 12px; (run the script with the cursor in this line) font-size: 0.75rem (new line added by script) </p> Komodo JS macro: example chess match (JavaScript) 2012-10-24T16:59:51-07:00Todd Whitemanhttp://code.activestate.com/recipes/users/2666241/http://code.activestate.com/recipes/578304-komodo-js-macro-example-chess-match/ <p style="color: grey"> JavaScript recipe 578304 by <a href="/recipes/users/2666241/">Todd Whiteman</a> (<a href="/recipes/tags/chess/">chess</a>, <a href="/recipes/tags/editor/">editor</a>, <a href="/recipes/tags/komodo/">komodo</a>, <a href="/recipes/tags/macro/">macro</a>). </p> <p>This is an example macro that will play a specific chess game (Deep Blue v's Garry Kasparov) inside the Komodo editor.</p> Komodo JS Macro: Execute JavaScript (JavaScript) 2012-05-07T13:21:30-07:00Patrick Clokehttp://code.activestate.com/recipes/users/4180275/http://code.activestate.com/recipes/578120-komodo-js-macro-execute-javascript/ <p style="color: grey"> JavaScript recipe 578120 by <a href="/recipes/users/4180275/">Patrick Cloke</a> (<a href="/recipes/tags/debug/">debug</a>, <a href="/recipes/tags/debugging/">debugging</a>, <a href="/recipes/tags/editor/">editor</a>, <a href="/recipes/tags/komodo/">komodo</a>, <a href="/recipes/tags/macro/">macro</a>). </p> <p>Executes a JavaScript file (or the selected text) and display the results in the command output window.</p> Komodo JS Macro: move tabs (JavaScript) 2012-04-10T17:39:47-07:00Todd Whitemanhttp://code.activestate.com/recipes/users/2666241/http://code.activestate.com/recipes/578093-komodo-js-macro-move-tabs/ <p style="color: grey"> JavaScript recipe 578093 by <a href="/recipes/users/2666241/">Todd Whiteman</a> (<a href="/recipes/tags/editor/">editor</a>, <a href="/recipes/tags/komodo/">komodo</a>, <a href="/recipes/tags/macro/">macro</a>, <a href="/recipes/tags/position/">position</a>, <a href="/recipes/tags/tabs/">tabs</a>, <a href="/recipes/tags/toddw/">toddw</a>). </p> <p>This Komodo macro is an example to show how to programmatically re-position a Komodo editor tab. This macro moves the currently selected tab to the start of the tab list.</p> Komodo JS Macro: Real auto word-wrap (JavaScript) 2012-04-10T17:38:13-07:00Furlohttp://code.activestate.com/recipes/users/4180513/http://code.activestate.com/recipes/578099-komodo-js-macro-real-auto-word-wrap/ <p style="color: grey"> JavaScript recipe 578099 by <a href="/recipes/users/4180513/">Furlo</a> (<a href="/recipes/tags/auto/">auto</a>, <a href="/recipes/tags/komodo/">komodo</a>, <a href="/recipes/tags/macro/">macro</a>, <a href="/recipes/tags/word/">word</a>, <a href="/recipes/tags/wrap/">wrap</a>). </p> <p>This script will add real auto-wrap functionality to Komodo, ie. it will wrap text after reaching column 80 just in the same way as you would by pressing &lt;Enter&gt;.</p> <p>You can bind a keyboard shortcut to macro, or trigger it on Komodo startup, or both. Either way, repeated pressing of binded shortcut (or running the macro) will switch it off and on again.</p> <p>In fact, script only adds event listener, which fires a function (after each keypress), that checks if cursor position is not in column higher that 79 and, if needed, calls Komodo built-in function "Reflow paragraph" to reflow the paragraph.</p> <p>This recipe was not created by me from scratch. I have just read David Brewer's feature request at <a href="http://code.activestate.com/lists/komodo-discuss/4965/">komodo-discuss</a>, used <a href="http://www.openkomodo.com/blogs/troyt/revenge-auto-wrap-type-type-type-ding">troyt's original code</a> for autowrap and tweaked/simplified it a little.</p> Komodo Macro: stop leaving indented blank lines when you press enter (JavaScript) 2012-03-09T19:28:31-08:00Raymond Butcherhttp://code.activestate.com/recipes/users/4181141/http://code.activestate.com/recipes/578068-komodo-macro-stop-leaving-indented-blank-lines-whe/ <p style="color: grey"> JavaScript recipe 578068 by <a href="/recipes/users/4181141/">Raymond Butcher</a> (<a href="/recipes/tags/komodo/">komodo</a>, <a href="/recipes/tags/macro/">macro</a>). </p> <p>When your cursor is at the end of an indented blank line, and you press the enter key, this macro will catch that keypress and insert an empty new line above the current line. This pushes your indented line down, and you can keep coding as normal. It is quite seamless; the only difference is that you have not left any whitespace in your wake.</p> <p>This makes it easier to follow the Python PEP-8 style guide, but it's not limited to Python code.</p> Komodo JS Macro: smart quotes and smart braces (JavaScript) 2013-06-24T13:38:55-07:00Todd Whitemanhttp://code.activestate.com/recipes/users/2666241/http://code.activestate.com/recipes/577790-komodo-js-macro-smart-quotes-and-smart-braces/ <p style="color: grey"> JavaScript recipe 577790 by <a href="/recipes/users/2666241/">Todd Whiteman</a> (<a href="/recipes/tags/braces/">braces</a>, <a href="/recipes/tags/brackets/">brackets</a>, <a href="/recipes/tags/komodo/">komodo</a>, <a href="/recipes/tags/macro/">macro</a>, <a href="/recipes/tags/scintilla/">scintilla</a>, <a href="/recipes/tags/smart/">smart</a>, <a href="/recipes/tags/toddw/">toddw</a>). Revision 5. </p> <p>With this macro, you can make a text/word selection, then press one of ", ', (, [ or { and the matching set of quotes/braces will be added around the selection.</p> <p>Example (where | denotes the selection): This is |myselectedword|. then pressing "{" you'll get: This is {myselectedword}.</p> Komodo JS Macro: colorize the output console with a different color scheme (JavaScript) 2011-06-24T17:52:48-07:00Todd Whitemanhttp://code.activestate.com/recipes/users/2666241/http://code.activestate.com/recipes/577770-komodo-js-macro-colorize-the-output-console-with-a/ <p style="color: grey"> JavaScript recipe 577770 by <a href="/recipes/users/2666241/">Todd Whiteman</a> (<a href="/recipes/tags/color/">color</a>, <a href="/recipes/tags/komodo/">komodo</a>, <a href="/recipes/tags/macro/">macro</a>, <a href="/recipes/tags/scintilla/">scintilla</a>, <a href="/recipes/tags/toddw/">toddw</a>). </p> <p>It's possible to colorize any Scintilla based widget (the editor part) in Komodo using a color scheme. In Komodo there is the "Fonts and Color" preferences that get applied to all scintilla widgets, but you can manually change individual scintilla widgets as you wish.</p> <p>This macro changes the color scheme of the Command Output tab to use the "Dark" scheme.</p> Komodo JavaScript Macro - wrap the current word under the cursor (JavaScript) 2011-02-02T23:28:37-08:00Todd Whitemanhttp://code.activestate.com/recipes/users/2666241/http://code.activestate.com/recipes/577561-komodo-javascript-macro-wrap-the-current-word-unde/ <p style="color: grey"> JavaScript recipe 577561 by <a href="/recipes/users/2666241/">Todd Whiteman</a> (<a href="/recipes/tags/komodo/">komodo</a>, <a href="/recipes/tags/macro/">macro</a>, <a href="/recipes/tags/text/">text</a>, <a href="/recipes/tags/toddw/">toddw</a>, <a href="/recipes/tags/wrap/">wrap</a>). </p> <p>A <a href="http://www.activestate.com/komodo">Komodo</a> JavaScript macro that can be used to wrap the current word under the cursor position (or current selection) with arbitrary text.</p> <p>For example, if I'm editing a HTML file and have the selected text "This is my heading", I can quickly use this macro to wrap this text into "&lt;h1&gt;This is my heading&lt;/h1&gt;".</p> Post code to Pastebin.com (JavaScript) 2010-12-06T17:56:41-08:00Nathan Rambeckhttp://code.activestate.com/recipes/users/4171896/http://code.activestate.com/recipes/577489-post-code-to-pastebincom/ <p style="color: grey"> JavaScript recipe 577489 by <a href="/recipes/users/4171896/">Nathan Rambeck</a> (<a href="/recipes/tags/komodo/">komodo</a>, <a href="/recipes/tags/pastebin/">pastebin</a>). </p> <p>This is an updated version of another recipe (#577170) to post selected text to <a href="http://pastebin.com" rel="nofollow">pastebin.com</a>. This version uses the latest API. You'll want to change the following variables to your preferences: email, nick, expiry.</p> Get the Name of the Current Method (JavaScript) 2011-01-03T20:49:58-08:00Eric Promislowhttp://code.activestate.com/recipes/users/4166930/http://code.activestate.com/recipes/577532-get-the-name-of-the-current-method/ <p style="color: grey"> JavaScript recipe 577532 by <a href="/recipes/users/4166930/">Eric Promislow</a> (<a href="/recipes/tags/codeintel/">codeintel</a>, <a href="/recipes/tags/komodo/">komodo</a>, <a href="/recipes/tags/sections/">sections</a>). </p> <p>Here's a snippet for Komodo JavaScript macros that gives the name of the current method</p> A Template for Crash-Resistant Toggle-Macros (JavaScript) 2010-10-07T00:51:42-07:00Eric Promislowhttp://code.activestate.com/recipes/users/4166930/http://code.activestate.com/recipes/577418-a-template-for-crash-resistant-toggle-macros/ <p style="color: grey"> JavaScript recipe 577418 by <a href="/recipes/users/4166930/">Eric Promislow</a> (<a href="/recipes/tags/komodo/">komodo</a>, <a href="/recipes/tags/macro/">macro</a>, <a href="/recipes/tags/snippet/">snippet</a>, <a href="/recipes/tags/template/">template</a>). </p> <p>If you've followed my postings here lately (<a href="http://code.activestate.com/recipes/users/4166930/" rel="nofollow">http://code.activestate.com/recipes/users/4166930/</a>), you'll see that I've been playing with what I call "toggle macros", macros that toggle a state on and off, with different behaviors for each state. Unfortunately I found that it was easy to get Komodo to crash on shutdown. Meanwhile I wanted to build a framework to make it easier to build these.</p> <p>This recipe accomplishes both. It looks like putting a listener on a view object can trigger this crash, but so can storing a method on a view object, even with a unique name. So while I wanted to use the "view.view_closing" event, I can't, and I notice no other core Komodo code is. The template instead uses a global hash, ko.extensions.togglers, to store the code objects. And now I'm not getting a crash.</p> Implementing Vertical Editing in Komodo 6 (JavaScript) 2010-09-29T19:09:35-07:00Eric Promislowhttp://code.activestate.com/recipes/users/4166930/http://code.activestate.com/recipes/577406-implementing-vertical-editing-in-komodo-6/ <p style="color: grey"> JavaScript recipe 577406 by <a href="/recipes/users/4166930/">Eric Promislow</a> (<a href="/recipes/tags/columns/">columns</a>, <a href="/recipes/tags/komodo/">komodo</a>, <a href="/recipes/tags/verticalediting/">verticalediting</a>). Revision 4. </p> <p>When editing a group of similar lines, it's very convenient to be able to press down-arrow and move to the same starting column position on the next line. (See an example at <a href="http://community.activestate.com/forum/vertical-editing" rel="nofollow">http://community.activestate.com/forum/vertical-editing</a> ).</p> <p>This code is for a Komodo 6 macro -- possibly the only tweak necessary to make it work on Komodo 5 is by commenting out the "macro.save()" code, but I haven't tested it. The discussion below will talk about how to use it. </p> Komodo: avoid tab-buildup with a find-alternate-file macro (JavaScript) 2010-09-28T18:16:42-07:00Eric Promislowhttp://code.activestate.com/recipes/users/4166930/http://code.activestate.com/recipes/577412-komodo-avoid-tab-buildup-with-a-find-alternate-fil/ <p style="color: grey"> JavaScript recipe 577412 by <a href="/recipes/users/4166930/">Eric Promislow</a> (<a href="/recipes/tags/find_alternate_file/">find_alternate_file</a>, <a href="/recipes/tags/komodo/">komodo</a>). </p> <p>In Emacs I used to use find-alternate-file all the time to replace the current buffer with a different one, usually one in the same directory. Komodo doesn't provide an off-the-shelf way to do this, and if you can't be bothered to close buffers when you no longer need them, you'll soon suffer from the dreaded tab buildup problem, up there with the heartbreak of browser tab overload. But it's easy to write a macro to avoid this. </p> Komodo Macro: Show all Bookmarks (JavaScript) 2013-04-09T16:45:53-07:00Troy Topnikhttp://code.activestate.com/recipes/users/4165698/http://code.activestate.com/recipes/577272-komodo-macro-show-all-bookmarks/ <p style="color: grey"> JavaScript recipe 577272 by <a href="/recipes/users/4165698/">Troy Topnik</a> (<a href="/recipes/tags/bookmarks/">bookmarks</a>, <a href="/recipes/tags/komodo/">komodo</a>, <a href="/recipes/tags/macro/">macro</a>). Revision 5. </p> <p>Komodo JavaScript macro that shows a click-able list of all bookmarks in the Command Output tab.</p> Komodo Macro - Copy to clipboard code selection in HTML format (JavaScript) 2010-04-14T07:17:59-07:00Davide Ficanohttp://code.activestate.com/recipes/users/4166571/http://code.activestate.com/recipes/577193-komodo-macro-copy-to-clipboard-code-selection-in-h/ <p style="color: grey"> JavaScript recipe 577193 by <a href="/recipes/users/4166571/">Davide Ficano</a> (<a href="/recipes/tags/clipboard/">clipboard</a>, <a href="/recipes/tags/html/">html</a>, <a href="/recipes/tags/komodo/">komodo</a>, <a href="/recipes/tags/macro/">macro</a>). </p> <p>This macro makes easy to paste on documents (MS Office, Open Office, iWorks Pages) code snippets with syntax highlight and/or line numbers.</p> <p>This macro copies the selected code text or whole document if no selection is present on clipboard in HTML format.</p> <p>On OSX you need at least Komodo 6 because previous versions don't support data flavors</p> Sort file (with unique option) (JavaScript) 2010-05-30T21:47:36-07:00Glenn Jenkinshttp://code.activestate.com/recipes/users/4174057/http://code.activestate.com/recipes/577247-sort-file-with-unique-option/ <p style="color: grey"> JavaScript recipe 577247 by <a href="/recipes/users/4174057/">Glenn Jenkins</a> (<a href="/recipes/tags/file/">file</a>, <a href="/recipes/tags/komodo/">komodo</a>, <a href="/recipes/tags/sort/">sort</a>, <a href="/recipes/tags/unique/">unique</a>). </p> <p>This will sort the lines in the current document into alphabetical order. It doesn't apply any special rule (so 5 will come <em>after</em> 42).</p> <p>On running, it asks if you want a unique sort (Cancel for no, Ok for yes), in which case it'll remove duplicate lines.</p> Go to nth character (JavaScript) 2010-05-27T13:44:00-07:00Glenn Jenkinshttp://code.activestate.com/recipes/users/4174057/http://code.activestate.com/recipes/577246-go-to-nth-character/ <p style="color: grey"> JavaScript recipe 577246 by <a href="/recipes/users/4174057/">Glenn Jenkins</a> (<a href="/recipes/tags/character/">character</a>, <a href="/recipes/tags/goto/">goto</a>, <a href="/recipes/tags/komodo/">komodo</a>). </p> <p>Pops up a dialogue box to ask you for a character number (position), validates it, then moves the cursor to the character at that position in the current document.</p> <p>Useful for eg a SQL statement where you have an "error at character 3456"</p> Komodo JS Macro - Submit text selection to pastebin.mozilla.com service (JavaScript) 2010-03-31T06:34:21-07:00Davide Ficanohttp://code.activestate.com/recipes/users/4166571/http://code.activestate.com/recipes/577170-komodo-js-macro-submit-text-selection-to-pastebinm/ <p style="color: grey"> JavaScript recipe 577170 by <a href="/recipes/users/4166571/">Davide Ficano</a> (<a href="/recipes/tags/komodo/">komodo</a>, <a href="/recipes/tags/macro/">macro</a>, <a href="/recipes/tags/pastebin/">pastebin</a>). </p> <p>Submit the select text to pastebin and copy to clipboard the URL returned from service.</p> <p>The programming language is auto-detected.</p> <p>The statusbar will show the message about submission status.</p> <p><strong>Setting username</strong></p> <p>By default the post is submitted with 'anonymous' user, to change it set the <strong>nick</strong> variable to a different value </p> Komodo Macro - Clear all "Most Recent Used" lists (JavaScript) 2010-04-14T07:18:39-07:00Davide Ficanohttp://code.activestate.com/recipes/users/4166571/http://code.activestate.com/recipes/577192-komodo-macro-clear-all-most-recent-used-lists/ <p style="color: grey"> JavaScript recipe 577192 by <a href="/recipes/users/4166571/">Davide Ficano</a> (<a href="/recipes/tags/komodo/">komodo</a>, <a href="/recipes/tags/macro/">macro</a>, <a href="/recipes/tags/mru/">mru</a>). </p> <p>Clear all Komodo Most Recent Used lists</p>