This page discusses opening and editing non-Leo files, and settings.

Opening non-Leo files

To open and edit a non-Leo (non-.leo) file, select the file with the File:Open command as with any other editor. When you do this, Leo will create an @edit node whose body text is the entire text of the file. These @edit nodes are much like Emacs or vim buffers, but Leo will automatically load the buffers whenever it loads the .leo file containing these nodes.

Rather than using the File:Open menu, you can create an @edit node yourself. The headline is @edit <filename> where <filename> can be either an relative or absolute path to the file in question. See the documentation for @path for how relative paths are resolved.

Important: Leo contains a safeguard against inadvertently overriding files when using @edit nodes. Leo will not write an @edit node if it contains an insignificant amount of information: that is, if the @edit node contains less than 10 lines of text and has no children. Thus, you can create an empty @edit node affecting the corresponding file. The next time you open the .leo file containing the @edit node, Leo will read the file into the node.

An introduction to Leo settings

Leo stores options in @settings trees, outlines whose headline is @settings. When opening a .leo file, Leo looks for @settings trees not only in the outline being opened but also in various leoSettings.leo files. This scheme allows for great flexibility. The following is a simplified introduction. For more information about settings, see: Chapter 8: Configuring Leo or Leo's main configuration file, leo/config/leoSettings.leo.

Leo looks for @settings trees in the following places (among others):

  1. The file leo/config/leoSettings.leo
  2. The file ~/.leo/myLeoSettings.leo
  3. The .leo file being loaded

Settings appearing later in the list override setting appearing earlier in the list. Thus, leoSettings.leo contains defaults, myLeoSettings.leo contains personal overrides, and settings in the.leo files being loaded override all other settings.

Overriding of settings happens happens on a setting-by-setting basis, not on a file-by-file basis. In other words, each individual setting overrides only the corresponding setting in previously-read files. Reading a setting file does not reset all previous settings.

Within an @settings tree, settings nodes such @bool, @int and @string nodes specify various kinds of settings. For most settings nodes, the headline specifies the setting, the body text contains explanatory comments. For other settings nodes, the body text of the settings nodes specifies the setting.

With this brief introduction, you should be able to understand the contents of leo/config/leoSettings.leo. This file contains extensive notes throughout. If you want to change the defaults in leoSettings.leo, it is best to put your changes in your myLeoSettings.leo file. That way your changes won't change when you install a later version of Leo.