-
Notifications
You must be signed in to change notification settings - Fork 3
/
.vimrc
142 lines (118 loc) · 3.84 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
colors ir_black
" some common helpful settings "
set nomodeline
set nocompatible
set history=50
set wildmode=list:longest,full
set notitle
set number
set showmode
set showcmd
set ruler
" set ls=2
set incsearch
set ignorecase
set smartcase
set gdefault
set tabstop=4
set shiftwidth=4
set shiftround
set expandtab
set autoindent
set dictionary=/usr/share/dict/words
map <F7> :set complete+=k<CR>
map <S-F7> :set complete-=k<CR>
if &term == "xterm-color"
fixdel
endif
set bg=dark
"stop recording accidentally"
nmap q :
" normally don't automatically format `text' as it is typed, IE only do this "
" with comments, at 79 characters: "
set formatoptions-=t
set textwidth=0
filetype on
autocmd!
" in human-language files, automatically format everything at 72 chars: "
autocmd FileType mail,human set formatoptions+=t textwidth=72
autocmd FileType c,cpp,slang,java set cindent
autocmd FileType c set formatoptions+=ro
autocmd FileType perl,css set smartindent
autocmd FileType html set formatoptions+=tl
autocmd FileType html,css set noexpandtab tabstop=4
autocmd FileType make set noexpandtab shiftwidth=4
autocmd FileType sh set shiftwidth=4 tabstop=4
" when using list, keep tabs at their full width and display 'arrows': "
execute 'set listchars+=tab:' . nr2char(187) . nr2char(183)
" php helpfuls
" let php_sql_query = 1
let php_baselib = 1
let php_htmlInStrings = 1
let php_noShortTags = 1
let php_parent_error_close = 1
let php_parent_error_open = 1
let php_folding = 1
" Correct indentation after opening a phpdocblock and automatic * on every line "
set formatoptions=qroct
" Wrap visual selections with chars "
:vnoremap ( "zdi^V(<C-R>z)<ESC>
:vnoremap { "zdi^V{<C-R>z}<ESC>
:vnoremap [ "zdi^V[<C-R>z]<ESC>
:vnoremap ' "zdi'<C-R>z'<ESC>
:vnoremap " "zdi^V"<C-R>z^V"<ESC>
" Detect filetypes "
"if exists("did_load_filetypes") "
" finish "
"endif "
augroup filetypedetect
au! BufRead,BufNewFile *.pp setfiletype puppet
au! BufRead,BufNewFile *httpd*.conf setfiletype apache
au! BufRead,BufNewFile *inc setfiletype php
augroup END
" Nick wrote: Uncomment these lines to do syntax checking when you save "
augroup Programming
" clear auto commands for this group "
autocmd!
autocmd BufWritePost *.php !php -d display_errors=on -l <afile>
autocmd BufWritePost *.inc !php -d display_errors=on -l <afile>
autocmd BufWritePost *httpd*.conf !/etc/rc.d/init.d/httpd configtest
autocmd BufWritePost *.bash !bash -n <afile>
autocmd BufWritePost *.sh !bash -n <afile>
autocmd BufWritePost *.pl !perl -c <afile>
autocmd BufWritePost *.perl !perl -c <afile>
autocmd BufWritePost *.xml !xmllint --noout <afile>
autocmd BufWritePost *.xsl !xmllint --noout <afile>
autocmd BufWritePost *.js !~/jslint/jsl -conf ~/jslint/jsl.default.conf -nologo -nosummary -process <afile>
autocmd BufWritePost *.rb !ruby -c <afile>
autocmd BufWritePost *.pp !puppet --parseonly <afile>
augroup en
" Correct indentation after opening a phpdocblock and automatic * on every line"
set formatoptions=qroct
" * Keystrokes -- Formatting "
" have Q reformat the current paragraph (or selected text if there is any): "
nnoremap Q gqap
vnoremap Q gq
" have the usual indentation keystrokes still work in visual mode: "
vnoremap <C-T> >
vnoremap <C-D> <LT>
vmap <Tab> <C-T>
vmap <S-Tab> <C-D>
" have Y behave analogously to D and C rather than to dd and cc "
noremap Y y$
" * Keystrokes -- Insert Mode "
" allow <BkSpc> to delete line breaks, beyond the start of the current insertion, and over indentations: "
set backspace=eol,start,indent
" have <Tab> (and <Shift>+<Tab> where it works) change the level of indentation: "
" inoremap <Tab> <C-T>
" inoremap <S-Tab> <C-D>
" [<Ctrl>+V <Tab> still inserts an actual tab character.] "
" abbreviations / spelling errors "
abbreviate wierd weird
abbreviate restaraunt restaurant
iabbrev hse he/she
syntax on
if $VIM_CRONTAB == "true"
set nobackup
set nowritebackup
endif