forked from argent-smith/dotvim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc.vim
204 lines (156 loc) · 5.24 KB
/
vimrc.vim
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
set nocompatible
set clipboard+=unnamed
set paste
let mapleader=","
source $VIMRUNTIME/vimrc_example.vim
set hlsearch
set incsearch
set t_Co=256
set ts=2
set sw=2
set et
filetype off
call pathogen#helptags()
call pathogen#runtime_append_all_bundles()
"set background=dark
"colorscheme solarized
"colorscheme vividchalk
colorscheme ir_black
set ignorecase
syntax on
set backspace=indent,eol,start
set noswapfile
"set backupdir=~/.vim/backup
set nobackup
set nowritebackup
if has("folding")
set foldenable
set foldmethod=syntax
set foldlevel=5
" set foldnestmax=2
set foldtext=strpart(getline(v:foldstart),0,50).'\ ...\ '.substitute(getline(v:foldend),'^[\ #]*','','g').'\ '
highlight Folded guifg=#FFFFFF
endif
autocmd BufRead *.xml,*.aspx,*.htm,*.html,*.config,*.ascx set ts=2 sw=2 ft=xml
autocmd BufRead *.php set ts=2 sw=2
autocmd BufRead *.sql set ts=4 sw=4
autocmd BufRead *.rjs,*.rxml set ts=2 sw=2 ft=ruby
autocmd BufRead *.tt set ts=2 sw=2 ft=eruby
autocmd BufRead Vagrantfile set ts=2 sw=2 ft=ruby expandtab
autocmd BufRead *.rb set expandtab
autocmd BufRead *.cs set ts=4 sw=4
autocmd User Rails/config/locales/*.yml set ai
autocmd User Rails.javascript* set expandtab ts=4 sw=4 sts=4
autocmd User Rails/*.coffee set expandtab ts=2 sw=2 sts=2
autocmd User Rails/*.haml set foldmethod=indent
autocmd BufRead *.erl,*.hrl set expandtab ts=4 sw=4
autocmd FileType ruby set expandtab
autocmd FileType eruby set expandtab
autocmd FileType vim set expandtab ts=2 sw=2 sts=2
autocmd FileType markdown set expandtab ts=2 sw=2 sts=2
autocmd FileType cucumber set expandtab ts=2 sw=2 sts=2
autocmd FileType php set expandtab ts=2 sw=2 sts=2
autocmd FileType rpsl set expandtab ts=2 sw=2 sts=2
set wildmenu
set wildmode=list:longest
set wcm=<Tab>
" added by AV
filetype plugin on
filetype plugin indent on
""""
set viminfo='20,<50,s10,h,rA:,rB:
set autowriteall
set autowrite
set statusline=%<%f\ %h%m%r%{fugitive#statusline()}%=%-14.(%l,%c%V%)\ %P
set guitablabel=%-200.400f
" avoid hit enter stupud messages
set cmdheight=2
" show status always
set laststatus=2
let g:rails_dbext=0
let g:omni_sql_no_default_maps=1
let NERDTreeWinSize=50
nmap <F2> :NERDTreeToggle <CR>
let Tlist_WinWidth = 50
nmap <F3> :TlistToggle <CR>
" set grepprg=grep\ $*\ *\ -n\ -r\ --exclude=*.log\ --exclude=tags
" let g:git_diff_spawn_mode = 2
" trailing whitspaces
:highlight ExtraWhitespace ctermbg=red guibg=red
:autocmd BufWinEnter *.rb,*.js,*.haml,*.html match ExtraWhitespace /\s\+$/
set tw=78
"set list listchars=tab:▸·,trail:·,eol:¬
set nolist
highlight SpecialKey guifg=#333333 ctermfg=DarkGray
"language C
" let g:git_no_map_default = 0
set tags=./tags,tags,/home/brun/.vim/tags
let g:rsenseHome="$RSENSE_HOME"
" ruby.vim configuration
compiler ruby
let g:rubycomplete_buffer_loading = 1
let g:rubycomplete_classes_in_global = 1
let g:rubycomplete_rails = 1
" unimpaired plugin need for text bubbling
vmap <C-j> ]egv
vmap <C-k> [egv
vmap <C-l> >gv
vmap <C-h> <gv
" Source the vimrc file after saving it
if has("autocmd")
autocmd bufwritepost .vimrc source $MYVIMRC
autocmd bufwritepost vimrc_brun.vim source $MYVIMRC
endif
nmap <Leader>a :FufCoverageFile<CR>
let g:fuf_maxMenuWidth = 140
command Irb :ConqueTermSplit irb
map <silent> <F4> :call BufferList()<CR>
let g:BufferListWidth = 25
let g:BufferListMaxWidth = 50
let g:Gitv_OpenHorizontal = 1
let g:rails_ctags_arguments="--exclude=log --exclude=tmp --exclude=www --exclude=public"
let ruby_no_expensive = 1
" The following is used when vim ai an e-mail editor for use in Russia (I've
" inherited it from some famous Vim hacker...)
" Hайти все последовательности цитирования в письме и составить из них опцию
" comments для удобства форматирования
function! SetQuoteComments () range abort
let word char = '[A-Za-zёЁю-Ъ]' " Sorry, for koi8-r
let &comments = "n:>"
let start line = a:firstline
let end line = a:lastline
let current line = start line
while current line <= end line
let test string = getline(current line)
let maxlen = strlen(test string)
let match end pos = matchend(test string,'^[\t>]*'.wordchar.'\{1,5}>')
while match end pos > 0
let prefix = matchstr(test string,word char.'\{1,5}>')
let test string = strpart(test string,match endpos,maxlen)
let match end pos = matchend(test string,'^[\s>]*'.wordchar.'\{1,5}>')
if match(&comments,':'.prefix.'\($\|,\)') < 0
let &comments = &comments.',n:'.prefix
endif
endwhile
let current line = current line + 1
endwhile
endfunction
" au BufNewFile,BufRead <тут варианты почты> %call SetQuoteComments()
" (на самом деле у меня вызов чуть более навороченный:
" Опции, локальные для буфера, передёргиваем при загрузке или создании буфера
if &filetype == "mail" || &filetype == "news"
%call SetQuoteComments()
set tw=78
endif
" Turn off the toolbar
set go-=T
" Line numbering makes the thing quite stylish
set nu
" Line wrap and visual bell
set wrap
set visualbell
set ai
" Syntastic statusline
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*