cobol.zip : COBOL indent plugin: Understands COBOL's awkward use of columns
| script karma
Downloaded by 2483
Comments, bugs, improvements
script versions (upload new version)
|Shipped with Vim as of 7.1
The indent plugin understands the column requirements of COBOL (Area A vs. Area B, comment indicator indented 6 spaces, etc.) and also neatly formats nested blocks and fields. It works quite well for the code I have used it with; further feedback is appreciated.
The ftplugin is designed to help comply with COBOL's insane column requirements. <C-T>, <C-D>, and <Tab> are remapped in insert mode to stop in columns 1, 7, 8 (Area A), and 12 (Area B) before switching to the use of shiftwidth/softtabstop. In normal mode, << and >> are remapped to ignore the first 7 columns, and with Vim 7, < and > serve as more general operator maps (>ap to indent a paragraph). These two behaviors (insert vs. normal mode) are a bit different but generally what one would expect.
This script works well coupled with vimscript #1654 .
|Unzip in ~/.vim or ~\vimfiles (Windows). The filetype is already detected by Vim.
An autocmd similar to the following is recommended for optimal use (place in your vimrc):
autocmd FileType cobol set sw=4 sts=4 et sta tw=72
Click on the package to download.
ip used for rating: 188.8.131.52