Adding in some bash-style tab completion.
[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 " Set up autoindentation.
29 set smartindent
30 filetype indent on
31
32 " Set tabs to width 4.
33 set softtabstop=4
34 set tabstop=4
35 set shiftwidth=4
36 set expandtab
37
38 " Allow backspacing over everything in insert mode.
39 set backspace=indent,eol,start
40
41 "Highlight bad spacing.
42 highlight BadSpacing term=standout ctermbg=cyan
43 augroup Spacing
44     autocmd!
45     " Highlight tabulators and trailing spaces
46     autocmd BufNewFile,BufReadPre * match BadSpacing /\(\t\|  *$\)/
47     " Only highlight trailing space in tab-filled formats
48     autocmd FileType help,make match BadSpacing /  *$/
49 augroup END
50
51 " Highlight search terms.
52 set hlsearch
53
54 " Search as you type.
55 set incsearch
56
57 " Display command and location status.
58 set ruler
59 set showcmd
60
61 " Multiple windows are equally sized and open in reading order.
62 set equalalways
63 set splitbelow splitright
64
65 " Line wrapping off
66 set nowrap
67
68 " Enlarge history and undo/redo buffers.
69 set history=1000
70 set undolevels=1000
71
72 " Reset colors to a clean state.
73 if !has('gui_running')
74     set t_Co=8 t_md=
75 endif
76
77 " Enable syntax highlighting.
78 syntax enable
79
80 " Force vim to sync syntax highlighting from the beginning of the file.
81 syn sync fromstart
82
83 " Set the color scheme to desert.
84 colorscheme desert
85
86 " Unmap the arrow keys to prevent bad habits.
87 noremap  <Up> ""
88 noremap! <Up> <Esc>
89 noremap  <Down> ""
90 noremap! <Down> <Esc>
91 noremap  <Left> ""
92 noremap! <Left> <Esc>
93 noremap  <Right> ""
94 noremap! <Right> <Esc>
95
96