记住所有打开的文件,其中包含拆分窗口及其在Emacs中的位置

时间:2010-09-25 04:05:40

标签: emacs

我们花了很多时间来习惯Emacs,但是如果没有额外的脚本,我希望从普通编辑器Coda获得的所有东西都是不可能的。

我想恢复之前的所有内容。

拆分窗口,它们的位置,打开的文件/ shell /调试器。一切都恢复原样。 Coda可以做到这一点,Eclipse可以做到这一点,任何事情都可以做到这一点。

当我需要Emacs的任何常规功能时,它总是需要大量的脚本才能拥有它。我以为我真的会死于pyflakes,代码颜色,缩小窗口绑定和其他20个脚本,我甚至不记得了...为什么这么多基本的东西没有集成呢???

适合初学者的好书?

5 个答案:

答案 0 :(得分:8)

在“选项”下查看> “自定义Emacs”。

听起来你想要启用两个功能:

  • “保存位置”,可在下次加载时保存每个文件中的位置。
  • “桌面”,用于保存您当前加载的所有文件。

或者,如果您想编辑.emacs文件:

(custom-set-variables
  ;; custom-set-variables was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
  '(desktop-enable t nil (desktop))
  '(save-place t nil (saveplace)))

答案 1 :(得分:5)

我有这个工作。 Emacs总是在我离开时完全重新开始,除非它崩溃......:

http://www.gentei.org/~yuuji/software/windows.el

这将保存所有窗口吐出和打开缓冲区:

http://www.emacswiki.org/emacs/SavePlace

这将保存您在文件中的位置。这里大致如何设置:

(require 'windows)
(require 'recentf)

;; -- Load the saved windows automatically on boot
(add-hook 'window-setup-hook 'resume-windows)

;; -- Save place in file
(setq-default save-place t)

;; --  Use this command to quit and save your setup
(define-key ctl-x-map "C" 'see-you-again)

;; -- Set up window saving!! Place at end of .emacs file
(win:startup-with-window)

答案 2 :(得分:3)

我找到了 Conveniently save and restore frame configurations ,它可能正在做你想要的。

答案 3 :(得分:2)

不确定它是否接近你想要的东西,但试一试:http://www.emacswiki.org/emacs/LayoutRestore

答案 4 :(得分:1)

Emacs 24.4快照since June 2013已向捆绑的会话管理器desktop.el添加了帧恢复。这包括恢复桌面位置和打开所有帧的窗口。我自己使用2014年1月的快照尝试了这个功能,它运行得很好,尽管还有一些小错误。这些可能已经在最近的快照中得到修复。

请注意,即使在理论上也无法轻松恢复某些缓冲区,例如调试器(gdb,pdb等)以及依赖于外部进程的任何其他缓冲区。

相关问题