命令-MacVim中的R类功能 [英] Command - R like functionality in MacVim
问题描述
我在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屋!