Komodo User Guide

Managing Projects and Files

Komodo's Project Manager is used to organize files and objects from the Toolbox. While it is possible to open, edit and debug files in Komodo without assigning them to a project, projects help organize related groups of files for easy access.

The top level of organization is the project file, which can contain both files and folders. Projects are physical XML files stored on the disk. (While it is possible to open and edit project files, it is not advisable, as errors can result in projects that can not be loaded by Komodo.) All project-related tasks can be done using the Komodo Project Manager.

Projects can contain both files and folders. Folders are metaphorical; that is, they do not directly correspond to directories on the disk. (However, when you Import from File System, folders will be created with the same name as the imported directories.)

Files can be added to both projects and folders. These are references to actual disk files.

Each component of the Project Manager has a context menu that is invoked by clicking with the right-mouse button. The items on the menu vary depending on the context from which the menu was invoked. For example, the context menu for files has an "Open Files" option, while the context menu for projects has a "Add New Folder" option.

Use Komodo's sample project to familiarize yourself with project functions. For details, see Getting Started.

Using the Project Manager

Creating Projects

To create a new project:

  1. From the File menu, select New|New Project.
  2. Browse to the desired directory and name your project.
  3. Click OK. The new project will be displayed in the Project Pane.

Alternatively, you can create a new project from the Getting Started Page page that displays when you launch Komodo. Select the option "Create New Project".

When you create a new project, the project file has no associated program files. To continue, you need to add a file to the new project.

Top

Opening Projects

To open a project:

  1. From the File menu and select Open|Project.
  2. Browse to the appropriate directory, highlight the desired project name and click Open.

or

  1. From the File menu and select Recent Projects.
    Modify Komodo's Appearance preferences to configure the number of projects displayed in the list.
  2. Select the project name.

Alternatively, you can open an existing project from the Getting Started Page page that displays when you launch Komodo.

  • If the project is listed under Recent Projects, click the project name.
    or
  • Click Open Existing Project.

The project name and associated files is displayed in the Project Pane. Opening a project opens only the project file and not the files associated with the project. To begin editing, you need an open file, or you could create a new file and then add the file to a project.

Top

Switching Between Open Projects

You can have many projects open, but only one project is active at any given time.

To switch between open projects, right click the desired project name in the Project Pane and select Make Active Project.

Alternatively, select Make Active Project from the Project drop-down menu, and select the project you wish to make active from the list of open projects.

Top

Adding Folders to Projects

Folders are used to group items in projects. They are metaphorical; that is, they do not directly correspond to directories on the disk. (However, when you Import from File System, folders will be created with the same name as the imported directories.)

To create a new folder beneath a project or existing folder, right-click the desired project or folder and select Add New Folder. Alternatively, from the Project drop-down menu, select Add to Project | Add New Folder. You will be prompted to provide a name for the new folder.

Right-click a folder to access a context menu with the following options:

  • Import from File System: see adding multiple files to a project for a description of the import options.
  • Properties: view and / change the name of a virtual folder.
  • Rename: to change the name of a folder, select this option and enter a new name.
  • Remove: to remove a folder from a project, select this option.
  • Add New Folder: to add a sub-folder to the selected folder, select this option. You will be prompted to specify a name for the new folder.
  • Add Existing File: to add a file to the selected folder, select this option.
  • Add Existing Remote File: to add files stored on an FTP server to a folder, select this option. In order to access remote servers, you must configure access to the server. See Opening Remote Files for information on accessing files stored on remote FTP servers.
  • Add New Snippet: to add a code snippet to the current folder, select this option. See Snippets for more information.
  • Add New Command: using Komodo's Run Commands function, you can create and save command-line interactions. These commands can be stored in folders using the Add Command menu option. This menu option will display the Command Properties dialog, which is described in the Running External Commands section of the User Guide.
  • Add New Dialog: to add a GUI Dialog to the current folder, select this menu option. See Using the GUI Builder for information about building dialogs.
  • Add New WebService: to add a Web service reference to the current folder, select this menu option. See Web Services for more information.
  • Add New Macro: to add a macro to the current folder, select this option. See Macros for more informtion.
  • Source Code on Contents: a sub-set of Komodo's Source Code Control functions can be performed on the files stored within the selected folder. See Source Code Control for a description of these options.
Top

Adding Files to Projects

