Using VimOutliner with Different Filetypes
By Steve Litt

VimOutliner is a set of scripts that turns the Vim editor into a high performance outline processor whenever Vim is used to process a file with a .otl file extension. But what if you want to have outline processor capabilities while editing files with other file extensions. For instance, I regularly process the following types of files as outlines:

*.pho
Phone list files.
*.emdl
Easy Menu Definition Language files. These files define menu system hierarchies, which in my case I convert to UMENU menu definition files using a script.
*.ebdl
Easy Bookmark Definition Language files. These define my system of HTML bookmarks, so that I can have the same bookmarks on different browsers, on different computers in different locations, and so my whole family has access to these bookmarks. The EBDL file is converted to an HTML page of cascading bookmark links using a script.

Vim would not process these filetypes as outlines by default. To enable outline processing on these filetypes, you would create a new .vim file in the $HOME/.vim/ftdetect directory. The file could be named anything as long as it ends in .vim. For the purposes of this article we'll name it my_vo_extensions.vim. Here is what would be contained in the $HOME/.vim/ftdetect/my_vo_extensions.vim file in order to energize VimOutliner on the *.pho, *.emdl and *.ebdl file extensions:

augroup filetypedetect
au! BufRead,BufNewFile *.emdl setfiletype vo_base
au! BufRead,BufNewFile *.ebdl setfiletype vo_base
au! BufRead,BufNewFile *.pho setfiletype vo_base
augroup END

Now everything's wonderful except for one little detail -- this file gets blown away every time you reinstall either Vim or VimOutliner. Never fear, a simple script, stored in a data directory subject to backup, can recreate it at a moment's notice. Here's the script, which we'll call makeMyVoExtensions.sh:

#!/bin/bash
cat <<here > $HOME/.vim/ftdetect/my_vo_extensions.vim
augroup filetypedetect
au! BufRead,BufNewFile *.emdl setfiletype vo_base
au! BufRead,BufNewFile *.ebdl setfiletype vo_base
au! BufRead,BufNewFile *.pho setfiletype vo_base
augroup END
here

Now, whenever you reinstall Vim or VimOutliner and lose your custom extensions, simply execute makeMyVoExtensions.sh. Whenever you want to add a new extension to your custom extensions, add it to makeMyVoExtensions.sh and rerun it.