命令-MacVim中的R类功能 [英] Command - R like functionality in MacVim

查看:95
本文介绍了命令-MacVim中的R类功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Mac上,当我在TextMate中编辑红宝石文件时,我可以直接按Command-R执行该文件并在新窗口中查看结果.使用MacVim是否有与此类似的东西?

I'm on a Mac and when I am in TextMate editing a ruby file I can simply hit Command-R to execute the file and see the results in a new window. Is there something similar to this using MacVim?

能够打开一个新窗口非常重要.原因是因为在当前窗口中,我可能有超过一整页的信息.如果发生这种情况,我将无法滚动浏览.

It's really important that I be able to open up a NEW window. Reason is because in the current window I might have more than one full page of info. If that happens I can't scroll through it.

推荐答案

您可以创建自己的映射来做到这一点:

You could create your own mapping to do it:

map <D-r> :w<CR>:!ruby %<CR>

%是当前文件.如果文件以#!/path/to/ruby开头,则可以在映射中省略对ruby的显式调用.

% is the current file. If your file starts with #!/path/to/ruby you can omit the explicit call to ruby in your mapping.

还没有测试<D-r>映射-这里没有mac.可能与配置有关.

Haven't tested the <D-r> mapping - no mac here. It's likely configuration dependent.

这篇关于命令-MacVim中的R类功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