Added and then removed some vim plugins
[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 " Allow folding.
22 set foldenable
23 set foldmethod=syntax
24 set foldlevelstart=99
25
26 " Show line numbers.
27 set number
28 set numberwidth=4
29
30 " Scroll five lines ahead of cursor.
31 set scrolloff=5
32
33 " Turn off error bells and visual bell
34 set noeb vb t_vb=
35
36 " Set up autoindentation.
37 set smartindent
38 filetype indent on
39
40 " Set tabs to width 4.
41 set softtabstop=4
42 set tabstop=4
43 set shiftwidth=4
44 set expandtab
45
46 " Allow backspacing over everything in insert mode.
47 set backspace=indent,eol,start
48
49 "Highlight bad spacing.
50 highlight BadSpacing term=standout ctermbg=cyan
51 augroup Spacing
52     autocmd!
53     " Highlight tabulators and trailing spaces
54     autocmd BufNewFile,BufReadPre * match BadSpacing /\(\t\|  *$\)/
55     " Only highlight trailing space in tab-filled formats
56     autocmd FileType help,make match BadSpacing /  *$/
57 augroup END
58
59 " Highlight search terms.
60 set hlsearch
61
62 " Search as you type.
63 set incsearch
64
65 " Display command and location status.
66 set ruler
67 set showcmd
68
69 " Multiple windows are equally sized and open in reading order.
70 set equalalways
71 set splitbelow splitright
72
73 " Line wrapping off
74 set nowrap
75
76 " Enlarge history and undo/redo buffers.
77 set history=1000
78 set undolevels=1000
79
80 " Reset colors to a clean state.
81 if !has('gui_running')
82     set t_Co=8 t_md=
83 endif
84
85 " Enable syntax highlighting.
86 syntax enable
87
88 " Force vim to sync syntax highlighting from the beginning of the file.
89 syn sync fromstart
90
91 " Set the color scheme to desert.
92 colorscheme desert
93
94 " Unmap the arrow keys to prevent bad habits.
95 noremap  <Up> ""
96 noremap! <Up> <Esc>
97 noremap  <Down> ""
98 noremap! <Down> <Esc>
99 noremap  <Left> ""
100 noremap! <Left> <Esc>
101 noremap  <Right> ""
102 noremap! <Right> <Esc>
103
104 " Map open and close items in insert mode.
105 " Keep this commented out until I can get it working better.
106 "inoremap { {<CR>}<Esc>O
107 "inoremap [ []<Esc>i
108 "inoremap ( ()<Esc>i
109 "inoremap } <Esc>/}<CR>o
110 "inoremap ] <Esc>/]<CR>a
111 "inoremap ) <Esc>/)<CR>a
112
113 " Automatically reload the .vimrc when changes are made to it
114 au! BufWritePost .vimrc source %