What is the best Emacs workspaces plugin?

后端 未结 6 868
眼角桃花
眼角桃花 2021-02-02 15:00

By workspace, I mean - I need to save the state of my open buffers (possibly in a user specified workspace file) and quickly switch to another set of open buffers, e.g. to conti

6条回答
  •  时光取名叫无心
    2021-02-02 15:30

    I use a combination of save-visited-files and workgroups. In fact, workgroups will probably do most of what you want by itself.

    My config:

    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;; 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))
    

提交回复
热议问题