All pastes #615871 Raw Edit

faceface

public text v1 · immutable
·published 2007-07-12 10:26 UTC
rendered paste body

;;; Configure some basics

;; Remove the dumb splas screen (it occurs on EVERY file!)
(setq inhibit-splash-screen t)

;; Me wheel mouse
(mwheel-install)

;; Allow sql-mysql command automatically
(load-library "sql")

;; Allow R command automatically
;;(load "~/emacs/ess-5.3.4/lisp/ess-site")

;; Enable visual feedback on selections
;;(setq transient-mark-mode t)

;; Default to better frame titles
(setq frame-title-format
      (concat  "%b - emacs@" system-name))

;; Default to unified diffs
(setq diff-switches "-u")

;; Silence the terminal bell
(setq ring-bell-function '(lambda ()))


;;; Configure some cool functions...

;; Auto INC
(defun increment-number-at-point ()
  (interactive)
  (skip-chars-backward "0123456789")
  (or (looking-at "[0123456789]+")
      (error "No number at point"))
  (replace-match (number-to-string (1+ (string-to-number (match-string 0))))))

;; Auto DEC
(defun decrement-number-at-point ()
  (interactive)
  (skip-chars-backward "0123456789")
  (or (looking-at "[0123456789]+")
      (error "No number at point"))
  (replace-match (number-to-string (1- (string-to-number (match-string 0))))))

;; Assign them
(global-set-key (kbd "C-c +") 'increment-number-at-point)
(global-set-key (kbd "C-c -") 'decrement-number-at-point)


;;; Configure some good stuff!

(eval-after-load
    "comint"
  '(progn
     (setq comint-scroll-to-bottom-on-output 'others)
     (setq comint-scroll-show-maximum-output t)
     (define-key comint-mode-map [up]
       'comint-previous-matching-input-from-input)
     (define-key comint-mode-map [down]
       'comint-next-matching-input-from-input)
     (define-key comint-mode-map "\C-a" 'comint-bol)
     )
  )


;;; Biffy (http://www.cabochon.com/~stevey/blog-rants/effective-emacs.html)

;; Make M-x a handy new key stroke
(global-set-key "\C-x\C-m" 'execute-extended-command)
(global-set-key "\C-c\C-m" 'execute-extended-command)

;; Make Ctrl-w match shell behaviour
(global-set-key "\C-w"     'backward-kill-word)

;; (remap old Ctrl-w behaviour to the following)
(global-set-key "\C-x\C-k" 'kill-region)
(global-set-key "\C-c\C-k" 'kill-region)

;; Lose the UI
(if (fboundp 'tool-bar-mode) (tool-bar-mode -1))
;;(if (fboundp 'scroll-bar-mode) (scroll-bar-mode -1))
;;(if (fboundp 'menu-bar-mode) (menu-bar-mode -1))

;; Re-run a macro at the push of a (single) button
(global-set-key [f5]       'call-last-kbd-macro)

;; Make paragraph formatting easier to access
(global-set-key "\M-p" 'fill-paragraph)

;; Stop Ctrl-z being stupid (and make it a shameless customization)
;;(global-set-key "\C-z" 'undo)