macos 在 Mac OS X 上编辑大文件

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/952886/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-21 06:12:01  来源:igfitidea点击:

Editing large files on Mac OS X

macoseditor

提问by John Topley

Does anyone have any recommendations for a programmer's editor that can cope with large files on Mac OS X? By large I mean hundreds of megabytes. TextMate doesn't cut it.

有没有人对可以在 Mac OS X 上处理大文件的程序员编辑器有任何建议?大我的意思是数百兆字节。TextMate 不会剪掉它。

采纳答案by Topher Fangio

Have you tried Vim? It's the only editor I use :-)

你试过Vim吗?这是我唯一使用的编辑器:-)

Edit:It seems to depend upon a couple of factors. I used Vim with large CSV (i.e. text-based) files and that worked great. YMMV :-)

编辑:这似乎取决于几个因素。我将 Vim 与大型 CSV(即基于文本)文件一起使用,效果很好。YMMV :-)

回答by Brandon Berry

If, as you say, only really need to get an idea of the structure try opening the document in Console. Believe it or not, I'm able to view files as large as 15GB (MAC OSX 10.7.2)

如果,如您所说,真的只需要了解结构,请尝试在控制台中打开文档。信不信由你,我可以查看大至 15GB 的文件 (MAC OSX 10.7.2)

回答by Draxillion

HexFiendis designed to read files of any size, but you'll need to work using fixed-column character wrapping and no newline detection.

HexFiend旨在读取任何大小的文件,但您需要使用固定列字符换行并且没有换行检测。

回答by MikeJ

If you just want to have an idea of structure, how about browsing with moreor less?

如果你只是想有结构的想法,怎么样用浏览更多更少

回答by Xavier Guardiola

Definitely vim is the answer. Check out the macvim, the mac version.

肯定 vim 是答案。查看macvim,mac 版本。

回答by jacobian

BBEdit, that old standby, is famous for handling really large files with aplomb (or, at least, it was back in the pre-TextMate era). There's a free version, TextWranger; I assume it's based on the same core and should still work.

BBEdit,那个旧的备用工具,以沉着处理真正的大文件而闻名(或者,至少,它回到了 TextMate 之前的时代)。有一个免费版本TextWranger;我认为它基于相同的核心并且应该仍然有效。

回答by Ludwig Weinzierl

I have used gvimfor files larger than 1 GB of NASTRANoutput. gvimhandles large files very well. In fact that was the main reason I switched from Emacsto vim.

我已经用于gvim大于 1 GB 的NASTRAN输出的文件。 gvim可以很好地处理大文件。事实上,这是我从Emacsvim转向的主要原因。

Emacsis a great editor but it can handle files only as large as 128 MB, at least the 32-bit version. If you decide to use EmacsI recommend to configure it to turn syntax highlighting off for large files.

Emacs是一个很棒的编辑器,但它只能处理 128 MB 的文件,至少是 32 位版本。如果您决定使用Emacs我建议将其配置为关闭大文件的语法突出显示。

Another way to deal with large files those days was heavy usage of head, tailand split.

那时处理大文件的另一种方法是大量使用head,tailsplit

回答by andebauchery

The native emacs on OS X seems to be the 64-bit version now. It works like a charm on my 250MB text file.

OS X 上的本机 emacs 现在似乎是 64 位版本。它对我的 250MB 文本文件很有用。

回答by simon

emacs, naturally, at least a 64 bit build (you can do that on OS X now, right?)

emacs,自然地,至少是 64 位版本(您现在可以在 OS X 上这样做,对吗?)

But also, these are surely generated files. Do you really need to interact with them all at once?

而且,这些肯定是生成的文件。你真的需要同时与他们互动吗?

回答by Michael Dunn

Vim has already been recommended. If you're using vim you might want to also use the LargeFileplugin (by the inimitable Charles "Dr Chip" Campbell), which automatically disables various features of vim in the interests of speed for files over 100Mb (at the default setting).

Vim 已经被推荐了。如果您正在使用 vim,您可能还想使用LargeFile插件(由独一无二的 Charles “Dr Chip” Campbell 提供),它会自动禁用 vim 的各种功能,以提高 100Mb 以上文件的速度(默认设置)。