Useful tips

Commandline reference

A part of the documentation, the automatically generated reference, is accessible from the commandline by calling the cuby4 script with arguments described here.

Keep and reuse the original outputs

When cuby calls an external program to do a calculation, it creates a directory for it, builds the input, runs the program, reads the output and then deletes the calculation directory. If you want to check the output of that program or read some additional information from it, you can modify this behavior by keywords job_cleanup and delete_large_files.

These outputs can be reused when cuby is run again. How it handles existing calculation directory is controlled by keyword existing_calc_dir.

Comfortable editing of input files in vim

Editing the YAML input files in the vim editor can be made more comfortable using the following script that fixes automatic indentation. Save the following to ~/.vim/indent/yaml.vim (the script comes from, all credits to its original author):

" Vim indent file
" Language: Yaml
" Author: Ian Young
" Get it bundled for pathogen:

if exists("b:did_indent")
"runtime! indent/ruby.vim
"unlet! b:did_indent
let b:did_indent = 1

setlocal autoindent sw=2 et
setlocal indentexpr=GetYamlIndent()
setlocal indentkeys=o,O,*,!^F

function! GetYamlIndent()
  let lnum = v:lnum - 1
  if lnum == 0
    return 0
  let line = substitute(getline(lnum),'\s\+$','','')
  let indent = indent(lnum)
  let increase = indent + &sw
  if line =~ ':$'
    return increase
    return indent