| Did you know ... | Search Documentation: |
| Site and personal initialisation files |
On startup, SWI-Prolog reads both site initialisation and personal initialisation files. Both can be controlled explicitly using commandline options (-F base for site, and -f base for personal initialisation).
The site-initialisation file is located in the SWI-Prolog home
directory. Its name is deduced from the commandname by taking the
leading alphanumerical characters, followed by the extension .rc.
Using default installation this implies swipl.rc for the Unix version
and swipl-win.rc for the Windows GUI version.
The personal initialisation file depends on version and OS:
init.pl and resides in a directory
swi-prolog below the the XDG
config home. On Unix the default XDG config home is ~/.config. On Windows it
is the directory provided by win_folder/2 on appdata.
These files are available using the file_search_path/2 alias
user_app_config as well as the deprecated aliases
user_profile and app_preferences
.swiplrc on Unix (.plrc for really old
versions) and swipl.ini on Windows (pl.ini for really old
versions). The file resides in the user's home (Unix) or in the
appdata directory (Windows).
These files are available using the file_search_path/2 alias
user_profile.
In plwin.exe, the personal initialisation file is accessible through the Settings menu. On first use, it copies a default file with some commented commonly used customization options. The same behaviour is also available from the PceEmacs menu Edit/Prolog preferences.