Skip to content

Instantly share code, notes, and snippets.

@lukego
Created July 4, 2012 11:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lukego/3046820 to your computer and use it in GitHub Desktop.
Save lukego/3046820 to your computer and use it in GitHub Desktop.
The minimal Emacs configuration that I carry around with me
;;; 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