Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
假设我想在 Emacs 中处理一个远程文件。如果文件很大,这可能需要很长时间。
我可以告诉 Emacs/Tramp 只显示或检索其中的一部分吗?
您可以打开文件所在的目录,然后键入M-! head my_file. 该命令通过 SSH 执行。
head my_file
该函数insert-file-contents采用可选参数来指定要插入文件的哪个部分,并且快速浏览似乎 Tramp 试图仅提取它需要的部分。不过,您需要在此基础上编写一个交互式函数。
insert-file-contents