diff --git a/README.md b/README.md index 9c8aebf925f97f627d6ce6663d50dd2e554985c1..e742a055239870532296f68b989d9bbf85108a1c 100644 --- a/README.md +++ b/README.md @@ -1,31 +1,32 @@ # Workgroups for Emacs -## What it does? +## What is it? + +Workgroups is a session manager for Emacs. - It saves all your opened buffers, their location and sizes on disk to restore later. - You also can create several workspaces. Isn't it enough? -## Usage +## Install -### Getting Workgroups +1. Just install "workgroups2" from Melpa. -See [github repo](http://github.com/tlh/workgroups.el). +OR -- Put `workgroups` somewhere on your Emacs load path +2. use git and put `workgroups2` somewhere on your Emacs load path cd ~/.emacs.d/extensions git clone git://github.com/pashinin/workgroups2.git - git pull - -### Installing - 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 ~/.emacs.d/extensions/workgroups2/ -- Load a module: +## Configure + +- Load a module (if you installed it not from Melpa): (add-to-list 'load-path "~/.emacs.d/extensions/workgroups2") (require 'workgroups2) @@ -35,104 +36,46 @@ See [github repo](http://github.com/tlh/workgroups.el). ;; Settings: (desktop-save-mode t) ; save opened files (setq wg-prefix-key (kbd "C-c z") - wg-no-confirm t - wg-file "~/.emacs_files/workgroups" + wg-use-default-session-file nil ; turn off for "emacs --daemon" + wg-default-session-file "~/.emacs_files/workgroups" wg-use-faces nil - wg-morph-on nil ; animation off - wg-switch-on-load t) ; load first on start - (workgroups-mode 1) ; Activate workgroups - - ;; Keyboard shortcuts - ;; Load workgroups: - (global-set-key (kbd "") (lambda () (interactive) - (wg-find-session-file wg-file))) - ;; Save workgroups: - (global-set-key (kbd "C-S-") 'wg-save-session) ; Ctrl-Shift-pause - ;; Switch: - (global-set-key (kbd "s-z") 'wg-switch-to-workgroup) - (global-set-key (kbd "s-/") 'wg-switch-to-previous-workgroup) - ;; s-z == super + z == Win + z - -## Tutorial - -Most commands are bound to both ` ` and ` C-`. - -### Help - -To bring up a help buffer listing all the commands and their bindings, hit -` ?` (`wg-help`). - -- There are many other customization options. See the customization section in - the source for details, or use: - - M-x customize-group RET workgroups RET - -### Workgroup Creation + wg-morph-on nil) ; animation off -To start off, add a few workgroups. Hit ` c` to issue the command -`wg-create-workgroup`, give it a name, hit `RET`, and a new workgroup is -created. Maybe split the screen a few times with `C-x 2` and `C-x 3`, and -switch to different buffers in some of the windows to make it unique. Repeat -this process a few times to create some different workgroups. + ;; Keyboard shortcuts - load, save, switch + (global-set-key (kbd "") 'wg-reload-session) + (global-set-key (kbd "C-S-") 'wg-save-session) + (global-set-key (kbd "s-z") 'wg-switch-to-workgroup) + (global-set-key (kbd "s-/") 'wg-switch-to-previous-workgroup) -Every workgroup must have a unique name. You can rename workgroups after -they've been created with ` A` (`wg-rename-workgroup`). + (workgroups-mode 1) ; Activate workgroups -### Saving and Loading - -Saving and loading was the original motivation for writing Workgroups. You can -save your workgroups to a file with ` C-s` (`wg-save-session`) -and you can load workgroups from a file with `(wg-find-session-file wg-file)`. - -Once you have a file of saved workgroups, it's convenient to load it on -Emacs startup. To do so you can add a line like this to your`.emacs`: - - (wg-find-session-file "~/.emacs_files/workgroups") - -### Killing and Yanking - -You can kill workgroups with ` k` (`wg-kill-workgroup`). Killing a -workgroup deletes it from the list of workgroups, and copies its working config -to the kill ring. You can yank killed wconfigs into the current frame with -` y` (`wg-yank-config`). If the last command was `wg-yank-config`, -calling it again will yank the *next* wconfig in the kill ring, and so on, much -like Emacs' own kill ring. - -You can save a wconfig to the kill ring without killing its workgroup with the -kill-ring-save commands. ` M-w` (`wg-kill-ring-save-working-config`) -saves the working config to the kill ring, and ` M-W` -(`wg-kill-ring-save-base-config`) saves the base config to the kill ring. - -` M-k` (`wg-kill-workgroup-and-buffers`) kills a workgroup, and all the -buffers visible in it, and ` K` (`wg-delete-other-workgroups`) deletes -all but the current workgroup. +## Use +Most commands are bound to both ` ` and ` C-`. -### Cloning + + c - create workgroup + k - kill workgroup + v - switch to workgroup + C-z - save session + C-f - load session -Cloning a workgroup creates a new workgroup under a different name with the a -copy of the current workgroup's base and working configs. ` C` -(`wg-clone-workgroup`) will clone the current workgroup. +## Help +---------------------- +Type ` ?` (Eval `(wg-help)`) for more help. -### Offsetting and Swapping +This will bring up a help buffer listing all the commands and their bindings. -You can move a workgroup leftward or rightward in the workgroups list with -` ,` (`wg-offset-left`) and ` .` (`wg-offset-right`) -respectively. These commands work cyclically, so when you offset a workgroup -leftward or rightward when it's already on the far left or right of the list, it -will wrap around to the other side. +See the customization section in the source for details, or use: -` x` (`wg-swap-workgroups`) will swap the position in the workgroups -list of the previously selected workgroup with that of the current workgroup. + M-x customize-group RET workgroups RET ## Original Workgroups There is a package on Melpa called "workgroups". -This extension is based on experimental branch of the original repo: - -https://github.com/tlh/workgroups.el +This extension is based on experimental branch of the [original repo](http://github.com/tlh/workgroups.el). So great respect to the author. But it has not been updated for more than 2 years and experimental branch was not released. diff --git a/src/workgroups2.el b/src/workgroups2.el index e51d11165901284a26f33b31ee945a4f4ec58d9d..6ed394df921d91d7fef83d48a2f360c66b55c8af 100644 --- a/src/workgroups2.el +++ b/src/workgroups2.el @@ -54,18 +54,18 @@ ;; ;; Usage ;; ---------------------- -;; All commands start with prefix `wg-prefix-key' (see above). -;; - +;; Most commands start with prefix `wg-prefix-key' (see above). +;; ;; -;; -c - create workgroup -;; -k - kill workgroup -;; -v - switch to workgroup -;; -C-z - save session -;; -C-f - load session +;; c - create workgroup +;; k - kill workgroup +;; v - switch to workgroup +;; C-z - save session +;; C-f - load session ;; ;; Help ;; ---------------------- -;; Type "-?" for more help +;; Type " ?" for more help ;; ;; ;;; Code: