2015-04-20 17:44:44 +00:00
|
|
|
;;; packages.el --- ibuffer Layer packages File for Spacemacs
|
|
|
|
;;
|
2021-03-22 20:11:29 +00:00
|
|
|
;; Copyright (c) 2012-2021 Sylvain Benner & Contributors
|
2015-04-20 17:44:44 +00:00
|
|
|
;;
|
2016-01-12 02:40:54 +00:00
|
|
|
;; Author: Aleksandr Guljajev <aleksandr.guljajev@gmail.com>
|
2015-04-20 17:44:44 +00:00
|
|
|
;; URL: https://github.com/syl20bnr/spacemacs
|
|
|
|
;;
|
|
|
|
;; This file is not part of GNU Emacs.
|
|
|
|
;;
|
2021-03-24 03:31:44 +00:00
|
|
|
;; This program is free software; you can redistribute it and/or modify
|
|
|
|
;; it under the terms of the GNU General Public License as published by
|
|
|
|
;; the Free Software Foundation, either version 3 of the License, or
|
|
|
|
;; (at your option) any later version.
|
|
|
|
;;
|
|
|
|
;; This program is distributed in the hope that it will be useful,
|
|
|
|
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
;; GNU General Public License for more details.
|
|
|
|
;;
|
|
|
|
;; You should have received a copy of the GNU General Public License
|
|
|
|
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
2015-04-20 17:44:44 +00:00
|
|
|
|
2016-01-18 03:06:04 +00:00
|
|
|
(setq ibuffer-packages
|
|
|
|
'(
|
|
|
|
ibuffer
|
|
|
|
ibuffer-projectile
|
|
|
|
))
|
2015-04-20 17:44:44 +00:00
|
|
|
|
2021-02-10 07:51:55 +00:00
|
|
|
(defun ibuffer/init-ibuffer ()
|
2015-04-20 17:44:44 +00:00
|
|
|
(use-package ibuffer
|
2018-03-04 04:37:53 +00:00
|
|
|
:defer t
|
2015-04-20 17:44:44 +00:00
|
|
|
:init
|
|
|
|
(progn
|
2016-11-09 13:41:02 +00:00
|
|
|
(spacemacs/set-leader-keys "bI" 'ibuffer)
|
2015-05-13 03:45:10 +00:00
|
|
|
(global-set-key (kbd "C-x C-b") 'ibuffer)
|
2015-05-13 03:34:04 +00:00
|
|
|
(defun spacemacs//ibuffer-group-by-modes ()
|
|
|
|
"Group buffers by modes."
|
|
|
|
(when (eq 'modes ibuffer-group-buffers-by)
|
|
|
|
(spacemacs//ibuffer-create-buffs-group)))
|
2015-09-28 20:37:58 +00:00
|
|
|
(add-hook 'ibuffer-hook 'spacemacs//ibuffer-group-by-modes)
|
|
|
|
|
|
|
|
;; Use ibuffer to provide :ls
|
|
|
|
(evil-ex-define-cmd "buffers" 'ibuffer))
|
2015-09-27 13:19:31 +00:00
|
|
|
:config
|
2015-11-21 10:07:14 +00:00
|
|
|
(evilified-state-evilify-map ibuffer-mode-map
|
2016-11-04 10:29:22 +00:00
|
|
|
:mode ibuffer-mode
|
|
|
|
:bindings
|
|
|
|
"gr" 'ibuffer-update
|
|
|
|
"gj" 'ibuffer-forward-filter-group
|
2019-01-07 11:25:45 +00:00
|
|
|
"]" 'ibuffer-forward-filter-group
|
|
|
|
"gk" 'ibuffer-backward-filter-group
|
|
|
|
"[" 'ibuffer-backward-filter-group)))
|
2015-04-20 17:44:44 +00:00
|
|
|
|
2021-02-10 07:51:55 +00:00
|
|
|
(defun ibuffer/init-ibuffer-projectile ()
|
2015-04-20 17:44:44 +00:00
|
|
|
(use-package ibuffer-projectile
|
2018-03-04 04:37:53 +00:00
|
|
|
:defer t
|
2015-04-20 17:44:44 +00:00
|
|
|
:init
|
|
|
|
(progn
|
2015-05-13 03:34:04 +00:00
|
|
|
(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))))
|