Lugaru's Epsilon
Editor 14.04

Epsilon User's Manual and Reference
   Commands by Topic
      Buffers and Files
         . . .
            Reading Files
            Read-Only Files
            Saving Files
            . . .
            File Name Case
         File Variables
            Directory-wide File Variables
            Vi/Vim File Variables
         Internet Support
            Secure Shell and SCP Support
            URL Syntax
         . . .

Previous   Up    Next
File Variables  Commands by Topic   Vi/Vim File Variables

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

Directory-wide File Variables

You can put file variables in a special file named .epsilon_vars. Such settings apply to all files in its directory. Or you can create a file named .epsilon_vars in your Epsilon customization directory, and its settings will be applied first, before any directory-specific file.

If there's no .epsilon_vars file in a directory, you can tell Epsilon to search up the directory tree until it finds one in a parent directory. A bit in the use-file-variables variable enables this.

In an .epsilon_vars file, lines starting with # are comments. It contains one or more sections. Within each section, settings in it appear one per line, with a setting name, a colon, and a value. Each section begins with a line that says which files or modes it affects:

# Special settings for this directory.
Extensions: .r*
mode: Perl

Modes: Perl|Python
tab-size: 3

Modes: C
tab-size: 5
indent-tabs-mode: nil

The Modes, Extensions, Filenames, and Basenames lines use a file wildcard pattern. It can use | for alternation, ? to match a single character or * to match any number, or character ranges like [a-z]. Epsilon will apply the settings in the section that follows only if the original file's extension, mode, full pathname, or basename matches the pattern. This example says that all files with an extension like .r or .rxx or .ram in that directory should use Perl mode, and sets the tab size to 3 for Perl or Python files, and 5 for C files, also turning off using Tab characters to indent.

Here's another example you might find in a system-wide .epsilon_vars file.

# Make every .inc file in the hierarchy below be in PHP mode, instead
# of auto-detecting.
Filenames: /home/bob/hats/*.inc
mode: PHP

# Any file matching one of these names, in any directory, is really
# a makefile.
Basenames: buildfile*|build[1-2]*|*build.dat
mode: makefile

Epsilon decides which sections to use before applying the settings, so an .rxx file forced to Perl mode by the above example file won't get a tab size of 3 unless you add a tab-size: 3 line to its Extensions section. Also note that "mode:" sets a file's mode; "Modes:" begins a section for a specific mode. File variables in an individual file take precedence over those in an .epsilon_vars file, and those in a directory-specific .epsilon_vars file take precedence over those in a system-wide file.

Previous   Up    Next
File Variables  Commands by Topic   Vi/Vim File Variables

Lugaru Epsilon Programmer's Editor 14.04 manual. Copyright (C) 1984, 2021 by Lugaru Software Ltd. All rights reserved.