Working with FilesKomodo provides a variety of methods for accessing and editing files. While files can be opened and edited individually, they can also be stored in projects or the Toolbox as components. If Komodo is configured to integrate with a source code control system (SCC), status icons beside the filenames indicate the file's current SCC status, and SCC options are available from the File menu and the right-click context menus. This integration is described in detail in the Source Code Control section of the Komodo documentation. Files are manipulated in various ways: via the File menu, via context menus in the editor, via context menus on the file tab (above the editor), and as components within projects and the Toolbox. This document describes file functionality, such as opening, printing, and saving files. See the Editing page for information about editing files. Creating FilesTo create a new file, click the "New File" button on the standard toolbar. (To display the standard toolbar, click View|Toolbars|Standard.) A new file with the default file extension for the file type is created and opened in the Komodo editor. Use the New Files page in Komodo's Preferences to specify the default file extension for new files.
Creating Files from TemplatesNew files can be created based on pre-defined templates that contain default content for specific file types. See the Templates documentation for information about configuring custom templates. To create a new file from a template, select File|New|File. The New File dialog box contains numerous pre-defined templates organized into categories. Select the desired category, then select the desired template within that category. Click Open to create a file with the contents of the template file. The file is loaded in the editor. The File|New|File menu displays a list of the most recently accessed templates. To alter the number of template files displayed, refer to the New Files page in Komodo's Preferences. To add a template to the Toolbox for quick access, select the desired template and click Add to Toolbox.
Storing Files within a Project or the ToolboxFiles can be stored in a project, in the Toolbox, or within folders in a project or the Toolbox. Storing a file within a project or the Toolbox creates a reference to the actual file located on the disk; it does not affect the file itself. Therefore, the same file can be stored in multiple projects and folders, both in projects and within the Toolbox; changes to the original source file apply regardless of the source of the file reference; deleting a file from a project or the Toolbox does not delete the file from the filesystem. While most file options (such as source code control commands, viewing unsaved changes, and refreshing the file status) are accessible regardless or whether or not the file is contained in a project or the Toolbox, some commands are specific to the project/Toolbox environment. These commands are described below.
Creating an Open Shortcut to the Current File LocationOpen... shortcuts, stored within a project or the Toolbox, are references to filesystem directories. When an open shortcut is invoked, the standard Open File dialog box is displayed with the contents of the directory. Open shortcuts can be created using a specific file as the context. Right-click a file in a project or the Toolbox and select Make "Open..." Shortcut. This creates an open shortcut to the directory where the file is stored.
Exporting Files as ProjectsThe Export as Project File option is used to create a new project file containing the file from which the option was invoked. To access this option, the file must be stored in a project or the Toolbox. Right-click the desired file name and select Export as Project File. You are prompted to provide the name of the new project file and the directory where it will be stored. To open the new project file, select File|Open|Project.
Exporting Files to a PackageFiles can be archived and distributed among multiple Komodo users via "packages".
Packages are compressed archive files that contain the file from which the
Export Package option was invoked. Packages are stored in
files with a ".kpz" extension, and can be opened by any archiving utility
that supports Exported packages can only be imported into "container" objects in Komodo, such as projects, the Toolbox, and folders within projects and the Toolbox. See Toolbox - Exporting and Importing Toolbox Contents, Projects - Importing and Exporting Projects via Packages, or Folders - Import Contents from Package for more information.
Opening FilesThere are numerous methods for opening files in Komodo. These include:
Opening Files with the Open/Find ToolbarThe Open/Find Toolbar provides quick access for opening files and finding strings. The toolbar is displayed in Komodo by default. To hide or show the toolbar, select View|Toolbars|Open/Find. Use the Open field on the Open/Find Toolbar to open one or more files in the filesystem. The Open field generates a drop-down list of files and directories as you navigate the hierarchy. To open a file, enter the file path and name, and then press 'Enter'. For example, to open a file named "debug.txt" in the directory C:\temp\log on a machine running Windows, enter C:\tmp\log\debug.txt in the Open field and then press 'Enter'. As you enter each backslash, a drop-down list displays the files and directories beneath the current directory. Enter "./" or ".\" in the Open field to display a list of files and directories in the "current" directory. The current directory is determined as follows:
To narrow the results in the list box, enter one or more characters in the name of the file or directory you wish to open or view. (The search is case-sensitive.) Alternatively, use the arrow keys to navigate the drop-down list. The contents of the Open field are updated as you move up and down the list with the arrow keys. Note that you can use standard directory navigation syntax to change directories. For example, if the current directory is /home/fred/tmp/foo, change to the /home/fred/tmp/bar directory by entering ../bar. To open a file, press 'Enter' when the file name is displayed in the Open field. To continue navigating the directory structure, append a frontslash or backslash to the directory name displayed in the Open field; the drop-down list is updated with the list of files and directories that exist under the current location. To open multiple files, specify a wildcard ("*" for a file name segment, "?" for a specific character). For example, to open all the files with the extension ".tcl" in the directory /home/fred/tmp, enter /home/fred/tmp/*.tcl. At any time, press the 'Escape' key to return focus to the Komodo editor.
Opening Remote FilesKomodo can open files located on remote machines, providing that the remote machine is configured for FTP, SFTP, or SCP access. To quickly access frequently used servers, create an entry in the Server Preferences (Edit|Preferences|Servers). To open a file located on a remote server, select File|Open|Remote File.
Connecting to a remote Server
Navigating the Remote File SystemAfter establishing a connection to the remote server, a list of files and directories is 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. Use the navigation buttons in the top right corner of the dialog box to navigate the remote filesystem. To open a single file, double-click the filename. To open multiple files, hold down the 'Ctrl' key while clicking multiple files, then click Open. The buttons in the top right corner of the dialog box perform various file and directory manipulation functions. Hover your mouse pointer over the buttons for a description of their functions. To delete or rename a file on the remote server, right-click the filename and, with the left mouse button, select the desired command on the context menu.
Storing Remote Files in Projects or the ToolboxWhen remote files are added to a project or the Toolbox, or to container components within a project or the Toolbox, they are accessed and organized in the same manner as local files (double-clicking a file opens it in the editor; right-clicking a file accesses file option, etc). Remote files can only be added to projects or the Toolbox by connecting to the remote server. Login authentication is processed when the remote file is opened, or when it is added to the Toolbox or a project. For the duration of the Komodo session, the user name and password are remembered; closing and opening the file uses the same authentication information as the first time the file was opened. If authentication fails, you are prompted to enter a user name and password. After closing and re-opening Komodo, the authentication information stored in the Servers preference is checked again. Thus, changes to the user name or password stored in the server configuration do not take effect until Komodo is closed and re-opened. If no authentication information is stored in the server configuration, you are prompted to supply it when you open the file. See Adding Components to Projects or Adding Components to the Toolbox for instructions on adding remote files to the Toolbox or to projects. To open a remote file, double-click the file name, use the assigned key binding, or right-click the file and select Open File.
Opening Mapped URIsMapped URIs can be opened by dragging a mapped link from a browser into Komodo. For example, if you mapped the URL http://www.example.org/ to the local directory /var/www/, you could drag a link like http://www.example.org/projects/test.html from a browser into Komodo, which would open the local file /var/www/projects/test.html This feature also works with URIs mapped to remote filesystems (via FTP, SFTP or SCP), which in turn can be configured for automatic authentication under Edit|Preferences|Servers.
Switching Between FilesTo switch between open files in the editor:
If more files are opened than can be displayed by file tabs, click the right and left arrow buttons located in the top right corner of the editor to view the tabs of all open files. To re-order the position of the file tabs, drag and drop the tabs into the desired positions. For more information about working with the editor tabs, see Editor Tab Display in the editor documentation.
Comparing FilesKomodo includes a "diff" mechanism used to compare files. To compare two files using Komodo's "diff" window:
If the file is stored in a project or the Toolbox, this function can also be invoked by right-clicking the file and selecting Compare File With. The unique characteristics of each file are displayed in different colors (red and blue by default); common characteristics are displayed in a third color (black by default). To configure custom colors for the "diff" window, alter the Language-Specific Coloring setting for the Other|Diff language in the Fonts and Colors preference. The following key bindings are available in the "diff" window:
Refreshing File StatusThe Refresh Status option checks the read/write disk status for the component. If the file is of a language for which "code intelligence" is supported and enabled (as configured in the Code Intelligence Preferences), Refresh Status also updates the code intelligence database with the contents of the file. If the component is stored in a source code control system, Refresh Status also checks the repository status of the file. Komodo determines whether a file is contained in an SCC repository by the following methods:
To refresh the file status of the current file, right-click the file tab or right-click within the editor and select Refresh Status. The same option is available on the right-click context menu of files in projects or within the Toolbox.
Source Code ControlKomodo provides source code control support for files stored in CVS or Perforce repositories. Source code control support (including SCC configuration, status icons and specific commands) is described in detail in the Source Code Control section of the documentation. To access source code control commands:
File Properties and SettingsIn addition to the Komodo's global Preferences, some preferences can also be configured on a per-file basis. These settings override the global and project level preferences. To access the Properties and Settings dialog box for a file:
File PropertiesThe Properties category in the Properties and Settings dialog box displays general information about the file, such as the directory where it is stored, the size and creation and modification dates. The following file characteristics can be modified on this tab:
File Source Control SettingsIf Komodo is configured to work in conjunction with a Source Code Control system, the Source Code Control category displays the current SCC status and settings.
File Editor SettingsThe options on this tab are a subset of the General Editor and Smart Editing preferences. Refer to those sections of the Preferences documentation for information about individual options.
Indentation TabThe options on this tab are a subset of the Indentation Preferences. Refer to that section of the Preferences documentation for information about individual options.
Browser PreviewThis option configures the behavior of the Preview in Browser function. When the Preview in Browser function is invoked, you are prompted to specify the file or URL used to preview the current file. (For example, when previewing a CSS file, specify an HTML file to use for the preview.) The Preview in Browser dialog box has an option for remembering the specification. If that option is enabled, the file or URL specified is displayed in the Preview field. Click Change to alter the preview file.
Printing FilesTo print the file that is currently displayed in the editor, use one of the following methods. These methods invoke the standard system dialog box for printer selection and configuration. Advanced print functions are described below.
Printing style is configured on the Printing page in Komodo's Preferences. Alternatively, select File|Print|Print Settings to display the Printing preferences page. To display a preview of the printed output, select File|Print|Print Preview. Select File|Print|Print Preview contains features for setting the scale and orientation of a print job. Use the arrow buttons to move forward or backward in a multi-page print job, or enter a specific page number in the field provided. Click the Page Setup button to access the complete set of print features in the Page Setup dialog box. To print a selection of text rather than the entire file, select the desired text in the editor, then select File|Print|Print Selected Text.
Page SetupManage the format of print jobs using the options available in the Page Setup dialog box. Select File|Page Setup to access these options. Format and Options
Margins and Header/Footer
Print to HTML FileTo generate an HTML file from the file currently active in the editor:
To print a selection of text to an HTML file (rather than the entire file), select the desired text in the editor, then select File|Print|Print to HTML File.
Saving FilesKomodo is "intelligent" about saving files. For example, Komodo prompts to save unsaved files on close. Attempting to save changes to a file that is set to read-only displays a dialog box where you are given the option to change the status or to "force" the save (which makes the file writable, saves the changes, then sets the file back to read-only). In addition, Komodo can be configured to automatically save a backup copy of files open in the editor. To configure Komodo's save functionality, use the Save Options preference page. To save a file with its current name, do one of the following:
Saving Files RemotelyTo save a copy of the current file to a remote server, select File|Save Remotely As. The Remote File dialog box is displayed. When editing files located on a remote server (including remote files stored in a project or the Toolbox), saving the file automatically saves it to the remote location.
Show Unsaved ChangesBefore saving a file, view the changes in the file since it was last saved by using the Show Unsaved Changes option. To invoke this option, right-click within the editor (or on the file tab above the editor) and select Show Unsaved Changes. An external window displays the differences between the current version of the file and the disk version (e.g., the version that was last saved). The unique characteristics of each file are displayed in different colors (red and blue by default); common characteristics are displayed in a third color (black by default). To configure custom colors for the "diff" window, alter the Language-Specific Coloring setting for the Other|Diff language in the Fonts and Colors preference.
Reverting FilesTo abandon changes made to a file since it was last saved, but leave the file open in the editor, select File|Revert.
Closing FilesTo close one or more files, use one of the following methods:
|