Lugaru's Epsilon
Programmer's
Editor

Context:
Epsilon User's Manual and Reference
   Commands by Topic
      . . .
      The Screen
         Display Commands
         Horizontal Scrolling
         Windows
         . . .
         The Bell
      Buffers and Files
         . . .
         Printing
         Extended file patterns
         Directory Editing
         Buffer List Editing
      Starting and Stopping Epsilon
         Session Files
         File Associations and DDE
         Sending Files to a Prior Session
         MS-Windows Integration Features
      . . .

Previous   Up    Next
Extended file patterns  Commands by Topic   Buffer List Editing


Epsilon User's Manual and Reference > Commands by Topic > Buffers and Files >

Directory Editing

Epsilon has a special mode used for examining and changing the contents of a directory conveniently. The dired command, bound to Ctrl-X D, asks for the name of a directory and puts a listing of the directory, similar to what the DOS or OS/2 "dir" command produces (or, for Unix, "ls -lF"), in a special dired buffer. By default, dired uses the current directory. You can supply a file pattern, such as "*.c", and only matching files will appear. The dired command puts the information in a buffer whose name matches the directory and file pattern, then displays the buffer in the current window. You can have multiple dired buffers, each displaying the result of a different file pattern.

You can also invoke dired from the find-file command. If you press <Enter> without typing any file name when find-file asks for a file, it does a dired on the current directory. If you give find-file a file name with wild card characters, it runs the dired command giving it that pattern. If you give find-file a directory name, it does a dired of that directory. (When using ftp:// URL's that refer to a directory, end them with /. See URL Syntax for details.)

You can use extended file patterns to list files from multiple directories. (See Extended file patterns.) If you use a file pattern that matches files in more than one directory, Epsilon will divide the resulting dired buffer into sections. Each section will list the files from a single directory. Epsilon sorts each section separately.

While in a dired buffer, alphabetic keys run special dired commands. All other keys still invoke the usual Epsilon commands.

You run most dired commands by pressing plain letters. The N and P commands go to the next and previous files, respectively.

The E, <Space>, and <Enter> keys let you examine the contents of a file. They invoke the find-file command on the file, making the current window display this file instead of the dired buffer. To conveniently return to the dired buffer, use the select-buffer command (Ctrl-X B). Press <Enter> when prompted for the buffer name and the previous buffer shown in the current window (in this case, the dired buffer) will reappear.

When applied to a subdirectory, the E key invokes another dired on that directory, using the name of the directory for that dired buffer. If you have marked files for deletion, and you run a dired on the same directory, the markings go away.

The "." or "^" keys invoke a dired on the parent directory of the directory associated with the current dired buffer.

To set Epsilon's current directory to the directory being displayed, press G (for Go). If the current line names a directory, Epsilon will make that be the current directory. If the current line names a file, Epsilon will set the current directory to the one containing that file.

Press D to flag a file that you wish to delete. Epsilon will mark the file for deletion by placing a "D" before its name. (You may delete empty directories in the same way.) Press C or M to select files for copying or moving (renaming), respectively. Epsilon will mark the files by placing C or M before their names. The U command unmarks the file on the current line, removing any marks before its name.

The X command actually deletes, copies, or moves the marked files. Epsilon will list all the files marked for deletion and ask you to confirm that you want them deleted. If any files are marked for copying or moving, Epsilon will ask for the destination directory into which the files are to be copied or moved. If there is only one file to copy or move, you can also specify a file name destination, so you can use the command for renaming files. Epsilon prompts for a single destination for all files to be copied, and another for all files to be moved.

There are a few specialized commands for renaming files. Press Shift-L to mark a file for lowercasing its name, or Shift-U for uppercasing. When you execute with X, each marked file will be renamed by changing each uppercase character in its name to lowercase (or vice versa). (Note that Epsilon for Windows displays all-uppercase file names in lowercase by default, so Shift-U's effect may not be visible within Epsilon. See preserve-filename-case.)

Shift-R marks a file for a regular-expression replacement on its name. When you press X to execute operations on marked files, Epsilon will ask for a pattern and replacement text. Then, for each file marked with Shift-R, Epsilon will take the file name and perform the indicated regular expression replacement on it, generating a new name. Then Epsilon will rename the file to the new name. For instance, to rename a group of files like dir\file1.cxx, dir\file2.cxx, etc. to dir2\file1.cpp, dir2\file2.cpp, use Shift-R and specify dir\(.*).cxx as the search text and dir2\#1.cpp as the replacement text. To rename some .htm files to .html, specify .* as the search text and #0l as the replacement text.

The ! dired subcommand prompts for a command line, then runs the specified program, adding the name of the current line's file after it.

The + command creates a new subdirectory. It asks for the name of the subdirectory to create.

The R command refreshes the current listing. Epsilon will use the original file pattern to rebuild the file listing. If you've marked files for copying, moving, or deleting, the markings will be discarded if you refresh, so Epsilon will prompt first to confirm that you want to do this.

The S key controls sorting. It prompts you to enter another letter to change the sorting method. Press N, E, S, or D to select sorting by file name, file extension, size, or time and date of modification, respectively. Press U to turn off sorting the next time Epsilon makes a dired listing, and display the file names in the same order they come from the operating system. (You can have Epsilon rebuild the current listing using the R subcommand.)

Press + or - at the sorting prompt to sort in ascending or descending order, respectively, or R to reverse the current sorting order.

Press G at the sorting prompt to toggle directory grouping. With directory grouping, Epsilon puts all subdirectories first in the list, then all files, and sorts each part individually. Without directory grouping, it mixes the two together (although it still puts . and .. first).

Press Shift-P to print the current file. In Epsilon for Windows, press V to run the "viewer" for that file; the program assigned to it according to Windows file association. For executable files, this will run the program. For document files, it typically runs the Windows program assigned to that file extension. See File Associations and DDE for information on associating Epsilon with particular file extensions. Press T to display the properties of a file or directory. (This is a convenient way to see the total size of all files in a directory.)

Several keys provide shortcuts for common operations. The 1 key examines the selected file in a window that occupies the whole screen (like typing Ctrl-X 1 E). The 2 key splits the current window horizontally and examines the selected file in the second window, leaving the dired buffer in the first (like typing Ctrl-X 2 E). The 5 key functions like the 2 key, but splits the window vertically (like typing Ctrl-X 5 E). The O key examines the selected file in the next window on the screen, without splitting windows any further. The Z key zooms the window to full-screen, then examines the selected file (like typing Ctrl-X Z E).

Press lowercase L to create a live link. First Epsilon creates a second window, if there's only one window to start with. (Provide a numeric argument to get vertical, not horizontal, window splitting.) Then Epsilon displays the file named on the current dired line in that window, in a special live link buffer. As you move around in the dired buffer, the live link buffer will automatically update to display the current file. Files over dired-live-link-limit bytes in size won't be shown, to avoid delays. Delete the live link buffer or window, or show a different buffer there, to stop the live linking.

Finally, typing H or ? while in dired invokes help on the dired command.

The quick-dired-command command on Alt-o is like running a dired on the current file, then executing a single dired command and discarding the dired buffer. It provides a convenient way of performing various simple file operations without running dired. It prompts for another key, one of C, D, M, G, !, T, or V. Then it (respectively) copies, deletes, or renames the current file, changes Epsilon's current directory to the one containing that file, runs a command on the file, shows the file's properties, or views it using associations. Alt-o . displays a dired of the current file. Alt-o F views its folder in MS-Windows Explorer. (The T, V and F options are only available in Epsilon for Windows.)

The locate-file command prompts for a file name and then searches for that file, using dired to display the matches. In Windows, DOS, and OS/2, it searches for the file on all local hard drives, skipping over removable drives, CD-ROM drives, and network drives. On Unix, it searches through particular parts of the directory hierarchy specified by the locate-path-unix variable.

The list-files command also takes a file pattern and displays a list of files. Unlike dired, its file list uses absolute pathnames, and it omits the file's size, date, and other information. It provides just the file names, one to a line. The command also doesn't list directory names, as dired does. The command is often useful when preparing response files for other programs.

Standard bindings:

  Ctrl-X D  dired
 Alt-o  quick-dired-command
   list-files
 



Previous   Up    Next
Extended file patterns  Commands by Topic   Buffer List Editing


Lugaru Copyright (C) 1984, 2020 by Lugaru Software Ltd. All rights reserved.