Adding a global .gitignore.
[dotfiles] / .vimrc
1 " Don't imitate vi.
2 set nocompatible
3
4 " Make tab-completion work more like bash.
5 set wildmenu
6 set wildmode=list:full
7
8 " Ignore certain file extensions when tab-completing.
9 set wildignore=*.swp,*.bak,*.pyc,*.class,*.o,*.exe
10
11 " Set filetype stuff to on.
12 filetype on
13 filetype plugin on
14 filetype indent on
15
16 " Example filetype-specific setting:
17 " if has('autocmd')
18 "     autocmd filetype python set expandtab
19 " endif
20
21 " Show line numbers.
22 set number
23 set numberwidth=4
24
25 " Scroll five lines ahead of cursor.
26 set scrolloff=5
27
28 " Turn off error bells and visual bell
29 set noeb vb t_vb=
30
31 " Set up autoindentation.
32 set smartindent
33 filetype indent on
34
35 " Set tabs to width 4.
36 set softtabstop=4
37 set tabstop=4
38 set shiftwidth=4
39 set expandtab
40
41 " Allow backspacing over everything in insert mode.
42 set backspace=indent,eol,start
43
44 "Highlight bad spacing.
45 highlight BadSpacing term=standout ctermbg=cyan
46 augroup Spacing
47     autocmd!
48     " Highlight tabulators and trailing spaces
49     autocmd BufNewFile,BufReadPre * match BadSpacing /\(\t\|  *$\)/
50     " Only highlight trailing space in tab-filled formats
51     autocmd FileType help,make match BadSpacing /  *$/
52 augroup END
53
54 " Highlight search terms.
55 set hlsearch
56
57 " Search as you type.
58 set incsearch
59
60 " Display command and location status.
61 set ruler
62 set showcmd
63
64 " Multiple windows are equally sized and open in reading order.
65 set equalalways
66 set splitbelow splitright
67
68 " Line wrapping off
69 set nowrap
70
71 " Enlarge history and undo/redo buffers.
72 set history=1000
73 set undolevels=1000
74
75 " Reset colors to a clean state.
76 if !has('gui_running')
77     set t_Co=8 t_md=
78 endif
79
80 " Enable syntax highlighting.
81 syntax enable
82
83 " Force vim to sync syntax highlighting from the beginning of the file.
84 syn sync fromstart
85
86 " Set the color scheme to desert.
87 colorscheme desert
88
89 " Unmap the arrow keys to prevent bad habits.
90 noremap  <Up> ""
91 noremap! <Up> <Esc>
92 noremap  <Down> ""
93 noremap! <Down> <Esc>
94 noremap  <Left> ""
95 noremap! <Left> <Esc>
96 noremap  <Right> ""
97 noremap! <Right> <Esc>
98
99 " Automatically reload the .vimrc when changes are made to it
100 au! BufWritePost .vimrc source %