Code completion and syntax highlighting with VIM

If you are using the vim editor, automatic code completion and syntax highlighting is supported by fglcomp and fglform compilers.

In order to use auto completion with vim, you need at least vim version 7 with the Omni Completion feature.

To get the benefit of this feature with the vim editor, do this:

  1. Copy $FGLDIR/lib/fglcomplete.vim into the ~/.vim/autoload directory.
  2. Copy $FGLDIR/lib/fgl.vim into the ~/.vim/syntax directory.
  3. Copy $FGLDIR/lib/per.vim into the ~/.vim/syntax directory.
According to the version and the default settings of vim, you might need to add the following lines to your ~/.vimrc file:
autocmd Filetype fgl setlocal omnifunc=fglcomplete#Complete
autocmd Filetype per setlocal omnifunc=fglcomplete#Complete
syntax on
au BufNewFile,BufRead *.per setlocal filetype=per 

You can now use automatic code completion; open a .4gl or .per file, start to edit the file, and when you are in vim insert mode , press Ctrl-X followed by Ctrl-O to get a list of language elements to complete the instruction syntax or expression.

For more details about vim, see http://www.vim.org.