My .vimrc File
Here is the contents of my current vimrc file. There's nothing special about it; I posted it here more for backup purposes, in case one day I lose my config file.
" Use Vim settings instead of Vi settings
set nocompatible
" 4 spaces for indenting
set shiftwidth=4
" How wide is a tab?
set tabstop=4
" How many columns to use when hitting tab?
set softtabstop=4
" Uses spaces instead of tabs
set expandtab
" Turn autoindenting on
set autoindent
" Turn on syntax highlighting
syntax on
" Show ruler
set ruler
" When typing a closing bracket, briefly
" highlight the matching opening bracket
set showmatch
" Change the colour scheme
colorscheme darkblue
" GUI Specific Stuff
if has('gui_running')
" Text Width
set textwidth=80
" Width
set columns=110
" Height
set lines=52
" Use a mouse
set mousa=a
endif
if has('gui')
" GUI Options
" g: grey inactive menu items
" m: display menu bar
" r: display right scrollbar
" b: display bottom scrollbar
" t: enable tearoff menus
" T: enable toolbar
set go=gm
set guifont=Courier
endif



(custom-set-variables
'(cua-mode t nil (cua-base))
'(ido-mode (quote both) nil (ido))
'(recentf-mode t)
'(show-paren-mode t)
;; boring font stuff deleted
)
;; do not make backup files
(setq make-backup-files nil)
;; turn on syntax coloring
(global-font-lock-mode 1)
;; always uses spaces instead of tabs
(setq-default indent-tabs-mode nil)
;; turn on flyspell-mode in for .txt files
(setq auto-mode-alist (cons '("\\.txt$" . flyspell-mode) auto-mode-alist))
;; spell-check the entire buffer whenever flyspell is enabled
;; flyspell-mode-hook is called after flyspell-mode is enabled
(setq flyspell-mode-hook
'(lambda ()
(flyspell-buffer)))
;; use flyspell in programming mode
(flyspell-prog-mode)
;;
;; function for underlining titles; useful in restructured text
;;
(defvar underline-char ?-
"Sets the initial underline character, and remembers the previously used character."
)
(defun underline (c)
"Underlines the current line with the given character."
(interactive "cUnderline character: ")
(unless (char-equal c ?\r)
(setq underline-char c))
(let ((len (- (point-at-eol) (point-at-bol))))
(forward-line 1)
(insert (make-string len underline-char))
(insert "\n\n")))
(defun single-underline ()
"Underlines the current line with '-' characters."
(interactive)
(underline ?-))
(defun double-underline ()
"Underlines the current line with '=' characters."
(interactive)
(underline ?=))
;;(define-key global-map "\M-u" 'underline)
(define-key global-map "\M--" 'single-underline)
(define-key global-map "\M-=" 'double-underline)
;; bind some function keys
(global-set-key (kbd "<f1>") 'string-insert-rectangle)
(global-set-key (kbd "<f11>") 'run-scheme)
(global-set-key (kbd "<f12>") 'run-python)
;;
(global-set-key (kbd "M-/") 'hippie-expand)
;; ctrl-W deletes word just typed --- faster than backspacing!
(global-set-key "\C-w" 'backward-kill-word)
(global-set-key "\C-e" 'kill-word)
(global-set-key "\C-x\C-k" 'kill-region)
(global-set-key "\C-c\C-k" 'kill-region)
;; alternative to M-x (Alt key)
(global-set-key "\C-x\C-m" 'execute-extended-command)
(global-set-key "\C-c\C-m" 'execute-extended-command)
;;; Scheme
(setq scheme-program-name "mzscheme")