-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
398 lines (340 loc) · 10.9 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
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
"init all settings
set all&
" init autocmd
autocmd!
set number
set tabstop=2
set autoindent
set smarttab
set expandtab
set shiftwidth=2
set nocompatible
set hlsearch
set incsearch
set cursorline
set foldmethod=manual
set tags=tags
set laststatus=2
set nobackup
set noswapfile
set backspace=indent,eol,start
set scrolloff=5
set iskeyword+=-
set ambiwidth=double
"colorscheme molokai
" colorscheme jellybeans
colorscheme hybrid
" colorscheme PaperColor
"colorscheme Tomorrow-Night
"colorscheme Tomorrow-Night-Eighties
"colorscheme Tomorrow-Night-Bright
set background=dark
" augroup source-vimrc
" autocmd!
" autocmd BufWritePost *vimrc source $MYVIMRC | set foldmethod=marker
" autocmd BufWritePost *gvimrc if has('gui_running') source $MYGVIMRC
" augroup END
"save undo
if has('persistent_undo')
set undodir=~/.vim/undo
set undofile
endif
"set cusor on last saved line
au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | exe "normal! g`\""
syntax off
filetype off
if has('vim_starting')
set runtimepath+=~/.vim/bundle/neobundle.vim
endif
call neobundle#begin(expand('~/.vim/bundle/'))
runtime macros/matchit.vim
augroup HighlightTrailingSpaces
autocmd!
autocmd VimEnter,WinEnter,ColorScheme * highlight TrailingSpaces term=underline guibg=Red ctermbg=Red
autocmd VimEnter,WinEnter * match TrailingSpaces /\s\+$/
augroup END
" originalrepos on github
NeoBundle 'Shougo/neobundle.vim'
NeoBundle 'tpope/vim-surround'
" NeoBundle "Townk/vim-autoclose"
NeoBundle 'tpope/vim-markdown'
NeoBundle 'tyru/open-browser.vim'
" NeoBundle 'digitaltoad/vim-jade'
NeoBundle 'hail2u/vim-css3-syntax'
" NeoBundle 'vim-scripts/matchparenpp'
NeoBundle 'tpope/vim-abolish'
NeoBundle 'ujihisa/neco-look'
NeoBundle 'tpope/vim-unimpaired'
NeoBundle 'tpope/vim-repeat'
NeoBundle 'tpope/vim-speeddating'
NeoBundle 'kana/vim-tabpagecd'
NeoBundle 'tomtom/tlib_vim'
NeoBundle 'MarcWeber/vim-addon-mw-utils'
NeoBundle "garbas/vim-snipmate"
NeoBundle 'KabbAmine/vCoolor.vim'
NeoBundle 'slim-template/vim-slim'
NeoBundle 'tomtom/tcomment_vim'
NeoBundle 'ap/vim-css-color'
cnoremap <C-p> <Up>
cnoremap <C-n> <Down>
cnoremap <C-f> <Right>
cnoremap <C-b> <Left>
cnoremap <C-e> <End>
cnoremap <C-a> <Home>
nnoremap j gj
nnoremap k gk
nnoremap gj j
nnoremap gk k
nnoremap Q :ccl<CR>
nnoremap <C-h> :noh<CR>
nnoremap <C-=> vii=<CR>
nnoremap <C-n> orequire 'pry';binding.pry<ESC>
nnoremap <C-\><C-\> ^i\| <ESC>
nnoremap <C-t>n :tabnew<ESC>
nnoremap <C-t>w :tabclose<ESC>
nnoremap <Leader>; A;<ESC>
nnoremap <Leader>, A,<ESC>
nnoremap <Space>[ ^<ESC>
nnoremap <Space>] $<ESC>
nnoremap <Space>c :echo @%<CR>
nnoremap <Space>f :GoFmt<ESC>
nnoremap <Space>i :GoImport<ESC>
noremap @t :call InsertTodo()<CR>
noremap @f :call InsertFixme()<CR>
noremap @s :call InsertUseStrict()<CR>
noremap <Leader>s :%s/\s\+$//ge<CR>
function! InsertTodo()
let l:module_name = '# TODO: '
execute ":normal i" . l:module_name
endfunction
function! InsertFixme()
let l:module_name = '# FIXME: '
execute ":normal i" . l:module_name
endfunction
function! InsertUseStrict()
let l:str = "'use strict';"
execute ":normal ggO" . l:str
endfunction
" NeoBundle 'scrooloose/syntastic'
" let g:syntastic_scss_checkers = []
" let g:syntastic_check_on_wq = 0
" CtrlP
NeoBundle "ctrlpvim/ctrlp.vim"
let g:ctrlp_cmd = 'CtrlPMRU'
let g:ctrlp_extensions = ['tag', 'mixed', 'line']
let g:ctrlp_clear_cache_on_exit = 0
let g:ctrlp_mruf_relative = 1
let g:ctrlp_max_files = 0
" let g:ctrlp_custom_ignore = {
" \ 'dir': '\v[\/](\.(git|hg|svn)|(tmp|vendor))$',
" \ 'file': '\v\.(png|jpg|xlsx|pdf)$',
" \ }
NeoBundle 'nixprime/cpsm'
let g:ctrlp_match_func = {'match': 'cpsm#CtrlPMatch'}
let g:ctrlp_user_command = 'find %s -type f'
NeoBundle 'thinca/vim-qfreplace'
nnoremap <Leader>Q :Qfreplace<ESC>
" NeoBundle 'Shougo/unite.vim'
" NeoBundle 'Shougo/neomru.vim'
" NeoBundle 'tsukkee/unite-tag'
" nnoremap [unite] <Nop>
" nmap <Space>u [unite]
" nnoremap <silent> [unite]b :<C-u>Unite buffer<CR>
" nnoremap <silent> [unite]f :<C-u>Unite file<CR>
" nnoremap <silent> [unite]u :<C-u>Unite file_mru<CR>
" nnoremap <silent> [unite]y :<C-u>Unite history/yank<CR>
" nnoremap <silent> [unite]s :<C-u>Unite source<CR>
" nnoremap <silent> [unite]t :<C-u>Unite tag<CR>
" let g:unite_source_history_yank_enable = 1
NeoBundle 'rking/ag.vim'
let g:ag_prg="ag --column"
NeoBundle 'tpope/vim-fugitive'
nnoremap <silent> ,gs :Gstatus<CR>
nnoremap <silent> ,gd :Gdiff<CR>
nnoremap <silent> ,gb :Gblame<CR>
nnoremap <silent> ,gpo :Gpush origin<CR>
nnoremap <silent> ,gco :Git checkout
NeoBundle 'Shougo/vimproc.vim' , {
\ 'build' : {
\ 'linux' : 'make'},
\}
NeoBundle 'airblade/vim-gitgutter'
let g:gitgutter_realtime = 0
nnoremap ,h :GitGutterLineHighlightsToggle<CR>
NeoBundle 'thinca/vim-quickrun'
let g:quickrun_config = {}
let g:quickrun_config['markdown'] = {
\ 'outputter': 'browser'
\ }
NeoBundle 'bling/vim-airline'
if !exists('g:airline_symbols')
let g:airline_symbols = {}
endif
let g:airline_left_sep = '▶'
let g:airline#extensions#branch#enabled = 1
let g:airline#extensions#syntastic#enabled = 1
NeoBundle 'scrooloose/nerdtree.git'
nmap <silent> <C-e> :NERDTreeToggle<CR>
vmap <silent> <C-e> <Esc>:NERDTreeToggle<CR>
omap <silent> <C-e> :NERDTreeToggle<CR>
imap <silent> <C-e> <Esc>:NERDTreeToggle<CR>
let g:NERDTreeIgnore=['\.clean$', '\.swp$', '\.bak$', '\~$']
let g:NERDTreeShowHidden=1
autocmd StdinReadPre * let s:std_in=1
" autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
NeoBundle "majutsushi/tagbar"
nmap <silent> ,t :TagbarToggle<CR>
let g:tagbar_type_ruby = {
\ 'kinds' : [
\ 'm:modules',
\ 'c:classes',
\ 'd:describes',
\ 'C:contexts',
\ 'f:methods',
\ 'F:singleton methods'
\ ]
\ }
" NeoBundle 'Shougo/neocomplete'
" let g:acp_enableAtStartup = 1
" let g:neocomplete#enable_at_startup = 1
" let g:neocomplete#disable_auto_complete = 0
" let g:neocomplete#enable_fuzzy_completion = 0
" let g:neocomplete#enable_smart_case = 1
" let g:neocomplete#manual_completion_start_length = 2
" let g:neocomplete#auto_completion_start_length = 2
" let g:neocomplete#sources#syntax#min_keyword_length = 2
" let g:neocomplete#max_list = 10
" let g:neocomplete#lock_buffer_name_pattern = '\*ku\*'
" inoremap <silent> <CR> <C-r>=<SID>my_cr_function()<CR>
" function! s:my_cr_function()
" return pumvisible() ? neocomplete#close_popup() : "\<CR>"
" endfunction
"
" inoremap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
" inoremap <expr><C-n> neocomplete#start_manual_complete()
"
" 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()
" if !exists('g:neocomplete#text_mode_filetypes')
" let g:neocomplete#text_mode_filetypes = {}
" endif
" let g:neocomplete#text_mode_filetypes = {
" \ 'markdown': 1,
" \ 'gitrebase': 1,
" \ 'gitcommit': 1,
" \ 'text': 1,
" \ 'help': 1,
" \ 'tex': 1,
" \ 'ruby': 1,
" \ 'javascript': 1,
" \ 'coffeescript': 1,
" \ 'css': 1,
" \ 'sass': 1
" \ }
"
" autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS
" autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags
" autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS
" NeoBundle 'Shougo/neosnippet'
" NeoBundle 'Shougo/neosnippet-snippets'
" NeoBundle 'honza/vim-snippets'
" let g:neosnippet#snippets_directory='~/.vim/bundle/vim-snippets/snippets'
" let g:neosnippet#enable_snipmate_compatibility = 1
" imap <C-k> <Plug>(neosnippet_expand_or_jump)
" smap <C-k> <Plug>(neosnippet_expand_or_jump)
" xmap <C-k> <Plug>(neosnippet_expand_target)
" NeoBundle 'Yggdroot/indentLine'
" let g:indentLine_color_term = 240
" let g:indentLine_char = '¦'
" " let g:indentLine_faster = 1
" let g:indentLine_fileTypeExclude = ['slim', 'haml', 'html']
" NeoBundle 'h1mesuke/vim-alignta'
" set ambiwidth=double
" xnoremap <silent> A :Alignta =>\=<CR>
" xnoremap <silent> a: :Alignta 01 :<CR>
" xmap <silent><expr> as mode() !=# 'v' ? ':Alignta \S\+'."\<CR>" : 'as'
" xnoremap al :Alignta<Space>
NeoBundle 'junegunn/vim-easy-align'
vmap <Enter> <Plug>(EasyAlign)
nmap ga <Plug>(EasyAlign)
NeoBundle 't9md/vim-quickhl'
nmap <Space>m <Plug>(quickhl-manual-this)
xmap <Space>m <Plug>(quickhl-manual-this)
nmap <Space>M <Plug>(quickhl-manual-reset)
xmap <Space>M <Plug>(quickhl-manual-reset)
" text object
NeoBundle 'kana/vim-textobj-user'
NeoBundle 'sgur/vim-textobj-parameter'
NeoBundle 'rhysd/vim-textobj-ruby'
NeoBundle 'kana/vim-textobj-indent'
" NeoBundle 'kana/vim-textobj-function'
NeoBundle 'osyo-manga/vim-textobj-multiblock'
NeoBundle 'deris/vim-textobj-enclosedsyntax'
" NeoBundle 'thinca/vim-textobj-function-javascript'
NeoBundle 'osyo-manga/vim-textobj-multitextobj'
NeoBundle 'lucapette/vim-textobj-underscore'
NeoBundle 'thinca/vim-textobj-between'
" map _ <Plug>(operator-replace)
omap ab <Plug>(textobj-multiblock-a)
omap ib <Plug>(textobj-multiblock-i)
xmap ab <Plug>(textobj-multiblock-a)
xmap ib <Plug>(textobj-multiblock-i)
let g:textobj_multitextobj_textobjects_i = [
\ "\<Plug>(textobj-enclosedsyntax-i)",
\ "\<Plug>(textobj-multiblock-i)",
\ "\<Plug>(textobj-function-i)",
\]
let g:textobj_multitextobj_textobjects_a = [
\ "\<Plug>(textobj-enclosedsyntax-a)",
\ "\<Plug>(textobj-multiblock-a)",
\ "\<Plug>(textobj-function-a)",
\]
omap amt <Plug>(textobj-multitextobj-a)
omap imt <Plug>(textobj-multitextobj-i)
vmap amt <Plug>(textobj-multitextobj-a)
omap iF <Plug>(textobj-function-i)
omap aF <Plug>(textobj-function-a)
vmap iF <Plug>(textobj-function-i)
vmap aF <Plug>(textobj-function-a)
NeoBundle 'elzr/vim-json'
let g:vim_json_syntax_conceal = 0
" ref
NeoBundle "thinca/vim-ref"
NeoBundle "yuku-t/vim-ref-ri"
"for ruby
NeoBundle "vim-scripts/ruby-matchit"
NeoBundle "tpope/vim-endwise"
NeoBundle 'AndrewRadev/switch.vim'
" NeoBundle 'ecomba/vim-ruby-refactoring'
nnoremap - :Switch<cr>
NeoBundle 'tpope/vim-rails'
""for javascript
NeoBundle 'jelera/vim-javascript-syntax'
NeoBundle 'myhere/vim-nodejs-complete'
autocmd FileType javascript setlocal omnifunc=nodejscomplete#CompleteJS
if !exists('g:neocomplcache_omni_functions')
let g:neocomplcache_omni_functions = {}
endif
let g:neocomplcache_omni_functions.javascript = 'nodejscomplete#CompleteJS'
let g:node_usejscomplete = 1
NeoBundle 'jiangmiao/simple-javascript-indenter'
let g:SimpleJsIndenter_BriefMode = 2
"for coffee
NeoBundle 'kchmck/vim-coffee-script'
au BufRead,BufNewFile,BufReadPre *.coffee set filetype=coffee
"for golang
NeoBundle 'fatih/vim-go'
NeoBundle 'vim-jp/vim-go-extra'
exe "set rtp+=".globpath($GOPATH, "src/github.com/nsf/gocode/vim")
au FileType go setlocal sw=4 ts=4 sts=4 noet
let g:go_fmt_command = "goimports"
""for php
" autocmd FileType php,ctp :set dictionary=~/.vim/dict/php.dict
call neobundle#end()
set encoding=utf-8
filetype plugin indent on " required!
filetype indent on
filetype on
syntax on