Ⅰ. 插件描述
COBOL indent plugin: Understands COBOL's awkward use of columnsⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin '/cobol-zip'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle '/cobol-zip'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug '/cobol-zip'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/vim-scripts/cobol.zip
Ⅳ. 文档说明
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 .