Command - R like functionality in MacVim

孤者浪人 提交于 2019-12-11 03:09:39

问题


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.


回答1:


You could create your own mapping to do it:

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

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

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




回答2:


The following question has the answer to exactly what I was looking for

https://superuser.com/questions/133886/vim-displaying-code-output-in-a-new-window-a-la-textmate



来源:https://stackoverflow.com/questions/3811572/command-r-like-functionality-in-macvim

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!