Changeset - 6fcf3ae97cb7
[Not reviewed]
0 3 0
Sergey Pashinin - 12 years ago 2013-08-26 09:17:13
sergey@pashinin.com
easy install + autocreate first workgroup

- installation - just activate WG
- changed some default variables (prefix key, session file, morph)
- automatically create first workgroup
3 files changed with 43 insertions and 39 deletions:
0 comments (0 inline, 0 general)
README.md
Show inline comments
 
@@ -14,52 +14,40 @@ Fork it and [add more special buffers support](https://github.com/pashinin/workg
 

	
 
## Install
 

	
 
- Just install "workgroups2" from Melpa.
 

	
 
OR
 

	
 
- use git and put `workgroups2` somewhere on your Emacs load path
 

	
 
        cd ~/.emacs.d/extensions
 
        git clone git://github.com/pashinin/workgroups2.git
 

	
 
- Byte-compile it if you want. This isn't required, but it'll speed some
 
  things up:
 

	
 
        C-u 0 M-x byte-recompile-directory <RET> ~/.emacs.d/extensions/workgroups2/
 
Just install "workgroups2" from Melpa and activate it with `(workgroups-mode 1)` after everything else.
 

	
 
## Configure
 

	
 
- Load a module (if you installed it not from Melpa):
 

	
 
        (add-to-list 'load-path "~/.emacs.d/extensions/workgroups2")
 
        (require 'workgroups2)
 
        ;; if you start Emacs as "emacs --daemon"
 
        ;; turn of autoloading of workgroups:
 
        ;;(setq wg-use-default-session-file nil)
 

	
 
        (workgroups-mode 1)   ; put this one at the bottom of .emacs
 

	
 
- and set some parameters:
 
You may want to configure it more:
 

	
 
        ;; Settings:
 
        (setq wg-prefix-key (kbd "C-c z")       ; all commands start with this keys
 
              wg-use-default-session-file nil   ; turn off for "emacs --daemon"
 
              wg-default-session-file "~/.emacs_workgroups"
 
              wg-use-faces nil
 
              wg-morph-on nil)                  ; animation off
 
        ;; Change prefix key (before activating WG)
 
        (setq wg-prefix-key (kbd "C-c z"))
 

	
 
        ;; Keyboard shortcuts - load, save, switch
 
        ;; Change workgroups session file
 
        (setq wg-default-session-file "~/.emacs.d/.emacs_workgroups"
 

	
 
        ;; Set your own keyboard shortcuts to reload/save/switch WG:
 
        (global-set-key (kbd "<pause>")     'wg-reload-session)
 
        (global-set-key (kbd "C-S-<pause>") 'wg-save-session)
 
        (global-set-key (kbd "s-z")         'wg-switch-to-workgroup)
 
        (global-set-key (kbd "s-/")         'wg-switch-to-previous-workgroup)
 

	
 
        (workgroups-mode 1)     ; Activate workgroups
 

	
 
## Use
 

	
 
Most commands are bound to both `<prefix> <key>` and `<prefix> C-<key>`.
 

	
 
(To set a prefix key - see settings above)
 
By default prefix is: "C-c z" (To change it - see settings above)
 

	
 
    <prefix> <key>
 
    <prefix> c    - create workgroup
 
    <prefix> A    - rename workgroup
 
    <prefix> k    - kill workgroup
 
    <prefix> v    - switch to workgroup
 
    <prefix> C-s  - save session
src/workgroups-variables.el
Show inline comments
 
@@ -31,7 +31,7 @@
 

	
 
;; keybinding customization
 

	
 
(defcustom wg-prefix-key (kbd "C-z")
 
(defcustom wg-prefix-key (kbd "C-c z")
 
  "Workgroups' prefix key.
 
Setting this variable requires that `workgroups-mode' be turned
 
off and then on again to take effect."
 
@@ -83,7 +83,7 @@ FIXME: docstring this"
 
  :group 'workgroups)
 

	
 
(defcustom wg-default-session-file
 
  (concat user-emacs-directory ".emacs-wg-session")
 
  "~/.emacs_workgroups"
 
  "Default filename to be used to save workgroups."
 
  :type 'file
 
  :group 'workgroups)
 
@@ -541,7 +541,7 @@ probably don't want to change this.  See
 

	
 
;; morph customization
 

	
 
(defcustom wg-morph-on t
 
(defcustom wg-morph-on nil
 
  "Non-nil means use `wg-morph' when restoring wconfigs."
 
  :type 'boolean
 
  :group 'workgroups)
src/workgroups2.el
Show inline comments
 
@@ -35,34 +35,47 @@
 
;; ----------------------
 
;; See the README.md file at: https://github.com/pashinin/workgroups2
 
;; Add the lines below to your .emacs configuration.
 
;; You can also set some keyboard shortcuts.
 
;;
 
;; (require 'workgroups2)
 
;;
 
;; (setq wg-prefix-key (kbd "C-c z")
 
;;       wg-use-default-session-file nil   ; turn off for "emacs --daemon"
 
;;       wg-default-session-file "~/.emacs_workgroups"
 
;;       wg-use-faces nil
 
;;       wg-morph-on nil)    ; animation off
 
;; (workgroups-mode 1)       ; Activate workgroups
 
;; ;; if you start Emacs as "emacs --daemon" - turn of autoloading of
 
;; ;; workgroups:
 
;; ;;(setq wg-use-default-session-file nil)
 
;;
 
;; (workgroups-mode 1)  ; put this one at the bottom of .emacs
 
;;
 
;;
 
;; Configure
 
;; ----------------------
 
;; ;; Change prefix key (before activating WG)
 
;; (setq wg-prefix-key (kbd "C-c z"))
 
;;
 
;; ;; Change workgroups session file
 
;; (setq wg-default-session-file "~/.emacs.d/.emacs_workgroups"
 
;;
 
;; ;; Set your own keyboard shortcuts to reload/save/switch WG:
 
;; (global-set-key (kbd "<pause>")     'wg-reload-session)
 
;; (global-set-key (kbd "C-S-<pause>") 'wg-save-session)
 
;; (global-set-key (kbd "s-z")         'wg-switch-to-workgroup)
 
;; (global-set-key (kbd "s-/")         'wg-switch-to-previous-workgroup)
 
;;
 
;;
 
;; Usage
 
;; Use
 
;; ----------------------
 
;; Most commands start with prefix `wg-prefix-key' (see above).
 
;; Most commands start with prefix `wg-prefix-key'.
 
;; You can change it before activating workgroups.
 
;; By default prefix is: "C-c z"
 
;;
 
;; <prefix> <key>
 
;;
 
;; <prefix> c    - create workgroup
 
;; <prefix> A    - rename workgroup
 
;; <prefix> k    - kill workgroup
 
;; <prefix> v    - switch to workgroup
 
;; <prefix> C-s  - save session
 
;; <prefix> C-f  - load session
 
;;
 
;;
 
;; Help
 
;; ----------------------
 
;; Type "<prefix> ?" for more help
 
@@ -224,6 +237,9 @@ If ARG is anything else, turn on `workgroups-mode'."
 
  (wg-fontified-message
 
    (:cmd "Workgroups Mode: ")
 
    (:msg (if workgroups-mode "on" "off")))
 
  (if (and workgroups-mode
 
           (= (length (wg-workgroup-list)) 0))
 
      (wg-create-workgroup "First workgroup"))
 
  workgroups-mode)
 

	
 
(provide 'workgroups2)
0 comments (0 inline, 0 general)