2015-04-20 17:44:44 +00:00
|
|
|
;;; packages.el --- ibuffer Layer packages File for Spacemacs
|
|
|
|
;;
|
|
|
|
;; Copyright (c) 2012-2014 Sylvain Benner
|
|
|
|
;; Copyright (c) 2014-2015 Aleksandr Guljajev & Contributors
|
|
|
|
;;
|
|
|
|
;; Author: Sylvain Benner <aleksandr.guljajev@gmail.com>
|
|
|
|
;; URL: https://github.com/syl20bnr/spacemacs
|
|
|
|
;;
|
|
|
|
;; This file is not part of GNU Emacs.
|
|
|
|
;;
|
|
|
|
;;; License: GPLv3
|
|
|
|
|
|
|
|
(defvar ibuffer-packages
|
|
|
|
'(
|
|
|
|
ibuffer
|
|
|
|
ibuffer-projectile
|
|
|
|
))
|
|
|
|
|
|
|
|
(defun ibuffer/init-ibuffer()
|
|
|
|
(use-package ibuffer
|
|
|
|
:defer t
|
|
|
|
:init
|
|
|
|
(progn
|
2015-05-13 03:34:04 +00:00
|
|
|
(evil-leader/set-key "bB" '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-27 13:19:31 +00:00
|
|
|
(add-hook 'ibuffer-hook 'spacemacs//ibuffer-group-by-modes))
|
|
|
|
:config
|
|
|
|
(spacemacs|evilify-map ibuffer-mode-map
|
|
|
|
:mode ibuffer-mode)))
|
2015-04-20 17:44:44 +00:00
|
|
|
|
|
|
|
(defun ibuffer/init-ibuffer-projectile()
|
|
|
|
(use-package ibuffer-projectile
|
|
|
|
:defer t
|
|
|
|
: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))))
|