Skip to content

Latest commit

 

History

History
126 lines (97 loc) · 4.32 KB

code-organization.md

File metadata and controls

126 lines (97 loc) · 4.32 KB

Code Organization

Directories

The source code is in these directories:

  • Main directory: init.el.
  • modules: the configuration's modules, which all start with "init-".
  • themes: the configuration's visual themes.
  • elpa: packages loaded from melpa.
  • extensions: third party packages not present in melpa, included in source code.
  • snippets: snippet files for YASnippets.

Note: vendor should be removed (code should move to extensions).

init.el

init.el is the entry point. It includes all other files using the require feature. Any "required" module file must end with a provide statement. The name of the file and the symbol in provide and require must all be identical, otherwise Emacs can't find it.

If a file before-init.el is present, it is loaded at the very beginning. If a file after-init.el is present, it is loaded at the very end.

If a file prefs.el is present, it is used to override the default configuration preferences defined in modules/init-prefs.el. This allows for tweaking a few things in the configuration without risk of conflicts during git pull. For example you can put something like this in your prefs.el:

;;; List of font names and sizes, in order of preference. Emacs will pick
;;; the first one that exists.
(setq exordium-preferred-fonts '(("Monospace" . 120)
                                 ("Mono" . 120)))

;;; If you don't want to current line to be highlighted:
(setq exordium-line-mode nil)

;;; Choose another theme:
(setq exordium-theme 'zenburn)

Modules

Lib, environment and preferences

  • init-lib.el defines utility functions used by other modules: things like file loading, string manipulation etc.
  • init-environment.el defines environment global variables, such as "are we on OSX".
  • init-prefs.el defines preferences variables for all modules. It can be edited to change a preference, or alternatively you can create a file prefs.el (in the main directory) to override the variables in init-prefs.el.

Look and feel

  • init-look-and-feel.el:
    • Basic UI of Emacs. Fonts, frame size, tool bar, menu bar, scroll bar, cursor, font lock, electric stuff etc.
    • Keybindings: zoom, navigate between buffers etc.
    • Basic behavior: delete trailing spaces upon save, no backup files, prefer spaces over tabs.
  • init-util.el: utility functions and keys like goto matching parenthese, duplicate a line, delete words, display an 80 column ruler (FCI), expand the region.
  • init-highlight.el: Highlight the current line and the symbol under the cursor. The latter can be done automatically after a small delay (turned off by default), or on demand using a key (C-c C-space by default).

Usability

Modes

OS X

C++

Other languages

Themes

Work in progress. There are 3 themes:

  • Tomorrow, wich comes with several variations (default theme is Tomorrow Night)
  • Monokai
  • Solarized dark and light.