-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.vimrc
More file actions
190 lines (146 loc) · 4.15 KB
/
.vimrc
File metadata and controls
190 lines (146 loc) · 4.15 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
"dein Scripts-----------------------------
if &compatible
set nocompatible " Be iMproved
endif
" Required:
set runtimepath+=~/.vim/dein/repos/github.com/Shougo/dein.vim
" Required:
if dein#load_state('~/.vim/dein')
call dein#begin('~/.vim/dein')
" Let dein manage dein
" Required:
call dein#add('~/.vim/dein/repos/github.com/Shougo/dein.vim')
call dein#add('Shougo/unite.vim')
call dein#add('Shougo/neocomplete.vim')
call dein#add('Shougo/neomru.vim')
call dein#add('Shougo/neoyank.vim')
call dein#add('tomasr/molokai')
" file
call dein#add('mechatroner/rainbow_csv')
" php
call dein#add('flyinshadow/php_localvarcheck.vim')
" Git
call dein#add('tpope/vim-fugitive')
call dein#add('airblade/vim-gitgutter')
" Required:
call dein#end()
call dein#save_state()
endif
" Required:
filetype plugin indent on
syntax enable
" If you want to install not installed plugins on startup.
"if dein#check_install()
" call dein#install()
"endif
"End dein Scripts-------------------------
"-----------------------------------------
" colorscheme & view
set t_Co=256
syntax on
colorscheme molokai
" 全角スペース・行末のスペース・タブの可視化
if has("syntax")
" PODバグ対策
syn sync fromstart
function! ActivateInvisibleIndicator()
syntax match InvisibleJISX0208Space " " display containedin=ALL
highlight InvisibleJISX0208Space term=underline ctermbg=Blue guibg=darkgray gui=underline
endfunction
augroup invisible
autocmd! invisible
autocmd BufNew,BufRead * call ActivateInvisibleIndicator()
augroup END
endif
set display=lastline
set pumheight=10
set showmatch
set matchtime=1
set number
"-----------------------------------------
" file
" complete
augroup vimrc
autocmd!
autocmd FileType javascript setl omnifunc=jscomplete#CompleteJS
autocmd FileType coffee setl omnifunc=jscomplete#CompleteJS
autocmd FileType html setl omnifunc=htmlcomplete#CompleteTags
autocmd FileType css setl omnifunc=csscomplete#CompleteCSS
autocmd FileType xml setl omnifunc=xmlcomplete#CompleteTags
augroup END
" encoding
set fileformats=unix,dos,mac
set encoding=utf-8
set fileencodings=utf-8,iso-2022-jp,sjis
" 日本語を含まない場合は fileencoding に encoding を使うようにする
if has('autocmd')
function! AU_ReCheck_FENC()
if &fileencoding =~# 'iso-2022-jp' && search("[^\x01-\x7e]", 'n') == 0
let &fileencoding=&encoding
endif
endfunction
autocmd BufReadPost * call AU_ReCheck_FENC()
endif
" □とか○の文字があってもカーソル位置がずれないようにする
set ambiwidth=double
" backup
set backup
set backupdir=~/.vim/backup
" undo
if has('persistent_undo')
set undodir=~/.vim/undo
set undofile
endif
" buffer
set hidden
" php
let g:php_baselib = 1
let g:php_htmlInStrings = 1
let g:php_noShortTags = 1
let g:php_sql_query = 1
let g:sql_type_default = 'pgsql'
"-----------------------------------------
" motion
" tab & indent
"set tabstop=4
"set shiftwidth=4
"set softtabstop=4
set expandtab
set autoindent
" cmd
set showcmd
" BS
set backspace=indent,eol,start
" search highlight
set hlsearch
nmap <Esc><Esc> :nohlsearch<CR><Esc>
" 検索後にジャンプした際に検索単語を画面中央に持ってくる
nnoremap n nzz
nnoremap N Nzz
nnoremap * *zz
nnoremap # #zz
nnoremap g* g*zz
nnoremap g# g#zz
" repeated indent
vnoremap <silent> > >gv
vnoremap <silent> < <gv
" vimgrep
autocmd QuickfixCmdPost vimgrep cw
" cursor
set cursorline
highlight CursorLine cterm=underline ctermfg=NONE ctermbg=NONE
"-----------------------------------------
" plugin
" neocomplecache
let g:neocomplcache_enable_at_startup = 1
let g:neocomplcache_enable_underbar_completion = 1
" unite
nnoremap <silent> ,b :<C-u>Unite buffer<CR>
nnoremap <silent> ,f :<C-u>UniteWithBufferDir -buffer-name=files file<CR>
nnoremap <silent> ,r :<C-u>Unite -buffer-name=register register<CR>
nnoremap <silent> ,m :<C-u>Unite file_mru<CR>
nnoremap <silent> ,a :<C-u>UniteWithBufferDir -buffer-name=files buffer file_mru bookmark file<CR>
nnoremap <silent> ,y :<C-u>Unite history/yank<CR>
" php_localvarcheck
let g:php_localvarcheck_enable = 1
let g:php_localvarcheck_global = 0