Browse Source

Update ibuffer and keybinds.

master
Taylor Bockman 2 years ago
parent
commit
b495d54f2d
  1. 4
      README.md
  2. 3
      elisp/keybinds.el
  3. 71
      elisp/modes/ibuffer-settings.el

4
README.md

@ -19,6 +19,10 @@ Emacs session quickly for tasks like mail (if you use a text-based mail editor).
Sometimes you have certain things that a library might require but you don't want committed to your dotfiles. This git Sometimes you have certain things that a library might require but you don't want committed to your dotfiles. This git
project will ignore `private.el`. You may put your private information in `~/.emacs.d/elisp/private.el` for it to be loaded. project will ignore `private.el`. You may put your private information in `~/.emacs.d/elisp/private.el` for it to be loaded.
## IBuffer
`ibuffer` has been configured to filter/folderize common things such as source code, magit, etc for easier management. To launch it, use `C-x C-b`.
## Markdown ## Markdown
For full use of the markdown mode you will need a markdown preprocessor installed such as pandoc or multimarkdown. For full use of the markdown mode you will need a markdown preprocessor installed such as pandoc or multimarkdown.

3
elisp/keybinds.el

@ -9,3 +9,6 @@
;; Allow arrow meta-arrow to move between windows. ;; Allow arrow meta-arrow to move between windows.
(windmove-default-keybindings 'meta) (windmove-default-keybindings 'meta)
;; Force C-x C-b to ibuffer
(global-set-key (kbd "C-x C-b") 'ibuffer)

71
elisp/modes/ibuffer-settings.el

@ -3,56 +3,43 @@
;;; Commentary: ;;; Commentary:
;;; ;;;
;;; Use C-x C-b to launch ibuffer. ;;; Use C-x C-b to launch ibuffer.
;; Hide all buffers with an asterisk
(require 'ibuf-ext)
(add-to-list 'ibuffer-never-show-predicates "^\\*")
(setq ibuffer-saved-filter-groups (setq ibuffer-saved-filter-groups
'(("default" (quote (("default"
("Emacs Configuration" (or (filename . ".emacs.d") ("dired" (mode . dired-mode))
(filename . "init.el") ("perl" (mode . cperl-mode))
(filename . "package.el") ("lisp" (or (mode . lisp-mode)
(filename . "private.el") (mode . emacs-lisp-mode)))
(filename . "emacs.d"))) ("python" (mode . python-mode))
("Org" (or (mode . org-mode) ("git" (mode . magit-mode))
(filename . "OrgMode"))) ("erc" (mode . erc-mode))
("Magit" (name . "magit")) ("planner" (or
("Help" (or (name . "\*Help\*") (name . "^\\*Calendar\\*$")
(name . "\*Apropos\*") (name . "^diary$")
(name . "\*info\*"))) (mode . muse-mode)))
("Dired" (mode . dired-mode)) ("emacs" (or
;; Dev has groups for all languages you program in (name . "^\\*scratch\\*$")
("Dev" (or
(filename . ".c")
(filename . ".cpp")
(filename . ".hpp")
(filename . ".h")
(filename . ".java")
(filename . ".py")
(filename . ".lisp")
(filename . ".properties")
(filename . ".gradle")
(filename . ".am")
(filename . ".json")
(mode . yaml-mode))
)
("Text" (or (filename . ".csv")
(filename . ".tsv")
(filename . ".txt")
(filename . ".log")))
("Emacs" (or (name . "^\\*scratch\\*$")
(name . "^\\*Messages\\*$"))) (name . "^\\*Messages\\*$")))
("Gnus" (or (mode . message-mode) ("svg" (name . "\\.svg")) ; group by file extension
("gnus" (or
(mode . message-mode)
(mode . bbdb-mode) (mode . bbdb-mode)
(mode . mail-mode) (mode . mail-mode)
(mode . gnus-group-mode) (mode . gnus-group-mode)
(mode . gnus-summary-mode) (mode . gnus-summary-mode)
(mode . gnus-article-mode) (mode . gnus-article-mode)
(name . "^\\.bbdb$") (name . "^\\.bbdb$")
(name . "^\\.newsrc-dribble"))) (name . "^\\.newsrc-dribble")))))))
)))
;; Automatically keep buffers up to date and load the filter
(add-hook 'ibuffer-mode-hook (add-hook 'ibuffer-mode-hook
'(lambda () (lambda ()
(ibuffer-auto-mode 1) (ibuffer-auto-mode 1)
(ibuffer-switch-to-saved-filter-groups "default"))) (ibuffer-switch-to-saved-filter-groups "default")))
;; Disable eager line numbering
(add-hook 'ibuffer-mode-hook 'nolinum) (add-hook 'ibuffer-mode-hook
(setq ibuffer-expert t) (lambda ()
(setq ibuffer-show-empty-filter-groups nil) (ibuffer-switch-to-saved-filter-groups "default")))

Loading…
Cancel
Save