Add "|" to the list of other characters
Cleanup (functionality untouched)

- Add and clean up comments
- Rename some functions
- Change shiftwidth to 2 (which is more usual for Vim scripts)
- Indentation script: break lines longer than 80 chars
Add "when" to indentkeys
Replace L2s() with string()

It turns out that string() does just what I want...
Change cache to use changedtick()
Tricky tests for parens added
Use searchpair for 'end', ')', ']' and '}'

The indentation will remain the same but it will be quicker.

Performance measurements:

    old indentation time (seconds) -> new indentation time (second)

------------------------------------------------------------

Test file: test_indent.erl.

Indenting whole file: 15.6 -> 12.7 (no cache), 12.7 -> 10.0 (cached)

------------------------------------------------------------

Test file: /usr/lib/erlang/lib/tools-2.6.6.5/emacs/test.erl.indented

Indenting whole file: 9.65 -> 6.57 (no cache)

------------------------------------------------------------

Test code:

    f() ->
        my_function
        <1000 x "(">
        <1000 x ")">,
        LTI.

Indenting LTI: 6.64 -> 1.47 (no cache), 2.53 -> 1.46 (cached)

The 6.64 -> 1.47 difference is mostly due to the fact the since Vim will jump
through the 2000 lines, we don't parse them.

The 2.53 -> 1.46 difference is due to the fact that Vim finds the matching
paren faster than ErlangCalcIndent.

------------------------------------------------------------

Test code:

    f() ->
        my_function
        <100 x "(">
        <100 x ")">,
        ok.

Indenting whole file: 12.7 -> 10.6 (no cache), 11.7 -> 10.0 (cached)

------------------------------------------------------------

Test code:

    f() ->
        my_function <1000 x "("> <1000 x ")">,
        LTI.

Indenting LTI: 1.74 -> 11.75 (no cache), 1.39 -> 11.11 (cached)

The huge slowdown is due to the fact that searchpair evaluates synIDattr(...)
many times:

    searchpair(a:start, a:middle, a:end, 'bW',
               \'synIDattr(synID(line("."), col("."), 0), "name") ' .
               \'=~? "string\\|quotedatom\\|comment\\|erlangChar"',

If I remove the 'synIDattr...' part, the execution time will be a fraction of
the current execution time.

------------------------------------------------------------

Test code:

    f() ->
        begin
            <999 x " A,">
            A
        end. % LTI

Indenting LTI: 3.66 -> 0.028 (no cache), 1.61 -> 0.024 (cached)

The large difference is due to the fact that we don't have to tokenize and
parse the 1000 lines.

------------------------------------------------------------

Test code:

    f() ->
        begin
            <99 x " A,">
            A
        end. % LTI

Indenting whole file: 0.48 -> 0.35 (no cache), 0.39 -> 0.27 (cached)

------------------------------------------------------------

Test code:

    f() ->
        begin
            <999 x " A,"> A
        end. % LTI

Indenting LTI: 1.54 -> 0.068 (no cache), 1.02 -> 0.005 (cached)

The large difference is due to the fact that we don't have to tokenize and
parse the 1000 lines.
Increase searchpair timeout
Remove unit tests

They were not maintained.
Exit if Vim version is smaller than 7.0
Make indent script compatible with vimerl syntax

The vimerl syntax file I used is the following:

https://github.com/jimenezrick/vimerl/blob/1d28cfd19864423f2906e3bb2101c6eaef1975d3/syntax/erlang.vim
Change "Last Update"
Remove unnecessary space character
Fix syntax bug

"a@b" was considered a function call; I don't know why.
Fix $\n in syntax

Fix taken from Vimerl.
Fix escape sequences and numbers in syntax
Add 'begin' indentation test
Revamp syntax highlight

- Use different config variables.
- Update the list of BIFs and directives.
- Remove unused hi link groups.