Ⅰ. 插件描述
some sml related mappingsⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'marcweber/vim-addon-sml'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'marcweber/vim-addon-sml'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'marcweber/vim-addon-sml'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/marcweber/vim-addon-sml
Ⅳ. 文档说明
vim-addon-sml:
very minimalistic sml support:
- toggle .sml and .sig files
- override .sml default filetype assignment
- mlton sml compilation mapping (-> vim-addon-actions)
- some snipmate snippets
- % matchit support for some struct / let .. constructs
There is still much left to be done..
I recommend adding this to ~/.ctags file. The default .sml parser provided by
exuberant ctags is not good enough - so I abuse the ocmal parser (which parses
data structures perfectly) augmenting it by sml specific structure, ...
regeulare expressions
--langmap=OCaml:.sml
--regex-OCaml=/^[ t]*datatype[ t]+([A-Z'a-z0-9_]+)/1/d,datatype/
--regex-OCaml=/^[ t]*and[ t]+([A-Z'a-z0-9_]+)/1/d,datatype/
--regex-OCaml=/^[ t]*withtype[ t]+([A-Z'a-z0-9_]+)/1/w,withtype/
--regex-OCaml=/^[ t]*structure[ t]+([A-Z'a-z0-9_]+)/1/s,structure/
--regex-OCaml=/^[ t]*signature[ t]+([A-Z'a-z0-9_]+)/1/S,signature/
--regex-OCaml=/[ t]*val[ t]+([A-Z'a-z0-9_]+)/1/v,val/
--regex-OCaml=/^[ t]*fun[ t]+([A-Z'a-z0-9_]+)/1/f,fun/
--regex-OCaml=/^[ t]*type[ t]+([A-Z'a-z0-9_]+)/1/t,type/