18

ワークスペースとは、つまり、開いているバッファの状態を(おそらくユーザー指定のワークスペースファイルに)保存し、別のプロジェクトに関連するファイルで作業を続けるなど、開いているバッファの別のセットにすばやく切り替える必要があります。

これを可能にするEmacsプラグインはありますか?どれをお勧めしますか?

4

6 に答える 6

11

私はsave-visited-filesworkgroupsの組み合わせを使用しています。実際、ワークグループはおそらくあなたが望むことのほとんどをそれ自体で行うでしょう。

私の設定:

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; 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))
于 2012-06-29T21:17:42.990 に答える
6

個人的に、私は`persp-mode'を使用しています:

NathanWeizenbaumによるemacsの展望perspective-el。しかし、フレーム間で共有されるパースペクティブ+ファイルから/ファイルに保存/復元する機能。

于 2013-12-16T19:05:15.067 に答える
2

Linux / Gnome3を使用している場合は、次の拡張機能を試すことができます。https ://extensions.gnome.org/extension/361/emacs-manager/ この拡張機能を使用すると、複数のemacsデーモンを管理することで、さまざまなプロジェクトで同時に作業できます。バッファの状態を保存/復元します。

于 2012-07-02T04:57:02.937 に答える
2

desktop.elはあなたの状況で役立ちます。

emacsパッケージバッファから(紹介ページからコピーして)できます:

デスクトップを保存します。つまり、-いくつかのグローバル変数-関連ファイルを含むバッファのリストです。各バッファについても-メジャーモード-デフォルトディレクトリ-ポイント-マーク&マーク-アクティブ-バッファ読み取り専用-いくつかのローカル変数

于 2012-06-29T17:39:28.980 に答える
2

HIROSE Yuujiのrevive.elは、かなり前からうまく機能してくれました。revive.elのコメントに示されている標準構成を使用します。ドキュメントはよく書かれており、復活は非常に使いやすく、設定も簡単です。特に、revive.elは、もう少し複雑な構成を復活させるために、いくつかよりも優れたサポートを提供します。HIROSEゆうじの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.elgithubのわずかに変更されたクローンなど、他のバリエーションもありますが、私はオリジナルの方が好きです。

2015年1月12日月曜日の更新:reviveでw3mを復元できるようになりました(詳細については、revive.elのドキュメントを参照してください。特に、revive:major-mode-command-alist-defaultの例を参照してください)。

(setq revive:major-mode-command-alist-private
      '(("*w3m*"    . w3m)))

w3mバッファの名前を復活させるように言っていることに注意してください。複数のタブがある場合でも、上記のように最初のタブのみを列挙する必要があります。

前のセッションからすべてのタブを復元するために設定したw3m変数は次のとおりです。

(setq w3m-session-load-last-sessions t)
于 2015-01-11T01:02:44.220 に答える
0

発射モードはあなたが何を達成するかもしれません:

プロジェクト内のバッファーを切り替えるには:projectile-switch-to-buffer

プロジェクトを切り替えるには:projectile-switch-to-project

私はこのようなものを持っています:

(global-set-key (kbd "C-x b") '(λ ()
                                (interactive)
                                (if (projectile-project-p) 
                                    (call-interactively 'projectile-switch-to-buffer)
                                (call-interactively 'ivy-switch-buffer))))

(global-set-key (kbd "C-x B") 'ivy-switch-buffer)
于 2020-02-08T15:56:48.457 に答える