This repository has been archived on 2024-10-22. You can view files and clone it, but cannot push or open issues or pull requests.
spacemacs/layers/+emacs/ibuffer/packages.el
deb0ch 0dbfbd40ed bindings: improve buffers listing bindings
- bind spacemacs-layouts/non-restricted-buffer-list to SPC b B instead
of SPC B b
- rename buffer listing functions in which-key to be more explicit

PR title:

bindings: non-restricted-buffer-list-* to SPC B b instead of SPC B b

PR message:

I don't know what was the thought behind this, but `spacemacs-layouts/non-restricted-buffers-list-*` was alone in its `SPC B` prefix and `SPC b B` was almost free, only used in one layer that I would be surprised if it was widely used (`ibuffer`).

I also renamed buffers listing functions in `which-key` to be clearer for the user. Indeed, I find that names like `helm-mini` are pretty obscure and kind of defeat the purpose of `which-key` and `spacemacs-layouts-non-restricted-buffer-list-blah` was so long that it couldn't even be displayed.

Now the user can choose between `list-buffers` or `global-list-buffers` for listing buffers.
2017-06-12 12:46:35 +02:00

52 lines
1.6 KiB
EmacsLisp

;;; packages.el --- ibuffer Layer packages File for Spacemacs
;;
;; Copyright (c) 2012-2017 Sylvain Benner & Contributors
;;
;; Author: Aleksandr Guljajev <aleksandr.guljajev@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs
;;
;; This file is not part of GNU Emacs.
;;
;;; License: GPLv3
(setq ibuffer-packages
'(
ibuffer
ibuffer-projectile
))
(defun ibuffer/init-ibuffer()
(use-package ibuffer
:defer t
:init
(progn
(spacemacs/set-leader-keys "bI" 'ibuffer)
(global-set-key (kbd "C-x C-b") 'ibuffer)
(defun spacemacs//ibuffer-group-by-modes ()
"Group buffers by modes."
(when (eq 'modes ibuffer-group-buffers-by)
(spacemacs//ibuffer-create-buffs-group)))
(add-hook 'ibuffer-hook 'spacemacs//ibuffer-group-by-modes)
;; Use ibuffer to provide :ls
(evil-ex-define-cmd "buffers" 'ibuffer))
:config
(evilified-state-evilify-map ibuffer-mode-map
:mode ibuffer-mode
:bindings
"gr" 'ibuffer-update
"gj" 'ibuffer-forward-filter-group
"gk" 'ibuffer-backward-filter-group)))
(defun ibuffer/init-ibuffer-projectile()
(use-package ibuffer-projectile
:defer t
:init
(progn
(defun spacemacs//ibuffer-group-by-projects ()
"Group buffers by projects."
(when (eq 'projects ibuffer-group-buffers-by)
(ibuffer-projectile-set-filter-groups)
(unless (eq ibuffer-sorting-mode 'alphabetic)
(ibuffer-do-sort-by-alphabetic))))
(add-hook 'ibuffer-hook 'spacemacs//ibuffer-group-by-projects))))