-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
289 lines (250 loc) · 8.63 KB
/
.vimrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
"#Mon Nov 18 12:14:03 GMT 2008 - Joseph Ward <[email protected]>
"------------------------------------------------------------------------------
" Standard stuff.
"------------------------------------------------------------------------------
"My added stuff
"set spell "set spellchecking on
scriptencoding utf-8
set encoding=utf-8
"normal stuff
set nocompatible " Disable vi compatibility.
set nobackup " Do not keep a backup file.
set history=100 " Number of lines of command line history.
set undolevels=200 " Number of undo levels.
set nowrap " Don't wrap words by default.
set showcmd " Show (partial) command in status line.
set showmatch " Show matching brackets.
set showmode " Show current mode.
set ruler " Show the line and column numbers of the cursor.
set ignorecase " Case insensitive matching.
set incsearch " Incremental search.
set smartcase " ignores case unless caps used.
"set autoindent " I indent my code myself.
"set cindent " I indent my code myself.
set scrolloff=5 " Keep a context when scrolling.
set noerrorbells " No beeps.
" set nomodeline " Disable modeline.
set modeline " Enable modeline.
set esckeys " Cursor keys in insert mode.
set gdefault " Use 'g' flag by default with :s/foo/bar/.
set magic " Use 'magic' patterns (extended regular expressions).
set tabstop=4 " Number of spaces <tab> counts for.
set ttyscroll=0 " Turn off scrolling (this is faster).
set ttyfast " We have a fast terminal connection.
set hlsearch " Highlight search matches.
" set encoding=utf-8 " Set default encoding to UTF-8.
" set showbreak=+ " Show a '+' if a line is longer than the screen.
" set laststatus=2 " When to show a statusline.
" set autowrite " Automatically save before :next, :make etc.
set mouse=a "Activates the mouse!
set nostartofline " Do not jump to first character with page commands,
" i.e., keep the cursor in the current column.
set viminfo='20,\"50 " Read/write a .viminfo file, don't store more than
" 50 lines of registers.
set number
" Allow backspacing over everything in insert mode.
set backspace=indent,eol,start
" Tell vim which characters to show for expanded TABs,
" trailing whitespace, and end-of-lines. VERY useful!
set listchars=tab:>-,trail:·,eol:$
" Path/file expansion in colon-mode.
set wildmode=list:longest
set wildchar=<TAB>
" Enable syntax-highlighting.
if has("syntax")
syntax on
endif
" Use brighter colors if your xterm has a dark background.
if &term =~ "xterm"
set background=light
endif
"------------------------------------------------------------------------------
" Function keys.
"------------------------------------------------------------------------------
" Function for toggling search highlighting
function! ToggleHLSearch()
if &hls
set nohls
else
set hls
endif
endfunction
" F2: Toggle list (display unprintable characters).
nnoremap <F2> :set list!<CR>
" F3: Toggle expansion of tabs to spaces.
nmap <F3> :call ToggleHLSearch()<CR>
" F4: Write a ChangeLog entry.
map <F4> :r !date<CR>A - Joseph Ward <[email protected]><CR><CR> |
" F5: Insert current date.
map <F5> :r !date<CR>
"------------------------------------------------------------------------------
" Correct typos.
"------------------------------------------------------------------------------
" English.
iab beacuse because
iab becuase because
iab acn can
iab cna can
iab centre center
iab chnage change
iab chnages changes
iab chnaged changed
iab chnagelog changelog
iab Chnage Change
iab Chnages Changes
iab ChnageLog ChangeLog
iab debain debian
iab Debain Debian
iab defualt default
iab Defualt Default
iab differnt different
iab diffrent different
iab emial email
iab Emial Email
iab figth fight
iab figther fighter
iab fro for
iab fucntion function
iab ahve have
iab homepgae homepage
iab logifle logfile
iab lokk look
iab lokking looking
iab mial mail
iab Mial Mail
iab miantainer maintainer
iab amke make
iab mroe more
iab nwe new
iab recieve receive
iab recieved received
iab erturn return
iab retrun return
iab retunr return
iab seperate separate
iab shoudl should
iab soem some
iab taht that
iab thta that
iab teh the
iab tehy they
iab truely truly
iab waht what
iab wiht with
iab whic which
iab whihc which
iab yuo you
iab databse database
iab versnio version
iab obnsolete obsolete
iab flase false
iab recrusive recursive
iab Recrusive Recursive
" Days of week.
iab monday Monday
iab tuesday Tuesday
iab wednesday Wednesday
iab thursday Thursday
iab friday Friday
iab saturday Saturday
iab sunday Sunday
" Enable this if you mistype :w as :W or :q as :Q.
nmap :W :w
nmap :Q :q
" makes g and j use visual lines not linebreaks
nnoremap j gj
nnoremap k gk
"------------------------------------------------------------------------------
" Abbreviations.
"------------------------------------------------------------------------------
" Quit with 'q' instead of ':q'. VERY useful!
map q :q<CR>
map :Q :q
"------------------------------------------------------------------------------
" File-type specific settings.
"------------------------------------------------------------------------------
if has("autocmd")
" Enabled file type detection and file-type specific plugins.
" filetype plugin on indent
filetype plugin on
" Drupal *.module and *.engine files.
augroup module
autocmd BufRead *.module,*.engine set filetype=php
augroup END
" Python code.
augroup python
autocmd BufReadPre,FileReadPre *.py set tabstop=4
autocmd BufReadPre,FileReadPre *.py set expandtab
augroup END
" Ruby code.
augroup ruby
autocmd BufReadPre,FileReadPre *.rb set tabstop=2
autocmd BufReadPre,FileReadPre *.rb set expandtab
augroup END
" PHP code.
augroup php
autocmd BufReadPre,FileReadPre *.php set tabstop=4
autocmd BufReadPre,FileReadPre *.php set expandtab
augroup END
" Java code.
augroup java
autocmd BufReadPre,FileReadPre *.java set tabstop=4
autocmd BufReadPre,FileReadPre *.java set expandtab
augroup END
" ANT build.xml files.
augroup xml
autocmd BufReadPre,FileReadPre build.xml set tabstop=4
augroup END
" (J)Flex files.
augroup lex
" autocmd BufRead,BufNewFile *.flex,*.jflex set filetype=lex
autocmd BufRead,BufNewFile *.flex,*.jflex set filetype=jflex
augroup END
" (Nu)SMV files.
augroup smv
autocmd BufRead,BufNewFile *.smv set filetype=smv
augroup END
"latex
augroup tex
autocmd BufRead,BufNewFile *.tex set spell
autocmd BufRead,BufNewFile *.tex set wrap
autocmd BufRead,BufNewFile *.tex set linebreak
augroup END
endif
"------------------------------------------------------------------------------
" Debian specific options.
"------------------------------------------------------------------------------
" We know xterm-debian is a color terminal.
if &term =~ "xterm-debian" || &term =~ "xterm-xfree86"
set t_Co=16
set t_Sfet t_Sb=
rary reportbug files.
augroup filetype
au BufRead reportbug.* set ft=mail
au BufRead reportbug-* set ft=mail
augroup END
" Helpfile.
" set helpfile=$VIMRUNTIME/doc/help.txt
"------------------------------------------------------------------------------
" Local settings.
"------------------------------------------------------------------------------
" Source a local configuration file if available.
if filereadable(expand("~/.vimrc.local"))
source ~/.vimrc.local
endif
" REQUIRED. This makes vim invoke Latex-Suite when you open a tex file.
filetype plugin on
" IMPORTANT: win32 users will need to have 'shellslash' set so that latex
" can be called correctly.
set shellslash
" IMPORTANT: grep will sometimes skip displaying the file name if you
" search in a singe file. This will confuse Latex-Suite. Set your grep
" program to always generate a file-name.
set grepprg=grep\ -nH\ $*
" OPTIONAL: This enables automatic indentation as you type.
filetype indent on
" OPTIONAL: Starting with Vim 7, the filetype of empty .tex files defaults to
" 'plaintex' instead of 'tex', which results in vim-latex not being loaded.
" The following changes the default filetype back to 'tex':
let g:tex_flavor='latex'
endif