Vixn uses the XDG base directory specification for storing its config files. This means that its config file directories can be found at these locations:
The files described on the rest of this page all belong in one of the above directories, usually the first.
Vixn's main config file is called rc after the UNIX tradition, standing for "run commands". Instead of consisting of ex commands as in other versions of vi, the format of this file is a python script. Here is a full list of functions that vixn makes available to the script. In practice you are unlikely to do more than use set to set settings, bind to customise key strokes (see below) and the hook creation functions. Here is an example.
Menu definition files are run under similar conditions to rc files but are intended to be especially for menus, using the functions def_menu, def_menu_item and attach_submenu. The default menus file is a good example, although at this stage of development it's more of a proof of concept than a practical menu tree giving access to a wide range of functionality.
The rules for choosing which menus file or files to load are slightly different from rc files. The filename is usually menus, but may have a language suffix. The copy in vixn's special config directory is always loaded first, followed by the first menus file, if any, in the XDG config directories. This makes it easier if you just want to add to the existing menus instead of replacing them (which you can do by reusing the existing names).
A number of events in vixn have "hooks" so you can arrange to execute commands or run functions by using the hook creation functions - filename_hook, filetype_hook and scheme_hook - rc file.
The first argument in each of the hook creation functions is the filename, filetype or scheme name to match with. The match may contain "glob" (python fnmatch) wildcards or be an exact match. When vixn looks for hooks matching an event it runs them in the following order of priority:
When vixn loads a file it runs any filename hooks matching the file's name, then it tries to determine its filetype, first from the filename, then from the file contents. It then applies the filetype setting to the buffer (but only if it hasn't already been set in a filename hook, which takes higher priority), causing filetype hooks to be run. Scheme hooks are run when a scheme setting is applied.
The hook creation functions (*_hook but not clear_*_hook) can also be used in the form of python decorators ie instead of providing an action as the second argument, prefix the hook command with @ and define a python function on the following line. There is an example of this in the sample rc file. Hook action functions do not have arguments.
To remove a hook use the appropriate hook clear function:- clear_filename_hook, clear_filetype_hook or clear_scheme_hook.
The list of supported filetypes can be found at any time by running the list_filetypes python script. Currently they are: gettext-translation gtk-doc diff makefile scheme yacc def rpmspec ada desktop haddock sh ini vhdl python xml cpp msil pkgconfig m4 erlang dtd java perl d boo html lua vala tcl dpatch pascal libtool changelog c-sharp haskell vbnet ruby texinfo objc php ocl nemerle forth idl gtkrc r css c chdr fortran gap latex verilog eiffel haskell-literate awk sql js octave objective-caml docbook.
Vixn is still rather limited in its ability to let you bind vi commands to keys, but this may be improved in future. Binding is done by using the function bind(ks, command) where ks is a string containing a key or sequence of keys and command is the name of a vi command, or an ex command if it begins with a colon.
Some keys do not correspond to a single printable character and vixen has a special notation for these, based on vim's. Special keys are represented by strings in angle brackets <>. Inside the brackets the Control/Ctrl modifier is represented by a leading C- and Alt by A-. Named keys have specific names in vixn, listed here. Names beginning with k refer to keys on the numeric keypad. For example, Alt-Ctrl-Delete, using the numeric pad rather than the normal Delete key, would be represented in vixn by <A-C-kDel>.
If GTK+ editable keyboard menu shortcuts are enabled in the session (in the Interface section of GNOME's Appearance capplet for instance) you can edit the shortuct keys associated with menu items by pressing the desired key(s) when the appropriate menu item is highlighted. Vixn saves these shortcuts in a file called shortcuts.
Being based on gtksourceview2, vixn uses its language and style/colour scheme definition files. As well as the usual locations for these files vixn is also able to make use of .lang files and style definition files (which have a .xml suffix) in any subdirectories of its config directories named languages or schemes respectively. (Technically it would be more consistent to use XDG data directories instead of config directories, but these can be thought of as config files and it keeps things simpler.) These take priority over definitions of the same name provided by the system or gtksourceview2.
Documentation for the language specification file format is available on the gtksourceview website, and gtksourceview2 is supplied with many files that may be used as examples, usually in /usr/share/gtksourceview-2.0/language-specs/. The style file format does not seem to be officially documented, but there are examples in /usr/share/gtksourceview-2.0/styles/ and the documentation for language specs may help clarify the meaning of keywords.
Vixn creates a file called state.xml in its home XDG config directory. This is used to preserve information about marks and the last cursor position in recently opened files and command and search histories.