Adding a single file to a project:

  1. Ensure the project is open and displayed in the Project Pane.
  2. Click the project name.
  3. To add a local file to the project, select Project|Add to Project | Add Existing File, and specify the desired file. Alternatively, right-click the project name in the Project pane and select Add Existing File. Browse to the directory where the desired file is stored, highlight the file name, and click Open.

    Alternatively, open the file using the File|Open dialog, then click and drag the file name tab from above the editor pane to the desired project.

    Files do not need to be located in the same directory as their associated project file.

Adding multiple files to a project:

Right-click the desired project and select Import from File System, or select Import from File System from the Project drop-down menu.

  • Directory to import from: Specify the directory from which you want to import files. Use the Browse button to navigate the filesystem.
  • Filenames to include: Specify the file names to include. Use standard wildcards to specify groups of files. If the field is left blank, all files in the specified directory will be imported.
  • Filenames to exclude: Specify the file names to exclude. Use standard wildcards to specify groups of files. If the field is left blank, no files in the specified directory will be excluded.
  • Import Subdirectories Recursively: Check this box to import directories (and files contained in those directories) located beneath the directory specified in the Directory to import from field. This box must be checked in order to specify the "Import Directory Structure" option as the Type of folder structure to create.
  • Type of folder structure to create:
    • Import directory structure: If the Import Subdirectories Recursively box is checked and this option is selected, Komodo will create folders within the project that represent imported directories. Thus, the directory structure will be preserved within the project.
    • Make a folder per language If this option is selected, imported files will be organized into folders according to the language indicated by file pattern in the file name. File associations are configured in the Komodo Preferences. Each folder is named after the associated language; for example, "Perl files", "XML files", etc. Files that don't correspond to a known file pattern are stored in a folder called "Other files".
    • Make one flat list If this option is selected, all the imported files will be placed directly under the project or file from which the Import from File System command was invoked.

On Windows systems, you may also add multiple files to a project by selecting multiple files in Windows Explorer and dropping them onto the desired project in the Project Pane.

To add files stored on FTP servers to a project:

  1. Ensure the project is open and displayed in the Project Pane.
  2. Right-click the project name, and select Add Existing Remote File, or right-click the project name in the Project pane and select Add Remote File....
  3. Alternatively, open the file using the File|Open|Remote File dialog, then click and drag the file name tab from to the desired project.
  4. Alternatively, from the Project drop-down menu, select Add to Project | Add Existing File.

See Opening Remote Files for information about configuring remote hosts.

Top

Adding Snippets to Projects

Komodo's Snippets are selections of frequently-used code. To add a snippet to a project:

  • Project context menu: right-click the desired project and select Add Command
  • Project drop-down menu: select Add to Project | Add Command.
  • Drag from Toolbox: with the left mouse button, click and drag a Command from the Toolbox to the desired project.
Top

Adding Commands to Projects

Komodo's Run Command dialog is used to interact with the system command line or shell while you are editing or debugging files. You can insert the results of shell commands into the document in the editor, or you can pass contents of the document to the shell prompt.

  • Project context menu: right-click the desired project and select Add Command
  • Project drop-down menu: select Add to Project | Add Command.
  • Drag from Toolbox: with the left mouse button, click and drag a Command from the Toolbox to the desired project.
Top

Adding Dialogs to Projects

Komodo (Professional version) works in conjunction with the ActiveState GUI Builder to provide an toolkit for creating graphical dialogs. For more information, see Using the GUI Builder.

  • Project context menu: right-click the desired project and select Add New Dialog
  • Project drop-down menu: select Add to Project | Add New Dialog.
  • Drag from Toolbox: with the left mouse button, click and drag a Dialog from the Toolbox to the desired project.
Top

Adding Web Services to Projects

For quick access, Web service bookmarks can be added to Projects. For more information, see Web Services.

There are three methods for adding Web services to Projects:

  • Project context menu: right-click the desired project and select Add New WebService
  • Project drop-down menu: select Add to Project | Add New WebService.
  • Drag from Toolbox: with the left mouse button, click and drag a Web service from the Toolbox to the desired project.
Top

Adding Macros to Projects

Macros are recorded sets of keystrokes. Saves macros can be added to Projects. For more information, see Macros.

There are three methods for adding Macros to Projects:

  • Project context menu: right-click the desired project and select Add New Macro
  • Project drop-down menu: select Add to Project | Add New Macro.
  • Drag from Toolbox: with the left mouse button, click and drag a Macro from the Toolbox to the desired project.
