forked from evtuhovich/dotvim
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvimrc.vim
More file actions
246 lines (192 loc) · 6.53 KB
/
vimrc.vim
File metadata and controls
246 lines (192 loc) · 6.53 KB
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
set nocompatible
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#infect()
"set background=dark
"colorscheme solarized
"colorscheme railscasts
"colorscheme vividchalk
colors hybrid
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:¬
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 nowrap
set visualbell
set ai
" Syntastic statusline
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
" js
let javascript_enable_domhtmlcss = 1
let g:jsx_pragma_required = 0
" tagbar
nmap <leader>= :TagbarToggle<CR>
let g:tagbar_autofocus = 1
" ghc-mod
" Reload
map <silent> tu :call GHC_BrowseAll()<CR>
" Type Lookup
map <silent> tw :call GHC_ShowType(1)<CR>
" vim-slime
let g:slime_target = "tmux"
let g:slime_paste_file = tempname()
" neocomplete
let g:acp_enableAtStartup = 0
let g:neocomplete#enable_at_startup = 1
let g:neocomplete#enable_smart_case = 1
let g:neocomplete#sources#syntax#min_keyword_length = 3
let g:neocomplete#lock_buffer_name_pattern = '\*ku\*'
" Plugin key-mappings.
inoremap <expr><C-g> neocomplete#undo_completion()
inoremap <expr><C-l> neocomplete#complete_common_string()
" Recommended key-mappings.
" <CR>: close popup and save indent.
inoremap <silent> <CR> <C-r>=<SID>my_cr_function()<CR>
function! s:my_cr_function()
"return neocomplete#smart_close_popup() . "\<CR>"
" For no inserting <CR> key.
return pumvisible() ? neocomplete#close_popup() : "\<CR>"
endfunction
" <TAB>: completion.
inoremap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
" <C-h>, <BS>: close popup and delete backword char.
inoremap <expr><C-h> neocomplete#smart_close_popup()."\<C-h>"
inoremap <expr><BS> neocomplete#smart_close_popup()."\<C-h>"
inoremap <expr><C-y> neocomplete#close_popup()
inoremap <expr><C-e> neocomplete#cancel_popup()