1

I'm trying to redirect the output of a command to vim using the - argument, but it doesn't seem to work on OS X. For example, if I type

$ ls | vim - 

on the command line on one of my Linux machines, the output of ls is correctly piped to vim. But when I do the same thing on any of my OS X machines, I get

$ ls | vim -
Vim: Reading from stdin...

And it just hangs there until I hit CTRL-D.

Any idea why this would be happening and how to actually redirect the output of a command to vim?

For reference, I'm using OS X 10.6.4 (and 10.6.5) with vim 7.2 (and 7.3) with bash as my shell.

0

I would expect a hand like this if their were problems with permissions. This page expands on Vi on OS X more than I ever could. Rather than just cut and paste their answers, I thought I'd point you to it to see if it helps.

http://macvim-dev.github.io/macvim/

It mentions that forking was non-standard and that to fork, one should provide the whole path to binary. Making an alias to the whole path, like vim='TERM=xterm-color vim' would do the trick.

1

Use the -f option for macvim. And the -R option to quit without being asked to save.

ls | mvim -Rf -

Another example... svn diff | mvim -Rf -

-f option

-f  or  --nofork    Foreground: Don't fork when starting GUI

-R option

-R          Readonly mode (like "view")

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.
{"cc_re__cc_re__cc_by_sa_3_0": ["<li class=\"-item\"><a href=\"https://www.facebook.com/officialstackoverflow/\" class=\"-link\">Facebook</a></li>\r\n                    <li class=\"-item\"><a href=\"https://twitter.com/stackoverflow\" class=\"-link\">Twitter</a></li>\r\n                    <li class=\"-item\"><a href=\"https://linkedin.com/company/stack-overflow\" class=\"-link\">LinkedIn</a></li>\r\n                </ul>\r\n\r\n                <p class=\"mt-auto mb24\">\r\nsite design / logo &#169; 2019 Stack Exchange Inc; user contributions licensed under <a href=\"https://creativecommons.org/licenses/by-sa/3.0/\" rel=\"license\">cc by-sa 3.0</a>\r\n                            with <a href=\"https://stackoverflow.blog/2009/06/25/attribution-required/\" rel=\"license\">attribution required</a>.\r\n                    <span id=\"svnrev\">rev&nbsp;2019.1.18.32694</span>\r\n                </p>\r\n            </div>\r\n        </div>\r\n\r\n            </footer>\r\n            <script>StackExchange.ready(function () { StackExchange.responsiveness.addSwitcher(); })</script>\r\n    <noscript>\r\n        <div id=\"noscript-warning\">Super User works best "], "copyright__copyright__copyright": [" save.\n\nls | mvim -Rf -\n\nAnother example... svn diff | mvim -Rf -\n\n-f option\n\n-f  or  --nofork    Foreground: Don't fork when starting GUI\n\n-R option\n\n-R          Readonly mode (like \"view\")\n\nYour Answer\n\nBy clicking \"Post Your Answer\", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.\n\nNot the answer you're looking for? Browse other questions tagged or ask your own question."]}