25% developed

Komodo Edit

From Wikibooks, open books for an open world
Jump to navigation Jump to search

Komodo Edit is a free and open-source cross-platform text editor for a variety of programming languages.

Commands for Common Tasks[edit | edit source]

Connect to Remote Server[edit | edit source]

Click Edit=>Preferences=>Servers Enter server URL Enter user name and password

Browse Remote Server[edit | edit source]

Download and Install the "Remote Drive Tree" add-on Click the tab icon labeled "Show Specific Sidebar/Tab" Select Servers from the dropdown list

Bookmark Remote Server Directories

Click Toolbox=>Add=>New Live Folder Browse to Dev Server Mapped Drive Browse to remote folder on Remote Drive

Bookmark Line Number

Go to the line Hold Ctrl Key while pressing F2 Use carriage return on adjacent lines instead of current line to preserve mapping between bookmark and current text

Check Spelling

Click Tools=>Check Spelling

Check Hex Colors

Hold Ctrl key while mousing over color code

Goto Color Picker

Hold Ctrl key and click color code

Goto URL

Hold Ctrl key and click URL

Compare Changes to Last Save

Right click anywhere on the file Click Show Unsaved Changes

Copy File Path

Right click anywhere on the file Click Create Mapped URI Copy the path of the file

Open the Containing Folder of the Current File

Click the tab of the a file located in the folder Click File=>Open

Macro Creation

Profile Customization[edit | edit source]

Macro Usage

Click Tools=>Macros=>Start Recording Execute the set of commands you want to save Click Tools=>Macros=>Stop Recording Double Click the new macro at the bottom of the Toolbox

Tidy/Beautifier Command Usage

Create a tidy config file Select the text you want to format in the current file Click Tools=>Run Command Enter the tidy command in the text field: tidy -config {tidy_configxyz} Check the Pass Selection and Insert Output checkboxes Click Run

Kdiff/Beyond Compare/X-Winmerge Usage

Click Tools=>Run Command Click "More" Click "Add to Toolbox" to save it as a shortcut Select "No Console" next from the dropdown next to the Run In option Add the Kdiff.exe/BCompare.exe/Xwinmerge.exe location to the PATH environment variable Type in the HTTP address of the SVN/Mercurial/Git repo, or go to the local repo root using the "Browse" button Run the application: BCompare.exe %F %f

Snippet Usage

Open Toolbox in the right sidebar Right Click the Snippet you want to modify Click Properties Add %s between the tag to wrap the snippet around the selected text \n is not needed to insert carriage returns as in Find/Replace. Use the enter key instead To simply wrap a selection, check "Maintain indentation context after selection", then uncheck "Maintain selected text or cursor position after insertion". For example:

  • HTML Comments Snippet:
 <!--
 [[%s]]
 -->
  • JavaScript/CSS Comments Snippet:
 /*
 [[%s]]
 */

Extension Usage

To Install Extensions, click and drag the .xpi link to the Komodo window

Click the tab icon labeled "Show Specific Sidebar/Tab" Select the Add-On from the Projects or Toolbox dropdown list

Find/Replace Usage

Use the MoreKomodo extension to save replacement patterns as favorites Use the HTML Entities extension to quickly replace punctuation in HTML Replace $ with \ when porting regular expression backreferences from Perl Use \n to insert carriage returns with replacement text

Configuration

Disable unused Add-Ons and Plugins to speed up startup Use View=>Preview in Browser on a saved HTML file, then type about:config into the address bar to open the configuration menu If available, the View About:Config macro in the Snippets toolbar also opens the configuration menu. Here is the script

try 
 {
 ko.open.URI('about:config','browser');
 }
catch(e) 
 {
 alert(e);
 }

API Catalogs for Code Intelligence

Search for .cix files under path where Komodo is installed

Replace existing .cix file with the matching update listed here:

Preview in Browser

Use a Run Command to add a customized Preview to the toolbar:

Use a Macro to call the pickPreview method programmatically:

pickPreview("//foo.com", "en", "setting", "chrome")

Parameters

app.update.enabled: Automatic update check

app.update.interval: The value in seconds between automatic update checks

extensions.update.enabled: Automatic update check for extensions

extensions.update.interval: The value in seconds between automatic update checks for extensions

general.warnOnAboutConfig: Toogle About:config warning message

Windows Profile Location for Exporting Settings

(Drive):\Documents and Settings\(username)\Application Data\ActiveState\Komodo\(version)\prefs.xml or (Drive):\Documents and Settings\(username)\AppData\Local\ActiveState\Komodo\(version)\prefs.xml

GNU/Linux settings file location

~/.komodoedit/(version)/prefs.xml

XUL/RDF Tweaks for Extensions

Copy morekomodo.rdf from the extensions/morekomodo folder to the XRE folder to retain MoreKomodo Favorites after version updates

Edit kjslint.js and kjslint.xul to set default values for KjsLint

Keyboard Shortcuts[edit | edit source]

Goto Line: Ctrl + G

Goto End of Current Block: Ctrl + ]

Goto End of Current Word: Ctrl + Shift + →

Select the Current Block: Ctrl + Shift + ]

Hide/Show Line Numbers: Ctrl + Shift + 4

Find and Replace: Ctrl + H

Replace All: Alt + A

Interactive Find: Ctrl + I

Make Uppercase: Ctrl + U

Make Lowercase: Ctrl + Shift + U

Comment out Selection: Ctrl + 3

Decrease Selection Indent: Alt + C + D

Google the text that the cursor is on: Shift + F1

Toolbox Selection Properties: Alt + Enter

File Properties: Alt + E + L

Save: Ctrl + S

Open: Ctrl + O

Toggle Bookmark: Ctrl + F2

Next Bookmark: F2

Previous Bookmark: Shift + F2

Delete Bookmarks: Ctrl + Shift + F2

References[edit | edit source]

Extensions