167 lines
5.7 KiB
EmacsLisp
167 lines
5.7 KiB
EmacsLisp
;; (C) Copyright Collin J. Doering 2014
|
|
;;
|
|
;; 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/>.
|
|
|
|
;; File: ibuffer.el
|
|
;; Author: Collin J. Doering <collin.doering@rekahsoft.ca>
|
|
;; Date: Oct 22, 2014
|
|
|
|
;; Setup ibuffer (interactive buffer)
|
|
(global-set-key "\C-x\C-b" 'ibuffer)
|
|
(autoload 'ibuffer "ibuffer" "List buffers." t)
|
|
|
|
;; Require ibuffer extentions (used for ibuffer-never-show-predicates)
|
|
(require 'ibuf-ext) ;; Built-in
|
|
(add-to-list 'ibuffer-never-show-predicates "^\\*slime-events\\*$")
|
|
(add-to-list 'ibuffer-never-show-predicates "^\\*Completions\\*$")
|
|
(add-to-list 'ibuffer-never-show-predicates "^\\*tramp/.*\\*$")
|
|
|
|
;; Enable ibuffer-vc extension
|
|
;; TODO: enable along side my pre existing filter groups using (ibuffer-vc-generate-filter-groups-by-vc-root).
|
|
;; Also add a key binding to switch to the vc-ibuffer (note: to switch back to the default ibuffer list use / R in ibuffer-mode
|
|
(require 'ibuffer-vc)
|
|
|
|
;; Add vc-status line to ibuffer
|
|
(setq ibuffer-formats '((mark modified read-only vc-status-mini " "
|
|
(name 18 18 :left :elide) " "
|
|
(size 9 -1 :right) " "
|
|
(mode 16 16 :left :elide) " "
|
|
(vc-status 16 16 :left) " "
|
|
filename-and-process)
|
|
(mark " " (name 16 -1) " " filename)))
|
|
|
|
;; Filter ibuffers (similar to gnus)
|
|
(setq ibuffer-saved-filter-groups
|
|
'(("default"
|
|
("dired" (mode . dired-mode))
|
|
("config" (or
|
|
(name . "^\\.xinitrc")
|
|
(name . "^\\.bashrc")
|
|
(name . "^\\.bash_profile")
|
|
(name . "^\\.zshrc")
|
|
(name . "^xmonad\\.hs")
|
|
(name . "^\\.emacs")
|
|
(name . "^\\.gnus")
|
|
(name . "^\\.xmobarrc")
|
|
(name . "^\\.Xdefaults")
|
|
(name . "^\\.Xresources")
|
|
(name . "^\\.screenrc")
|
|
(name . "^\\.xbindkeysrc")
|
|
(name . "^\\.racketrc")
|
|
(name . "^\\.ghci")
|
|
(name . "\w*\\.service")
|
|
(name . "\w*\\.socket")
|
|
(name . "^dunstrc")
|
|
(name . "^\\.mpdconf")
|
|
(name . "^\\.conkerorrc")))
|
|
("markup" (or
|
|
(mode . xml-mode)
|
|
(mode . html-mode)
|
|
(mode . haml-mode)
|
|
(mode . markdown-mode)
|
|
(mode . latex-mode)))
|
|
("code" (or
|
|
(mode . c-mode)
|
|
(mode . c++-mode)
|
|
(mode . perl-mode)
|
|
(mode . lua-mode)
|
|
(mode . clojure-mode)
|
|
(mode . java-mode)
|
|
(mode . python-mode)
|
|
(mode . ruby-mode)
|
|
(mode . emacs-lisp-mode)
|
|
(mode . lisp-mode)
|
|
(mode . sh-mode)
|
|
(mode . scheme-mode)
|
|
(mode . haskell-mode)
|
|
(mode . scala-mode)
|
|
(mode . php-mode)
|
|
(mode . css-mode)
|
|
(mode . sass-mode)
|
|
(mode . scss-mode)
|
|
(mode . js-mode)
|
|
(mode . sql-mode)))
|
|
("REPL" (or
|
|
(mode . geiser-repl-mode)
|
|
(mode . slime-repl-mode)
|
|
(mode . inferior-python-mode)
|
|
(mode . ipython-mode)
|
|
(mode . inferior-haskell-mode)
|
|
(mode . inferior-lisp-mode)
|
|
(mode . eshell-mode)
|
|
(mode . inferior-scheme-mode)
|
|
(mode . inferior-tcl)
|
|
(mode . erlang-shell-mode)
|
|
(mode . sql-interactive-mode)))
|
|
("git" (or
|
|
(name . "^\\*magit: .*\\*$") ;; this regxp could be better
|
|
(mode . magit-mode)
|
|
(mode . magit-diff-mode)
|
|
(mode . magit-log-mode)
|
|
(mode . magit-commit-mode)
|
|
(mode . magit-log-mode)
|
|
(mode . magit-wazzup-mode)
|
|
(mode . magit-process-mode)
|
|
(mode . magit-status-mode)
|
|
(mode . magit-branch-manager-mode)))
|
|
("bookmarks" (or
|
|
(name . "^\\*Bookmark List\\*$")))
|
|
("help" (or
|
|
(mode . help-mode)
|
|
(mode . apropos-mode)
|
|
(mode . info-mode)
|
|
(mode . man-mode)))
|
|
("messages" (or
|
|
(name . "^\\*geiser messages\\*$")
|
|
(name . "^\\*Shell Command Output\\*$")))
|
|
("helm" (name . "^\\*helm.*\\*$"))
|
|
("planner" (or
|
|
(name . "^\\*Calendar\\*$")
|
|
(name . "^diary$")
|
|
(mode . muse-mode)))
|
|
("emacs" (or
|
|
(name . "^\\*scratch\\*$")
|
|
(name . "^\\*Messages\\*$")
|
|
(name . "^\\*Backtrace\\*$")
|
|
(name . "^\\*Compile-Log\\*$")
|
|
(mode . ediff-meta-mode)
|
|
(mode . browse-kill-ring-mode)
|
|
(mode . package-menu-mode)
|
|
(mode . compilation-mode)))
|
|
("org" (or
|
|
(mode . org-mode)
|
|
(name . "^\\.org$")
|
|
(name . "^\\.org.gpg$")))
|
|
("IRC" (mode . rcirc-mode))
|
|
("mu4e" (or
|
|
(mode . mu4e-main-mode)
|
|
(mode . mu4e-compose-mode)
|
|
(mode . mu4e-headers-mode)
|
|
(mode . mu4e-view-mode)
|
|
(name . "^mu4e-update$")
|
|
(name . "^\\*trace of SMTP session to .*\\*$")))
|
|
("gnus" (or
|
|
(mode . message-mode)
|
|
(mode . bbdb-mode)
|
|
(mode . mail-mode)
|
|
(mode . gnus-group-mode)
|
|
(mode . gnus-summary-mode)
|
|
(mode . gnus-article-mode)
|
|
(name . "^\\.bbdb$")
|
|
(name . "^\\.newsrc-dribble"))))))
|
|
|
|
(add-hook 'ibuffer-mode-hook
|
|
(lambda ()
|
|
(ibuffer-switch-to-saved-filter-groups "default")))
|