(Screencast) Building A Little UI To Manage Buffers

(use-package eyebrowse
  :ensure t
  :config
  (setq eyebrowse-wrap-around t)
  (eyebrowse-mode t)
  (defhydra help/hydra-left-side/eyebrowse (:color blue :hint nil)
    "
current eyebrowse slot: %(eyebrowse--get 'current-slot)
 _j_ previous _k_ last _l_ next _u_ close _i_ choose _o_ rename _q_ quit
   _a_ 00 _s_ 01 _d_ 02 _f_ 03 _g_ 04 _z_ 05 _x_ 06 _c_ 07 _v_ 08 _b_ 09"
    ("j" #'eyebrowse-prev-window-config :exit nil)
    ("k" #'eyebrowse-last-window-config)
    ("l" #'eyebrowse-next-window-config :exit nil)
    ("u" #'eyebrowse-close-window-config :exit nil)
    ("i" #'eyebrowse-switch-to-window-config)
    ("o" #'eyebrowse-rename-window-config :exit nil)
    ("q" nil)
    ("a" #'eyebrowse-switch-to-window-config-0)
    ("s" #'eyebrowse-switch-to-window-config-1)
    ("d" #'eyebrowse-switch-to-window-config-2)
    ("f" #'eyebrowse-switch-to-window-config-3)
    ("g" #'eyebrowse-switch-to-window-config-4)
    ("z" #'eyebrowse-switch-to-window-config-5)
    ("x" #'eyebrowse-switch-to-window-config-6)
    ("c" #'eyebrowse-switch-to-window-config-7)
    ("v" #'eyebrowse-switch-to-window-config-8)
    ("b" #'eyebrowse-switch-to-window-config-9))
  (global-set-key (kbd "C-M-e") #'help/hydra-left-side/eyebrowse/body))

3 thoughts on “(Screencast) Building A Little UI To Manage Buffers”

  1. Are you using ivy? Then you might try this out. To me it seem more usable than Eyebrowse or any other dedicated package for workspace management.
    1. Define a separate function to show only “views”. I just requested to add this function, which was suggested by the author in a github issue, to the codebase.
    (defun ivy-switch-view ()
    (interactive)
    (let ((ivy-initial-inputs-alist
    ‘((ivy-switch-buffer . “{}”))))
    (ivy-switch-buffer)))
    2. Here is my use-package-config of ivy, just for completeness.
    (use-package ivy
    :bind
    (“C-S-r” . ivy-resume)
    (“H-b” . ivy-switch-view)
    :config
    (setq ivy-use-virtual-buffers t)
    (setq ivy-display-style ‘fancy)
    (setq ivy-count-format “(%d/%d) “)
    (setq ivy-height 20)
    (ivy-mode 1)
    :diminish ivy-mode ” “)
    3. This is an example of pre-defined ivy-views. You can add dynamically ivy-views by calling ivy-push-view or removing them by using ivy-pop-view.
    (setq ivy-views'(
    (“{} notes + internal”
    (horz
    (file “~/org/active/notes.org”)
    (file “~/org/active/internal.org”)))
    (“{} notes + customer”
    (horz
    (file “~/org/active/notes.org”)
    (file “~/org/active/customer.org”)))
    ))

    1. Hi Jens. I’m on ido. Reading the code it looks like it does it exactly!
      Great to know!

Leave a Reply

Your email address will not be published. Required fields are marked *