Created
July 4, 2012 11:16
-
-
Save lukego/3046820 to your computer and use it in GitHub Desktop.
The minimal Emacs configuration that I carry around with me
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; luke-basic.el -- my most basic Emacs configuration | |
(put 'narrow-to-region 'disabled nil) | |
(put 'narrow-to-page 'disabled nil) | |
(setq sentence-end-double-space nil) | |
(setq diff-switches "-u") | |
(global-set-key [(control g)] (lambda () (interactive))) ; NOP | |
(defun kill-buffers-by-regexp (regexp) | |
"Kill buffers whose buffer-file-name matches a regular expression" | |
(interactive "sEnter path regexp: ") | |
(mapc (lambda (buffer) | |
(if (and (buffer-file-name buffer) | |
(string-match regexp (buffer-file-name buffer))) | |
(kill-buffer buffer))) | |
(buffer-list))) | |
(if (fboundp 'menu-bar-mode) (menu-bar-mode -1)) | |
(if (fboundp 'tool-bar-mode) (tool-bar-mode -1)) | |
(if (fboundp 'scroll-bar-mode) (scroll-bar-mode -1)) | |
;;; My key bindings | |
(define-key isearch-mode-map "\C-h" 'isearch-delete-char) | |
(global-set-key "\C-h" 'backward-delete-char-untabify) | |
(global-set-key "\C-cs" 'show-outline-structure) | |
(global-set-key "\C-cp" 'pbook-show-structure) | |
(global-set-key "\C-cb" 'iswitchb-buffer) | |
(global-set-key "\M-g" 'goto-line) | |
(global-set-key "\C-cc" 'comment-region) | |
(defun show-outline-structure () | |
(interactive) | |
(occur outline-regexp) | |
(when (get-buffer "*Occur*") | |
(with-current-buffer "*Occur*" | |
(let ((buffer-read-only nil)) | |
(replace-regexp " *[0-9]+:" "")) | |
(pop-to-buffer (current-buffer)) | |
(forward-line 1)) | |
(message ""))) | |
(provide 'luke-basic) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment