<type>documentation</type>
<domain>proj</domain>
<id>navigating-to-source</id>
<title>Opening Files</title>
<date>$Date$</date>
<version>$Revision$</version>
<product>per+</product>

Files can be opened from the ``Project`` tool by double clicking
or middle clicking on the file name, or by right-clicking and using the
``Open in Wing`` menu item.

Files can be shown within their directory in the native file explorer 
for the OS by right-clicking on the item in the ``Project`` tool and 
selecting ``Show in Explorer`` (on Windows), ``Show in Finder`` (on 
OS X), or ``Show Directory`` (on Linux).

Files may also be opened using an external viewer or editor by
right-clicking on the file and using the ``Open in External Viewer`` item.
On Windows and OS X, this opens the file as if double clicked in
the OS file browser. On Linux, the preferences `Files > External Display > File 
Display Commands`__ and `Files > File Types > Extra File Types`__ are used 
to configure how files are opened.

__ script:show_preferences_gui#prefname="gui.file-display-cmds"
__ script:show_preferences_gui#prefname="main.extra-mime-types"

**Navigation Options**

The ``Options`` menu in the ``Project`` tool provide options that
control how navigation of the directory tree works:

**Follow Selection** can be checked to cause Wing to open any file selected
in the ``Project`` tool, regardless of how the selectioni is mode.  To avoid 
clutter, files are visited in `transient mode <ref:edit/transient>`__, 
except if double clicked.

**Follow Current Editor** causes the current selection on the ``Project``
tree to track the current editor file.

Once it has the focus, the ``Project`` tool's tree is navigable with the
keyboard, using the up/down arrow keys, page up and page down, and home/end.
Use the right arrow key on a parent to display its children, or the
left arrow key to hide them.  Whenever a file is selected, pressing enter 
will open that item into an editor in Wing.
