通過工作區,我的意思是 - 我需要保存的我打開的緩衝區狀態(可能在用戶指定的工作區文件),並迅速切換到另一套開放的緩衝區,例如中繼續處理與另一個項目相關的文件。什麼是最好的Emacs工作區插件?
有一個Emacs插件,它允許嗎?你會推薦哪一個?
通過工作區,我的意思是 - 我需要保存的我打開的緩衝區狀態(可能在用戶指定的工作區文件),並迅速切換到另一套開放的緩衝區,例如中繼續處理與另一個項目相關的文件。什麼是最好的Emacs工作區插件?
有一個Emacs插件,它允許嗎?你會推薦哪一個?
我用的save-visited-files和workgroups組合。事實上,工作組可能會自己完成大部分的工作。
我的配置:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; workgroups for windows
(setq wg-prefix-key (kbd "C-c z")
wg-no-confirm t
wg-file (concat emacs-persistence-directory "workgroups")
wg-use-faces nil
wg-switch-on-load nil)
(defun wg-load-default()
"Run `wg-load' on `wg-file'."
(interactive)
(wg-load wg-file))
(defun wg-save-default()
"Run `wg-save' on `wg-file'."
(interactive)
(when wg-list
(with-temp-message ""
(wg-save wg-file))))
(with-library 'workgroups
(define-key wg-map (kbd "C-l") 'wg-load-default)
(define-key wg-map (kbd "C-s") 'wg-save-default)
(workgroups-mode 1)
(add-hook 'auto-save-hook 'wg-save-default)
(add-hook 'kill-emacs-hook 'wg-save-default))
如果您使用的是Linux/GNOME3,你可以試試這個擴展名:https://extensions.gnome.org/extension/361/emacs-manager/ 這個擴展可以讓你通過管理多個emacs的守護進程同時在不同項目的工作,並保存/恢復緩衝區的狀態。
就個人而言,我一直在使用`persp-mode':
展望爲Emacs,由Nathan魏澤鮑姆基於
perspective-el
。 但是在各個框架之間共享的視角+保存/恢復文件的能力。
HIROSE Yuuji的revive.el已經很好地工作了很長一段時間了。我使用revive.el中的註釋中提供的標準配置。該文檔編寫得很好,而且複用非常易於使用和配置。特別是,revive.el比一些更好的支持來恢復比較複雜的配置。如果將它與HIROSE Yuuji的windows.el結合起來會特別好。他們一起工作。 windows.el使得召回窗口拆分成爲可能,等等。revive.el的構建着眼於擴展特定設置的深層模式集成。但對於我的使用,我發現它是相當不錯的開箱即用的,但我想我接下來會調整它恢復,我目前還沒有安裝的w3m窗口(更新:我現在做:見底部)。
這是我的復活配置。我有一些有益的意見,首先爲windows.el然後revive.el在線:
(provide 'my-revive-config)
(require 'windows) ; use this with revive so that window splits are recallable
; too
(win:startup-with-window) ; start with window 1
;;;[Key Bindings]
;;;
;;; The default prefix key stroke for Windows is `C-c C-w'. If it
;;; causes you some troubles, see the section `Customizations'.
;;; Here are the default key bindings.
;;;
;;; C-c C-w 1 Switch to window 1 (Q)
;;; C-c C-w 2 Switch to window 2 (Q)
;;; :
;;; C-c C-w 9 Switch to window 9 (Q)
;;; C-c C-w 0 Swap windows with the buffer 0 (Q)
;;; (Select unallocated frame(Emacs 19))
;;; C-c C-w SPC Switch to window previously shown (Q)
;;; C-c C-w C-n Switch to next window
;;; C-c C-w C-p Switch to previous window
;;; C-c C-w ! Delete current window (Q)
;;; C-c C-w C-w Window operation menu
;;; C-c C-w C-r Resume menu
;;; C-c C-w C-l Local resume menu
;;; C-c C-w C-s Switch task
;;; C-c C-w = Show window list (Q)
;;;
;;; The key strokes to select windows from 1 to 9 must be
;;; frequently used, so the alternative key strokes `C-c [Num.]' are
;;; available by default (And any function with (Q)mark can be
;;; invoked without C-w). To disable these quick key strokes, set
;;; the variable win:quick-selection to `nil' in your ~/.emacs.
(autoload 'save-current-configuration "revive" "Save status" t)
(autoload 'resume "revive" "Resume Emacs" t)
(autoload 'wipe "revive" "Wipe Emacs" t)
(define-key ctl-x-map "S" 'save-current-configuration)
(define-key ctl-x-map "F" 'resume)
(define-key ctl-x-map "K" 'wipe)
;;;
;;;[How to use]
;;;
;;; Call `save-current-configuration' (`C-x S' if you define key as
;;; above) when you want to save current editing status and call
;;; `resume' to restore it. Numerical prefix arg to them specifies
;;; the buffer number in which the editing status will be saved.
;;; Here the buffer refers to a revive s-exp in ~/.revive.el of
;;; which there can be n
;;;
;;; [Sample Operations]
;;; C-u 2 C-x S ;save status into the buffer #2
;;; C-u 3 C-x F ;load status from the buffer #3
有這種變異別人像revive-plus.el和slightly modified clone on github,但我更喜歡原來的。
更新週一,2015年1月12日:現在我可以恢復w3m的復興(見覆蘇。埃爾文檔的詳細信息,並在實例特定的外觀復興:主要模式 - 命令ALIST默認):你告訴重振w3m的緩衝區的名字
(setq revive:major-mode-command-alist-private
'(("*w3m*" . w3m)))
通知。即使您有多個選項卡,也只有第一個需要像上面那樣枚舉。
這裏是w3m的變量我已恢復從以前的會話中的所有選項卡:
(setq w3m-session-load-last-sessions t)
我希望切換到另一個工作組將關閉與舊工作組關聯的所有緩衝區並打開新工作組,而不是_just_打開新工作組。 – axel22
'workgroups'沒有在緩衝區組之間進行適當的切換,加載/保存是一件痛苦的事情。我很欣賞答案,但我認爲這不是一個好的解決方案。 – axel22
我同意恢復(wg-restore-workgroup)和更新(wg-update-workgroup)會很痛苦,因爲它需要紀律。你可以製作一些鉤子來實現自動化,但它確實應該是內置的。加載和保存可以很容易地自動化,例如,像我一樣自動保存鉤子。我很久以前就停止關心打開的緩衝區。我每隔幾天清除其中的一些,並且ido模式使得切換變得容易。我現在打開了91個緩衝區。 – jpkotta