diff --git a/init.d/basics/buffers.el b/init.d/basics/buffers.el index abd254f..215fcc2 100644 --- a/init.d/basics/buffers.el +++ b/init.d/basics/buffers.el @@ -1,6 +1,6 @@ ;;; buffers.el --- Default settings for buffers. -*- lexical-binding: t; -*- -;; Time-stamp: <2019-12-26T07:37:53+00:00> +;; Time-stamp: <2020-01-21T02:51:01+0100> ;;; Commentary: ;; * Setup scratch buffer. @@ -73,5 +73,23 @@ (midnight-mode t) ) +(use-package window-purpose + :pin melpa ; We need > 1.7 + + :config + (purpose-mode) + (add-to-list 'purpose-user-mode-purposes '(c++-mode . cpp)) + (add-to-list 'purpose-user-mode-purposes '(emacs-lisp-mode . elisp)) + (add-to-list 'purpose-user-mode-purposes '(Man-mode . help-buffers)) + (purpose-compile-user-configuration) + (add-to-list 'purpose-special-action-sequences + '(help-buffers + purpose-display-reuse-window-buffer)) + + ;; All Magit buffers have the same purpose. + (require 'window-purpose-x) + (purpose-x-magit-single-on) + ) + (provide 'basics/buffers) ;;; buffers.el ends here diff --git a/init.d/basics/ui.el b/init.d/basics/ui.el index 7ab65cf..c9c000a 100644 --- a/init.d/basics/ui.el +++ b/init.d/basics/ui.el @@ -1,6 +1,6 @@ ;;; ui.el --- Configure user interfaces. -*- lexical-binding: t; -*- -;; Time-stamp: <2020-01-20T19:46:38+0100> +;; Time-stamp: <2020-01-21T01:49:08+0100> ;;; Commentary: ;; * treemacs @@ -147,6 +147,18 @@ (:face font-lock-comment-face))))))) ) +(use-package ivy-purpose + :after (window-purpose) + + :config + (ivy-purpose-setup) + + :bind + (:map purpose-mode-map + ("C-x b" . ivy-purpose-switch-buffer-without-purpose) + ) + ) + ;; Switch between named persistent window configurations. (when (>= emacs-major-version 27) (use-package tab-bar