6

I've been using vim for editing code for some time and now I want to use it effectively for programming in Standard ML. In emacs one can use sml-mode which allows one to open the SML intepreter (Moscow ML in my case) in a buffer and load the actual file.

Is it possible to run the Moscow ML interpreter and load the actual file from within vim?

4

2 回答 2

4

我所做的是,我:make设置了在莫斯科 ML 中运行文件的命令。这可以通过将以下内容添加到您的来完成.vimrc

" SML make code {{{
autocmd FileType sml setlocal makeprg=rlwrap\ mosml\ -P\ full\ '%'
" }}}

然后,您只需:make在 SML 缓冲区中键入,它就会通过莫斯科 ML 为您运行代码。(rlwrap通过使用 readline 功能扩展它,稍微改进了 REPL。)

于 2012-09-15T22:10:21.277 回答
0

vim-better-sml插件添加了内置的 REPL 和其他简洁的功能。看看:https ://github.com/jez/vim-better-sml

您可以按照此处的安装说明进行操作:https ://github.com/jez/vim-better-sml#install

于 2021-08-16T10:02:43.453 回答