forked from vicalejuri/startervim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc
245 lines (200 loc) · 5.33 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
" Configure vim to suck less
" Author: ZeusTheTrueGod
"
filetype off
call pathogen#runtime_append_all_bundles()
" Fix vim defaults
set nocompatible
set lazyredraw
set ttyfast
set backspace=indent,eol,start " backspace works as expected
set nostartofline " Make j/k respect the columns (after all, this is not a freaking typewriter)
set modeline " Respect modeline of the file (the famous "vi:noai:sw=3 ts=6" on the beginning of the files)
set hidden " Avoid asking to save before hiding
set enc=utf-8
set nospell "I hate that stupid spell checking, it sucks, really!!!"
filetype on
filetype plugin on
filetype indent on
syntax on
" Basic UI
set novisualbell
set shm=atIWswxrnmlf
set ruler
set title
set titlestring=%f%(\ [%M]%) " Show file name at the title
set numberwidth=1
set report=2
set laststatus=2
set statusline=%f
set showcmd
set showmode
set nu
"
" Bend vim features and behaviors to our wishes.
"
"
" Command-mode completion
"
set wildmenu
set wildignore=*.o,*.obj,*.pyc,*.swc,*.DS_STORE,*.bkp
set wildmode=list:longest
" Insert-mode completion
set complete=.,w,b,u,U,t,i,d
" Scrolling
set scroll=5
set scrolloff=5
set sidescrolloff=5
set sidescroll=1
" Matching
set showmatch
set matchpairs=(:),{:},[:],<:>
" Search and replace
set gdefault " Make regexp matches everything, instead of just the first one
set incsearch " Search all instances
set hlsearch " Highlight matched regexp
set ignorecase
set smartcase " Intelligent case-smart searching
"
" Indentation
"
set autoindent
set smartindent
set smarttab
set expandtab
set shiftround
set nojoinspaces
set nofoldenable
set tabstop=4
set softtabstop=4
set shiftwidth=4
"
" Autocomplete
"
set infercase
set completeopt=longest,menuone
set ofu=syntaxcomplete#Complete
"
" Soft/Hard Wrapping
"
set wrap
set textwidth=79
set formatoptions=qrn1
"
" History and backup
"
"set viminfo='10,:20,\"100,%,n~/.viminfo
set history=1000
set nobackup
set nowritebackup
set noswapfile
"
" Grep
"
set grepprg=ack
set grepformat=%f:%l:%m
" Enable vim-bundles
" Helper command to update bundles
function! s:UpdateBundles()
exec '!ruby ~/.vim/bin/vim-update-bundles.rb'
endfunction
command! -nargs=? UpdateBundles call s:UpdateBundles()
"Colorscheme
" --- BUNDLE: https://github.com/godlygeek/csapprox.git
let g:CSApprox_attr_map = { 'bold' : 'bold', 'italic' : '', 'sp' : '' }
colorscheme zenesque
" Syntastic
" --- BUNDLE: http://github.com/scrooloose/syntastic.git
let g:syntastic_enable_signs=1
let g:syntastic_auto_loc_list=1
let g:syntastic_quiet_warnings=0
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
" Nerd Tree
" --- BUNDLE: git://github.com/scrooloose/nerdtree.git
"
" Nerd Commenter
" --- BUNDLE: http://github.com/scrooloose/nerdcommenter.git
" Lusty explorer
" --- BUNDLE: git://github.com/sjbach/lusty.git
" Less annoying delimiters - DelimitMate
" --- BUNDLE: http://github.com/Raimondi/delimitMate.git
let delimitMate_smart_quotes = 1
let delimitMate_visual_leader = ""
let delimitMate_autoclose = 1
" snipMate
" --- BUNDLE: http://github.com/msanders/snipmate.vim.git
" SuperTab
" --- BUNDLEDENY: http://github.com/ervandew/supertab.git
let g:SuperTabCrMapping = 0
"
" Matchit
" --- BUNDLE: http://github.com/edsono/vim-matchit.git
"
" vim-align
" --- BUNDLE: http://github.com/tsaleh/vim-align.git
"
" Vim-Fugitive
" --- BUNDLE: http://github.com/tpope/vim-fugitive.git
set statusline+=%{fugitive#statusline()}
"Buffer
" --- BUNDLE: http://github.com/vim-scripts/L9.git
"
"Buffer
" --- BUNDLE: http://github.com/vim-scripts/FuzzyFinder.git
"
"Buffer
" --- BUNDLE: http://github.com/vim-ruby/vim-ruby.git
"
"
"Buffer
" --- BUNDLE: http://github.com/vim-scripts/Specky.git
""
let g:speckyBannerKey = "<LEADER>sb"
let g:speckyQuoteSwitherKey = "<LEADER>s'"
let g:speckyRunRdocKey = "<LEADER>sr"
let g:speckySpecSwitcherKey = "<LEADER>sx"
let g:speckyRunSpecKey = "<LEADER>ss"
let g:speckyRunSpecCmd = "bundle exec rspec "
let g:speckyRunRdocCmd = "bundle exec ri"
let g:speckyWindowType = 2
"Javascript lint
" --- BUNDLEX: http://github.com/hallettj/jslint.vim.git
"Javascript indentation
" --- BUNDLE: https://github.com/pangloss/vim-javascript.git
"Javascript format
" --- BUNDLE: https://github.com/ZeusTheTrueGod/vim-format-js.git
"Colorscheme
" --- BUNDLE: https://github.com/vim-scripts/zenesque.vim.git
"Cucumber integration
" --- BUNDLE: https://github.com/tpope/vim-cucumber.git
"
" commandT
" --- BUNDLE: https://github.com/wincent/Command-T.git
"
"
" --- BUNDLE: https://github.com/kchmck/vim-coffee-script.git
"
" --- BUNDLE: https://github.com/zeekay/vim-js2coffee.git
"
" Filetypes
"
source ~/.vimrc-keymaps
if has("autocmd")
" Save on focusLost
autocmd FocusLost * :wa
" Recognize
autocmd BufRead,BufNewFile *.json set filetype=json
autocmd BufRead,BufNewFile *._js set filetype=javascript
autocmd BufRead,BufNewFile *.less set filetype=less
autocmd BufRead,BufNewFile *._coffee set filetype=coffee
autocmd FileType html setlocal ts=2 sts=2 sw=2 expandtab
autocmd FileType css setlocal ts=2 sts=2 sw=2 expandtab
autocmd FileType javascript setlocal ts=2 sts=2 sw=2 expandtab
autocmd FileType coffee setlocal ts=2 sts=2 sw=2 expandtab
autocmd FileType json setlocal ts=2 sts=2 sw=2 expandtab
endif
if filereadable("vimrc")
source vimrc
endif