Top

Removing Items from Projects

Ensure that the project is displayed in the Project Pane. Right-click the item you wish to remove, and select Remove. Alternatively, click the item and then click the Delete key.

Top

Organizing Projects

Use the button on the top right of the Project Manager frame to select the fields that are displayed in the Project Manager. Click on the column headings to organize the items in the folder according to the contents of any column.

Top

Saving Projects

If an asterisk is displayed beside the project name, the project has been changed since it was opened. To save a project:

  • From the File menu, select Save Project.
    or
  • Right-click the project name and select Save Project.

The project that is currently highlighted in the Project Pane will be saved. If no project is highlighted, the Active Project (displayed in bold text) will be saved.

To save a project to a project file with a different name:

  1. From the File menu, select Save Project As.
    or
    Right-click the project name and select Save Project As.
  2. Browse to the desired directory and assign a name to your project. Komodo will append a .kpf extension, which indicates a Komodo Project File.
  3. Click Save.
Top

Closing Projects

To close a project:

  • From the File menu, select Close Project.
    or
  • Right-click the project name and select Close Project.

You will be prompted to save any changes files (including the project file itself).

Top

Working with Files

Creating Files

There are two methods for creating new files in Komodo: the New File button, and the File|New|New File menu option.

Creating New Files using the "New File" Button

When you click the New File button, a new file of the default type will be opened in the Komodo editor. Use the File Settings dialog in Komodo's Preferences to specify the default file type for new files.

Creating New Files using the "New File" Menu Option

The New File menu option (File|New|New File, or Ctrl + N) provides access to numerous templates for creating new files. These templates consist of standard code that is generally included in programs of the selected type. For example, the Perl template creates a file with a .pl extension that contains the line "use strict;"; the XSLT stylesheet template creates a file with an ".xsl" extension and an xml version and xsl stylesheet declaration.

To use a template file, select the category in the left pane, then double click the template name in the right pane. A new file will be created in the Komodo editor using the code stored in the template.

