-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc.txt
191 lines (156 loc) · 5.15 KB
/
vimrc.txt
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
" Do it before syntax activation
aunmenu Help
aunmenu Window
let no_buffers_menu=1
set mousemodel=popup
set nocompatible
set smartcase
syntax off
filetype off
if has("win32")
source $HOME/vimfiles/Plugfile.vim
set directory=~/vimfiles/swap
set backupdir=~/vimfiles/backup
set fileencodings=utf-8,ucs-bom,cp852
else
source $HOME/.vim/Plugfile.vim
set directory=~/.vim/swap
set backupdir=~/.vim/backup
endif
syntax on
filetype indent plugin on
set backup
set modeline
set smartindent
set tabstop=4
set shiftwidth=4
set expandtab
" LustyExplorer needs this
set hidden
fixdel
set foldmethod=marker
if has("mac")
set backspace=indent,eol,start
endif
colorscheme twilight256
set ttyfast
" Better modes. Remeber where we are, support yankring
set viminfo=!,'100,\"100,:20,<50,s10,h,n~/.viminfo
" Remember cursor position
au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
" The PC is fast enough, do syntax highlight syncing from start
autocmd BufEnter * :syntax sync fromstart
au FileType markdown setlocal nospell spelllang=hu wrapmargin=80 colorcolumn=80
au FileType php,c,c++,java set formatprg=~/.vim/bin/astyle-wrapper
augroup Ruby
au!
au FileType ruby set ts=2 sw=2 et
au FileType yaml set ts=2 sw=2 et
au FileType Gemfile set ts=2 sw=2 et
au FileType eruby set ts=4 sw=4 et
au FileType ruby,eruby set omnifunc=rubycomplete#Complete
au FileType ruby,eruby let g:rubycomplete_buffer_loading = 1
au FileType ruby,eruby let g:rubycomplete_rails = 1
au FileType yaml set ts=2 sw=2 et
au FileType cucumber setlocal makeprg=rake\ cucumber\ FEATURE=\"%:p\"
autocmd BufRead,BufNewFile *.html.erb set ts=4 sw=4
au BufRead,BufNewFile Capfile set ft=ruby
au BufRead,BufNewFile Gemfile* set ft=Gemfile
au BufRead,BufNewFile Guardfile* set ft=Guardfile
au BufRead,BufNewFile .rspec set ft=eruby
au BufRead,BufNewFile .simplecov set ft=ruby
au BufRead,BufNewFile *.html.arb set ft=ruby
au BufRead,BufNewFile .rvmrc,rvmrc set ft=sh
augroup END
augroup XML
au!
au FileType xsd set ts=2 sw=2 et
au FileType html,xml,xhtml set ts=4 sw=4 et
augroup END
augroup Bash
au!
au FileType sh set ts=2 sw=2 et
augroup END
augroup PHP
" Drupal file types
autocmd FileType php set ts=2 sw=2 et
autocmd BufRead,BufNewFile *.module set filetype=php
autocmd BufRead,BufNewFile *.install set filetype=php
autocmd BufRead,BufNewFile *.test set filetype=php
autocmd BufRead,BufNewFile *.tpl.php set filetype=php
augroup END
augroup Python
au BufRead,BufNewFile *.psp set filetype=psp
au Filetype psp set ts=4 sw=4 et
au FileType python set omnifunc=pythoncomplete#Complete
augroup END
augroup Groovy
au BufRead,BufNewFile *.gy set filetype=groovy
au BufRead,BufNewFile *.gvy set filetype=groovy
augroup END
au BufRead,BufNewFile *.changes.vctmp.* set ft=changes
if has('unix')
function! SKEL_spec()
0r $HOME/.vim/skeleton.spec
language time en_US
if $USER != ''
let login = $USER
elseif $LOGNAME != ''
let login = $LOGNAME
else
let login = 'unknown'
endif
let newline = stridx(login, "\n")
if newline != -1
let login = strpart(login, 0, newline)
endif
if $HOSTNAME != ''
let hostname = $HOSTNAME
else
let hostname = system('hostname -f')
if v:shell_error
let hostname = 'localhost'
endif
endif
let newline = stridx(hostname, "\n")
if newline != -1
let hostname = strpart(hostname, 0, newline)
endif
"exe "%s/specRPM_CREATION_DATE/" . strftime("%a\ %b\ %d\ %Y") . "/ge"
"exe "%s/specRPM_CREATION_AUTHOR_MAIL/" . login . "@" . hostname . "/ge"
exe "%s/specRPM_CREATION_NAME/" . expand("%:t:r") . "/ge"
exe "%s/specCURRENT_YEAR/" . strftime("%Y") . "/ge"
setf spec
endfunction
autocmd BufNewFile *.spec call SKEL_spec()
endif
"autocmd BufWinLeave * mkview
"autocmd BufWinEnter * silent loadview
autocmd FileType yaml set ts=2 sw=2
" i'm lame :)
cab W w
cab Wq wq
cab wQ wq
cab WQ wq
cab Q q
" sudo make sandwich!
cmap W! w !sudo tee % >/dev/null
:nmap <F1> <nop>
:imap <F1> <nop>
" C-space for NetBeans-like completion
inoremap <expr> <C-Space> pumvisible() \|\| &omnifunc == '' ?
\ "\<lt>C-n>" :
\ "\<lt>C-x>\<lt>C-o><c-r>=pumvisible() ?" .
\ "\"\\<lt>c-n>\\<lt>c-p>\\<lt>c-n>\" :" .
\ "\" \\<lt>bs>\\<lt>C-n>\"\<CR>"
imap <C-@> <C-Space>
"let &stl='--<%02n> %1*%t%* %3*%M%*[%(%R%W%Y%),%{&fenc}:%{&ff}] %2*%{mode()}%* %4*%k%* %= 0x%B at %1*%l%*/%L:%c%V --'
let &stl='--<%02n> %{pathshorten(expand("%:P"))}%* %3*%M%*[%(%R%W%Y%),%{&fenc}:%{&ff}] %2*%{mode()}%* %{&paste ? "[PASTE]" : ""} %4*%k%* %= 0x%B at %1*%l%*/%L:%c%V --'
set laststatus=2 " Always a status line
if !has("gui")
highlight User1 ctermfg=196 ctermbg=220 cterm=bolditalicreverseunderline
endif
let g:syntastic_auto_loc_list=1
let g:syntastic_mode_map = { 'mode': 'active',
\ 'passive_filetypes': ['sass', 'scss'] }
let g:LustyJugglerSuppressRubyWarning = 1