This mode provides the ability to have several layouts saved and then you can easily switch between your saved layouts. When you first load the mode, you will get a “default” layout named “default”.
Default keyboard prefix is C-c C-l
, and you can modify that by putting this
in your init-file (with your own prefix of course):
(0blayout-add-keybindings-with-prefix "C-c C-l")
You have the ability to create new layouts using PREFIX C-c
and name them.
There you can set up your layout as you want it, open buffers, edit files.
And when you have more than one layout, you can switch between the layouts
you have active with PREFIX C-b
.
You can also kill the layout that you’re currently visiting with PREFIX C-k
The lazy way (Using use-package)
This requires that you have use-package set up. But it’s in my opinion the easiest way to set up packages.
(use-package 0blayout
:ensure t
;; Optionally set default layout name
:init (setq-default 0blayout-default "my-default-layout-name")
;; Load the mode
:config (0blayout-mode t))
- Follow the guide here http://melpa.org/#/getting-started to add MELPA
- Then you can install
0blayout
from MELPA inpackage-list-packages
You could also have a clause like this to automaticly install it:
(unless (package-installed-p '0blayout)
(progn
(package-refresh-contents)
(package-install '0blayout)))
To activate 0blayout-mode
you just put (0blayout-mode 1)
somewhere after
you loaded it.
- Download
0blayout.el
- Put the file in some folder like
$HOME/.emacs.d/lisp/
Then you can include like this:
(add-to-list 'load-path
(expand-file-name "lisp" user-emacs-directory))
(require '0blayout)
(0blayout-mode 1) ; Activate 0blayout-mode
0b is just a prefix I use for things because I have the domain 0b.se, that’s it.