Adding .bash_profile, which on Mac OS X Lion is sourced instead of
[dotfiles] / .vimrc
diff --git a/.vimrc b/.vimrc
index 10703a9..eac5995 100644 (file)
--- a/.vimrc
+++ b/.vimrc
@@ -1,10 +1,14 @@
 " Don't imitate vi.
 set nocompatible
 
+" Make tab-completion work more like bash.
+set wildmenu
+set wildmode=list:full
+
 " Ignore certain file extensions when tab-completing.
-set wildignore=*.swp,*.bak,*.pyc,*.class,*.o
+set wildignore=*.swp,*.bak,*.pyc,*.class,*.o,*.exe
 
-" set filetype stuff to on
+" Set filetype stuff to on.
 filetype on
 filetype plugin on
 filetype indent on
@@ -14,6 +18,11 @@ filetype indent on
 "     autocmd filetype python set expandtab
 " endif
 
+" Allow folding.
+set foldenable
+set foldmethod=syntax
+set foldlevelstart=99
+
 " Show line numbers.
 set number
 set numberwidth=4
@@ -21,6 +30,9 @@ set numberwidth=4
 " Scroll five lines ahead of cursor.
 set scrolloff=5
 
+" Turn off error bells and visual bell
+set noeb vb t_vb=
+
 " Set up autoindentation.
 set smartindent
 filetype indent on
@@ -31,10 +43,10 @@ set tabstop=4
 set shiftwidth=4
 set expandtab
 
-" Allow backspacing over everything in insert mode
+" Allow backspacing over everything in insert mode.
 set backspace=indent,eol,start
 
-"Highlight bad spacing
+"Highlight bad spacing.
 highlight BadSpacing term=standout ctermbg=cyan
 augroup Spacing
     autocmd!
@@ -61,7 +73,7 @@ set splitbelow splitright
 " Line wrapping off
 set nowrap
 
-" Enlarge history and undo/redo buffers
+" Enlarge history and undo/redo buffers.
 set history=1000
 set undolevels=1000
 
@@ -89,4 +101,14 @@ noremap! <Left> <Esc>
 noremap  <Right> ""
 noremap! <Right> <Esc>
 
-
+" Map open and close items in insert mode.
+" Keep this commented out until I can get it working better.
+"inoremap { {<CR>}<Esc>O
+"inoremap [ []<Esc>i
+"inoremap ( ()<Esc>i
+"inoremap } <Esc>/}<CR>o
+"inoremap ] <Esc>/]<CR>a
+"inoremap ) <Esc>/)<CR>a
+
+" Automatically reload the .vimrc when changes are made to it
+au! BufWritePost .vimrc source %