" 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
+
+" Set up autoindentation.
+set smartindent
filetype indent on
" Example filetype-specific setting:
" autocmd filetype python set expandtab
" endif
-" Show line numbers.
-set number
-set numberwidth=4
+" Allow folding.
+set foldenable
+set foldmethod=syntax
+set foldlevelstart=99
" Scroll five lines ahead of cursor.
set scrolloff=5
-" Set up autoindentation.
-set smartindent
-filetype indent on
+" Turn off error bells and visual bell
+set noeb vb t_vb=
-" Set tabs to width 4.
-set softtabstop=4
-set tabstop=4
-set shiftwidth=4
+" Set tabs to width 2.
+filetype plugin indent on
+set shiftwidth=2
+set softtabstop=2
+set tabstop=2
set expandtab
-" Allow backspacing over everything in insert mode
+" language-specific settings: tab width is 4 for python
+autocmd FileType python setlocal shiftwidth=4 softtabstop=4 tabstop=4
+
+"allow projet-specific vimrcs
+set exrc
+set secure " Don't execute :autocmd in project-specific vimrcs unless owned by me
+
+" 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!
autocmd FileType help,make match BadSpacing / *$/
augroup END
-" Highlight search terms.
-set hlsearch
-
" Search as you type.
set incsearch
" Line wrapping off
set nowrap
-" Enlarge history and undo/redo buffers
+" Enlarge history and undo/redo buffers.
set history=1000
set undolevels=1000
" Set the color scheme to desert.
colorscheme desert
+" Set custom whitespace display
+set list
+set showbreak=↪\
+set listchars=tab:\ \ →,eol:↲,nbsp:␣,trail:•,extends:⟩,precedes:⟨
+
" Unmap the arrow keys to prevent bad habits.
noremap <Up> ""
noremap! <Up> <Esc>
noremap <Right> ""
noremap! <Right> <Esc>
-
+" Automatically reload the .vimrc when changes are made to it
+au! BufWritePost .vimrc source %