-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
310 lines (254 loc) · 7.53 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
" release autogroup in MyAutoCmd
augroup MyAutoCmd
autocmd!
augroup END
let g:vimproc#download_windows_dll = 1
if has('vim_starting')
if &compatible
set nocompatible
endif
" neobundleがなければ自動インストール
if !isdirectory(expand("~/.vim/dein/repos/github.com/Shougo/dein.vim"))
echo "installing dein ... "
:call system("mkdir -p ~/.vim/dein/repos/github.com/Shougo/dein.vim")
:call system("git clone https://github.com/Shougo/dein.vim.git ~/.vim/dein/repos/github.com/Shougo/dein.vim")
endif
set runtimepath+=~/.vim/dein/repos/github.com/Shougo/dein.vim
endif
" setting shell
if has('win64')
set shell=cmd
elseif has('unix')
set shell=bash\ -i
endif
call dein#begin(expand('~/.vim/dein'))
call dein#add('Shougo/dein.vim')
call dein#add('Shougo/vimproc.vim', {'build': 'make'})
call dein#add('Shougo/deoplete.nvim')
if !has('nvim')
let s:dein_home_dir = expand('~/.nvim/dein')
call dein#add('roxma/nvim-yarp')
call dein#add('roxma/vim-hug-neovim-rpc')
endif
let g:deoplete#enable_at_startup = 1
" Autocomplete for Javascript
call dein#add('wokalski/autocomplete-flow')
call dein#add('Shougo/neosnippet')
call dein#add('Shougo/neosnippet-snippets')
let g:neosnippet#enable_completed_snippet = 1
call dein#add('Shougo/denite.nvim')
" Pythonの補完
call dein#add('zchee/deoplete-jedi', {
\ "autoload" : {
\ "filetypes" : ['python']
\}})
let g:deoplete#sources#jedi#python_path='C:/Users/chikuwa/Anaconda36/python'
" Pythonの補完
" call dein#add('davidhalter/jedi-vim', {
" \ "autoload" : {
" \ "filetypes" : ['python']
" \}})
" TypeScript
call dein#add('leafgarland/typescript-vim')
" Trailing
call dein#add('bronson/vim-trailing-whitespace')
"爆速HTMLコーディング
call dein#add('mattn/emmet-vim')
" VimでProcessing書くためのやつ
call dein#add('sophacles/vim-processing')
" Pythonのpep8インデント
call dein#add('Vimjas/vim-python-pep8-indent', {
\ "autoload" : {
\ "filetypes" : ['python']
\}})
" かっこいい
call dein#add('vim-airline/vim-airline')
call dein#add('vim-airline/vim-airline-themes')
let g:airline_theme = 'dark'
" おしゃれカラースキーム
call dein#add('tomasr/molokai')
" おしゃれカラースキーム
call dein#add('cocopon/iceberg.vim')
" フォントサイズを簡単にかえる
call dein#add('vim-scripts/zoom.vim')
" GLSL
call dein#add('tikhomirov/vim-glsl')
" in your .vimrc (_vimrc for Windows)
autocmd! BufNewFile,BufRead *.vs,*.fs set ft=glsl
" Julia
call dein#add('JuliaEditorSupport/julia-vim')
let g:latex_to_unicode_auto = 1
" Stan
call dein#add('maverickg/stan.vim')
" Vue.js
call dein#add('posva/vim-vue')
" API Blueprint
call dein#add('kylef/apiblueprint.vim')
" " テンプレート管理
call dein#add('thinca/vim-template')
" テンプレートの場所を指定する
let g:template_basedir = '~/dotfiles/templates/'
let g:template_files = 'template.*'
let g:template_free_pattern = 'template'
" テンプレート中に含まれる特定文字列を置換する
autocmd MyAutoCmd User plugin-template-loaded call s:template_keywords()
function! s:template_keywords()
silent! %s/<+DATE+>/\=strftime('%c')/g
endfunction
" テンプレート中に含まれる'<+CURSOR+>'にカーソルを移動する
autocmd MyAutoCmd User plugin-template-loaded
\ if search('<+CURSOR+>')
\ | silent! execute 'normal! "_da>'
\ | endif
call dein#end()
" filetype別のプラグイン/インデントを有効にする
filetype plugin indent on
" ejs
au BufNewFile, BufRead *.ejs setlocal filetype=html
"エンコーディング指定
set encoding=utf-8
"標準でIMEをオフにする (起動時のデフォルトを全角入力にしない)
set iminsert=0
set imsearch=-1
"タブ幅の設定
set shiftwidth=4
set tabstop=4
"どこで改行するか
set whichwrap=b,s,h,l,<,>,[,]
"オートインデント
set autoindent
"行番号表示
set number
"括弧の対応をハイライトする
set showmatch
"シンタックス
syntax on
"タブを賢くする
set smarttab
"タブ文字を展開する
set expandtab
"backspaceの挙動を普通のエディタと同じにする
set backspace=start,eol,indent
"beep音を切る,画面フラッシュも消す
set vb t_vb=
"ファイルツリーに関する設定
"上に出てくる表示を消す
let g:netrw_banner = 0
"Treeview
let g:netrw_liststyle = 3
"左右分割を右側に開く
let g:netrw_altv = 1
"サイズを85%に
let g:netrw_winsize = 85
"Ctrl-vの矩形選択で,行末より後ろにカーソルを置ける
set virtualedit=block
"スクロール時の余白
set scrolloff=3
"バックアップ無し
set nobackup
"swpファイル無し
set noswapfile
"自動再読み込み
set autoread
"Undoファイルの場所を変更する
set undodir=~/.vim/undotmp
"正規表現をVery Magicに
nnoremap / /\v
" 改行とかタブとかを表示する
set list
set listchars=eol:$,tab:>\ ,trail:_,extends:<
" TABキーで対応ペアにジャンプする
nnoremap <Tab> %
vnoremap <Tab> %
" 折り返されたテキストの上でいい感じに動く
nnoremap j gj
nnoremap k gk
vnoremap j gj
vnoremap k gk
" Ctrl + hjklでウインドウを移動する
nnoremap <C-h> <C-w>h
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-l> <C-w>l
"Insertモード中でもhjklで移動する
inoremap <C-j> <Down>
inoremap <C-k> <Up>
inoremap <C-h> <Left>
inoremap <C-l> <Right>
" sは使わない
nnoremap s <Nop>
" Window自体の移動
nnoremap sj <C-w>J
nnoremap sk <C-w>K
nnoremap sh <C-w>H
nnoremap sl <C-w>L
nnoremap sr <C-w>L
" ^と$をSpace+hとSpace+lに割り当てる
noremap <Space>h ^
noremap <Space>l $
" カンマの後ろにスペースを入れる
inoremap , ,<Space>
" ファイルの情報を表示
nnoremap <C-g> 1<C-g>
" vを2回たたくと行末まで選択する
vnoremap v $h
"現在の時刻を入力する
inoremap <expr> <C-x>date strftime("%c")
" タブとウインドウ関連の設定
" 垂直分割
nnoremap ww :<C-u>vs<CR>
" 水平分割
nnoremap wh :<C-u>sp<CR>
" 新しいタブ
nnoremap tt :<C-u>tabnew<CR>
" 次のタブ
nnoremap tn gt
" 前のタブ
nnoremap tp gT
" 80文字目に線をいれる
set colorcolumn=80
" 印刷の設定
set printheader=%t\ Page\ %N\ (%{strftime('%c')})%=
set printoptions=wrap:y,number:y
set printfont=MigMix\ 1M:h12
command Hardcopy call Hardcopy()
function! Hardcopy()
let colors_save = g:colors_name
colorscheme default
hardcopy
execute 'colorscheme' colors_save
endfun
"タブをスペース展開しない
autocmd FileType tex,java,c,cs,cpp,h,hpp set noexpandtab
"Makefileではタブをスペース展開しない
autocmd FileType make set noexpandtab
" reStructuredTextではタブ幅を3文字にする
autocmd FileType rst set tabstop=3
autocmd FileType rst set shiftwidth=3
"全角スペースを表示する
highlight ZenkakuSpace cterm=underline ctermfg=lightblue guibg=darkgray
match ZenkakuSpace / /
"メニューを英語にする
source $VIMRUNTIME/delmenu.vim
"set langmenu=ja_jp.utf-8
set langmenu=none
source $VIMRUNTIME/menu.vim
if has("multi_lang")
language C
endif
" Windows以外の設定
if !has("win32")
colorscheme molokai
"アンダーラインを引く
set cursorline
highlight CursorLine gui=underline guifg=NONE guibg=NONE
"全角スペースを表示する
highlight ZenkakuSpace gui=underline guifg=lightblue guibg=darkgray
match ZenkakuSpace / /
endif
" molokai setting for bash on win
if &term == "xterm-256color"
colorscheme molokai
hi Comment ctermfg=102
hi Visual ctermbg=236
endif