Creating Custom Templates
  1. Create Template File In Komodo, create a file with the code that you want to appear whenever you use the template. Give the file a name and an appropriate extension (according to the File Associations configured in Komodo's Preferences).
  2. Save as Template Select File | Save As Template. Custom templates are stored in the "My Templates" folder, which will be displayed in the dialog. You may create directories under the My Templates directory to organize template files.

To edit an existing template, select File | Open | Template File, and select the desired template.

Custom Template Notes
  • You can create shortcuts (on Windows) or symlinks (on Linux and Solaris) in the My Templates directory structure that point to files located elsewhere on your system.
  • If you create a directory alongside "My Templates" with the same name as a template group that already exists in Komodo (such as "Perl" or "Other Languages"), the contents of the two directories will be merged. If files of the same name exist in both directories, the file in the My Templates directory will be used.
Embedding Variables in Custom Templates

Komodo provides a simple function for embedding the current date and time in files created from custom templates. When you create a new file based on a template that contains one of these variables, the variables will be converted to their numerical value according to the system clock.

To embed a variable in a custom template, edit the template file and add one or more of the variable strings:

Variable String Result
[komodo-variable: $LOCAL_YEAR] the current year
[komodo-variable: $LOCAL_MONTH] the current month
[komodo-variable: $LOCAL_DAY] the current day
[komodo-variable: $LOCAL_HOUR] the current hour
[komodo-variable: $LOCAL_MINUTE] the current minute
[komodo-variable: $LOCAL_SECOND] the current second
[komodo-variable: $LOCAL_WEEKDAY] the current day of the week (numerical value)
[komodo-variable: $LOCAL_JULIAN_DAY] the Julian day value
Top

Opening Files

To open a file that is associated with a Project, first open the project, then double-click the file name to open the file. To open a file that is not associated with a project, do one of the following:

  1. From the File menu, select Open
    or
    Press Ctrl+O.
    or
    Click the Open button.
  2. Browse to the appropriate directory, highlight the desired file name and click Open.

Komodo internally stores the name of projects and files that have been recently opened. The number of file and project names stored depends on the value specified in the Appearance dialog of the Preferences form.

  1. From the File menu, select Recent Files.
  2. Select the desired file name.

You can also access the list of recently opened files on Komodo's Getting Started Page. To open a file from the Getting Started page:

  • If the file is listed under Recent Files, click the file name.

The file opens in the Editor pane with the appropriate color, syntax, and indentation for that language. You can now edit the file.

Top

Opening Remote Files

You can open and edit files that exist on remote machines, providing that the remote machine is configured for FTP access. To quickly access FTP servers that you use frequently, create an entry in the Server Preferences (Edit|Preferences|Server).

To open a file located on a remote FTP server, select File|Open|Remote File...

Connecting to an FTP Server

  • Pre-Configured Server Connection if you have configured FTP servers in Komodo's Preferences, select the name of the account from the Server drop down box. You can also access the Preferences dialog by clicking the Accounts button to the right of the Servers field.
  • Manual Server Connection enter the ftp address (in the format "ftp.server.com") in the Server field. Press Enter. You will be prompted to enter a name and password for the ftp server. If the server is configured for anonymous access, select Anonymous login. To store the login name and password for the server, click Remember these values.

Navigating the Remote File System

After you have established a connection to the remote FTP server, a list of files and directories will be displayed. These files and directories exist under the directory specified in the Look in: field. Double click a directory (indicated by a file folder icon) to navigate the directory structure. To move up one level in the directory structure, click the Up button located in the top right corner of the dialog.

To open a single file, double click the file name. To open multiple files, hold down the Ctrl key and click the files you want to open, then click Open.

The buttons in the top right corner of the dialog can be used to perform various file and directory manipulation functions. Hover your mouse pointer over the buttons for a description of their function. To delete or rename a file on the remote server, right-click the file name and, with the left mouse button, select the desired command from the context menu.

Top

Opening Multiple Files

To open more than one file at a time:

  1. Launch Komodo.
  2. Select the files you want to open. For example, highlight the desired files in Windows Explorer, or on your desktop.
  3. Drag these files and drop them onto the Komodo editor pane.
Top

Switching Between Files

To switch between files that are open in the editor, do one of the following:

  • Press Ctrl+Tab to display the file that was most recently viewed before the current file.
  • Press Ctrl+Shift+Tab to display the file that most recently viewed after the current file.
  • In the Editor pane, click the tab with the desired file name.
  • Click the right and left arrow buttons located in the top right corner of the Editor Pane to view the tabs of all open files.
  • In the Projects pane, double-click the file name.
  • From the Window menu, select Next File or Previous File, which will move from left to right (or right to left) across the file tabs.
  • From the Window menu, select the desired file from the list of files that are currently open in the editor.

Note that you can re-order the position of the file tabs by dragging and dropping the tabs into the desired position.

Top

Printing Files

Printing style is configured in the Komodo Preferences.

To print a file, do one of the following:

  • From the File menu, select Print...
    or
  • Click the Print button on the toolbar
    or
  • Select Print from the Editor pane's Context Menu.

To generate an HTML file from the file currently active the in editor pane, select Print to HTML File.

Top

Reverting Files

To abandon changes made to a file since it was last saved, but leave the file open in the editor:

  • From the File menu, select Revert
Top

Saving Files

To save a file with its current name, do one of the following:

  • From the File menu, select Save
    or
  • Press Ctrl+S
    or
  • Click the Save button on the toolbar
    or
  • Right click the file tab and select Save.

To save a file with a different name:

  1. From the File menu select Save As.
  2. Browse to the appropriate directory and name the file.
    Ensure you use a file extension that Komodo recognizes.
  3. Click Save.

Alternatively, right-click the file tab and select Save As.

To save all open files with their current names, do one of the following:

  • From the File menu, select Save All
    or
  • Press Ctrl+Shift+S
    or
  • Click the Save All button on the toolbar.
Top

Saving Files Remotely

To save files to a remote FTP server, select File|Save Remotely As... To quickly access FTP servers that you use frequently, create an entry in the Server Preferences (Edit|Preferences|Server).

For a description of the Remote File dialog, see Opening Remote Files.

Top

Closing Files

To close one or more files, do one of the following:

  • From the File menu, select Close
    or
  • Press Ctrl+F4
    or
  • Right-click the file tab and select Close
    or
  • Click the Close button on the Editor pane toolbar
    or
  • From the Window menu, select Close (to close the current file) or Close All (to close all files in the editor).

To close all open files in all projects:

  • From the File menu, select Close All.

You will be prompted to save any changed files.

Top