Chamo
What is Chamo ?

Chamo is a source code editor, even if it can be used to edit any text file. A system of "views" allows to edit some kinds of files in specific views.

Chamo has a section in the FAQ and a tips and tricks page.

Each window can be splitted vertically or horizontally ( la emacs) or using tabs ( la gedit) in different views. Navigating from one view to another is easy with commands boundable to combinations of keys. One can also store the position and layout of the windows and the list of open files, so that, the next time Chamo is launched, everything is restored at the same position.

A "minibuffer" la emacs with automatic completion is used to launch commands and indicate arguments for commands (when opening a file, doing some query/replace in a buffer, ...).

The text editing view uses GtkSourceView 2.X and so provides the following functionalities: support of internationalisation (UTF-8), syntax highlighting (with colors, fonts, ...) depending on the language (OCaml, C, C++, Makefile, ... or your own language description), undo/redo management, clipboard management, incremental forward/backward search, query/replace, history of pastable text ("kill-ring"), ...

A system of association of code to commands and of evaluation of commands (in a form similar to shell commands command arg1 arg2 ...) allows to add one's own functionalities. It is also possible to add and modify all key bindings, even specifically for each kind of view.

In the bytecode version of Chamo, the command "eval" takes in argument some OCaml code which is interpreted and allows to modify everything in the editor: adding modes, redefining commands, ..., the same way as with Lisp in Emacs. The command "eval_file" interprets all the OCaml code present in a file given in argument.

A quick reference of default key bindings is available here.

to be completed...

Screenshots and tour
Chamo, an emacs-like file editor based on Gtk2The windows can be splitted to display various views, la emacs. Some commands allows to handle the splitting and, like any command, can be bound to combinations of keys: "split_horizontally" ("C-h" or "C-x 2" by default), "split_vertically" ("C-v" or "C-x 3" by default), "destroy_active_view" ("C-x 0" by default).
Using tabsAnother way to have various views in a window is the use of tabs, as in GEdit. The commands "cycle_tab" ("C-Tab" by default) and "new_tab" ("C-x C-t" by default) allow respectively to move from one tab to another and create a new tab.
Using tabs and splitsOf course, one can mix the two ways to arrange views to fit one's needs. The position and layout of windows and views can be stored on demand using the command "store_layout". When the editor is launched in the same directory, position and layout of windows and views are restored.
The odoc viewTo each type of file (by now a regular expression matching the file name) one can associate a view to edit it. Various views are available. The view "odoc" allows to browse an OCamldoc dump file. A double-click on an element opens the corresponding file at the position where the element is defined. A right-button click provides a choice between opening the interface file (".mli") and the implementation file (".ml") used to produce the dump. This is an easy way to browse the code of a project.
The todo list viewThe view "tdl" can be used to edit "todo list" files, in the format used by the Tdl library included in Cameleon.
Sourceviews in actionThe view "sourceview" is based on GtkSourceView. It provides the syntax highlighting associated to each type of file (by now a regular expression matching the file name). Modes (like in emacs) can be defined to provides commands, key bindings, menus and indentations adapted to each type of file. A file can be open by various "sourceviews" at the same time. Basic commands are available in this view: incremental forward/backward search, query/replace, transposing lines or characters, copy/paste, "kill-ring" la emacs, ...
Minibuffers with completionA minibuffer like the one in emacs is used for commands arguments (opening files, changing buffer, search, ...) and provides automatic completion.
Various files are used to configure key bindings. Here is the configuration file for all windows of Chamo. The key bindings of the active view are also configurable and are added to the common key bindings of windows. File ~/.cameleon2/chamo.gui:
(* The size of histories in minibuffer *)
minibuffer_history_size = 50
(* The key combination to use to reset the key stroke state *)
abort_binding = "C-g"
(* Common key bindings for windows *)
window_key_bindings =
  [(["C-x"; "C-c"], close_active_window); (["C-n"], new_window);
   (["C-x"; "C-s"], save_active_view); (["C-x"; "C-w"], save_active_view_as);
   (["C-x"; "C-f"], open_file); (["C-b"], cycle_view);
   (["C-Tab"], cycle_tab); (["SC-Tab"], rev_cycle_tab);
   (["C-x"; "C-t"], new_tab); (["C-v"], split_vertically);
   (["C-x"; "S-3"], split_vertically); (["C-h"], split_horizontally);
   (["C-x"; "S-2"], split_horizontally);
   (["C-x"; "S-0"], destroy_active_view);
   (["C-x"; "C-x"; l], print_key_bindings); (["C-y"], paste);
   (["C-c"], copy); (["C-w"], cut); (["A-x"], prompt_command)]
Creating your own native code Chamo

The native version of Chamo can not interpret OCaml code to modify its behaviour. However, it is possible to create your own native version of Chamo including personal modifications. This is the purpose of the tool make_my_chamo. This script allows to compile a Chamo including additional modules to extend and customize Chamo's behaviour while keeping the advantages of the native code.

Here is the synopsis of this script:

make_my_chamo -o outfile [options] module1 [module2[module3 ...]]

For example, the following command creates a native code executable ~/bin/mychamo.x which includes the default configuration module ~/.cameleon2/chamo_init.ml:

make_my_chamo -o ~/bin/mychamo.x ~/.cameleon2/chamo_init.ml

The script launches a compilation command using the OCaml compiler generating native code (ocamlopt). All options of this compiler can be used in the parameters of make_my_chamo.