Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Click here to return to the 'Don't accidentally open huge text files from the Command Line' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Don't accidentally open huge text files from the Command Line
Authored by: CarlRJ on May 23, '11 12:57:53PM
[ I'm continuing this not to try to say "thou shalt use MacVim above all others", merely following up on your points. ]
But some nice features in Text Edit include for example, option-click-drag to make vertical selections, which I frequently use for tab-delimited data.
FWIW, Option-click-drag for column selections works just fine in MacVim
I also perform multi-line searches very often.
Not sure precisely what this means; Vim (GUI or otherwise) can perform any search you can possibly imagine. This may help: Search across multiple lines - Vim Tips Wiki
In my case, I'd rather just `more -S` a large file and if I need to edit it, I'll use vim.

I normally do the same, though converted from typing more to less back in the days when they were different programs.

I totally get that some people just prefer different apps (spending most of my time in Terminal means non-typical Mac user right off the bat), I was trying to make the point that, for large column-oriented data files, Apple's TextEdit is (surprisingly, given the name), often not the best tool for the job.

But typically, I just want the file to appear in a different window next to my terminal. Do you know how to do that with a single terminal command? *That* would be cool.

Install the mvim command-line component that comes with MacVim. Type "mvim filename", or more excitingly, "some command | mvim -". Results pop up in a separate window, which you can dismiss at your leisure with ":q!", Cmd-W, or clicking the red X gumdrop (I normally use Cmd-W, Cmd-D, to quickly close, dismissing the "Do you want to save" prompt).

These days, I find that a lot of things I used to do as "some command > /tmp/foo" followed by "vi /tmp/foo" have been simplified/improved to "some command | mvim -".

Note that TextWrangler, BBEdit, TextMate, SubEthaEdit, and likely others, all supply some similar command-line executable to open a file in them, you're not stuck with MacVim for this :)

[ Reply to This | # ]