-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc-local8.1
291 lines (233 loc) · 8.06 KB
/
.vimrc-local8.1
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
" vi互換モードを廃止
set nocompatible
" ステータスバーを常に表示
set laststatus=2
set ambiwidth=double
set expandtab " タブ入力を複数の空白入力に置き換える
set tabstop=2 " 画面上でタブ文字が占める幅
set shiftwidth=2 " 自動インデントでずれる幅
set softtabstop=2 " 連続した空白に対してタブキーやバックスペースキーでカーソルが動く幅
set autoindent " 改行時に前の行のインデントを継続する
set smartindent " 改行時に入力された行の末尾に合わせて次の行のインデントを増減する
set encoding=UTF-8
set showcmd
set wildmenu
set number
"set cursorline
syntax on
"インクリメンタルサーチを有効にする
set incsearch
" 大文字小文字を区別しない
set ignorecase
" 大文字を含んで検索したら大文字小文字を区別する
set smartcase
" 検索文字ハイライト
set hlsearch
""""""""""" insert mode
" backspace
set backspace=indent,eol,start
set dictionary=/usr/share/dict/words
" insertモードから抜ける
inoremap <silent> jj <ESC>
" 挿入モードでのカーソル移動
inoremap <C-j> <Down>
"inoremap <C-k> <Up>
"inoremap <C-n> <Left>
"inoremap <C-l> <Right>
" Ctrl-x
inoremap <C-k> <C-x><C-k>
inoremap <C-]> <C-x><C-]>
" tagsジャンプの時に複数ある時は一覧表示
nnoremap <C-]> g<C-]>
" term -> to normal mode
tnoremap <C-n> <C-W>N
" term -> paste
tnoremap <C-t> <C-W>""
" <Leader>を,に変更
:let mapleader = ","
command! Toj %!jq '.'
" vim-gitgutter
set updatetime=250
" dein
set runtimepath+=~/.cache/dein/repos/github.com/Shougo/dein.vim
if dein#load_state('~/.cache/dein')
call dein#begin('~/.cache/dein')
call dein#add('~/.cache/dein')
" deoplete
"call dein#add('Shougo/deoplete.nvim')
"call dein#add('roxma/nvim-yarp')
"call dein#add('roxma/vim-hug-neovim-rpc')
"call dein#add('takkii/Bignyanco')
"call dein#add('takkii/ruby-dictionary3')
"call dein#add('Shougo/neco-syntax')
"call dein#add('ujihisa/neco-look')
"call dein#add('deoplete-plugins/deoplete-tag')
""call dein#add('Shougo/neosnippet.vim')
""call dein#add('Shougo/neosnippet-snippets')
" ruby-dictionary3
"setlocal dictionary+=~/.config/nvim/repos/github.com/takkii/ruby-dictionary3/autoload/source/ruby_method_deoplete
"call deoplete#custom#source(
" \ 'dictionary', 'ruby', ['[^. *\t]\.\w*\|\h\w*::'])
" vim-ref
"call dein#add('thinca/vim-ref')
" unite
call dein#add('Shougo/unite.vim')
call dein#add('Shougo/neomru.vim')
" nerdtree
call dein#add('scrooloose/nerdtree')
" git
call dein#add('tpope/vim-fugitive')
call dein#add('airblade/vim-gitgutter')
" status bar
call dein#add('vim-airline/vim-airline')
call dein#add('vim-airline/vim-airline-themes')
call dein#add('ryanoasis/vim-devicons')
" color
call dein#add('tomasr/molokai')
"call dein#add('raphamorim/lucario')
" taglist
call dein#add('vim-scripts/taglist.vim')
" ale
"call dein#add('w0rp/ale')
"let g:ale_fixers = {
"\ 'ruby': ['rubocop'],
"\}
"let g:ale_ruby_rubocop_executable = 'docker-compose exec cc-api bundle exec rubocop'
"let g:airline#extensions#ale#enabled = 1
" vim-javascript
call dein#add('pangloss/vim-javascript')
" yajs
call dein#add('othree/yajs.vim')
"call dein#add('othree/es.next.syntax.vim')
"call dein#add('othree/javascript-libraries-syntax.vim')
call dein#add('othree/html5.vim')
call dein#add('maxmellon/vim-jsx-pretty')
call dein#add('ternjs/tern_for_vim')
" typescript-vim
call dein#add('leafgarland/typescript-vim')
" dash
call dein#add('rizzatti/dash.vim')
" ruby
call dein#add('vim-ruby/vim-ruby')
call dein#add('slim-template/vim-slim')
" python
call dein#add('davidhalter/jedi-vim')
" markdown-preview.nvim
call dein#add('iamcco/markdown-preview.nvim', {'on_ft': ['markdown', 'pandoc.markdown', 'rmd'],
\ 'build': 'sh -c "cd app && yarn install"' })
call dein#end()
call dein#save_state()
endif
if has('vim_starting') && dein#check_install()
call dein#install()
endif
filetype plugin indent on
syntax enable
autocmd ColorScheme * highlight Comment ctermfg=50 guifg=#008800
autocmd ColorScheme * highlight Delimiter ctermfg=144 guifg=#008800
colorscheme molokai
"colorscheme lucario
"""""""" unite
" 入力モードで開始する
let g:unite_enable_start_insert=1
" history/yank有効化
let g:unite_source_history_yank_enable = 1
" バッファ一覧
noremap <C-P> :Unite buffer<CR>
" ファイル一覧
noremap <C-N> :UniteWithBufferDir -buffer-name=files file<CR>
" 最近使ったファイルの一覧
noremap <C-Z> :Unite file_mru<CR>
" sourcesを「今開いているファイルのディレクトリ」とする
noremap :uff :<C-u>UniteWithBufferDir file -buffer-name=file<CR>
" history/yank
nnoremap <silent> <C-y> :Unite history/yank<CR>
" ウィンドウを分割して開く
"au FileType unite nnoremap <silent> <buffer> <expr> <C-J> unite#do_action('split')
"au FileType unite inoremap <silent> <buffer> <expr> <C-J> unite#do_action('split')
" ウィンドウを縦に分割して開く
"au FileType unite nnoremap <silent> <buffer> <expr> <C-K> unite#do_action('vsplit')
"au FileType unite inoremap <silent> <buffer> <expr> <C-K> unite#do_action('vsplit')
" ESCキーを2回押すと終了する
au FileType unite nnoremap <silent> <buffer> <ESC><ESC> :q<CR>
au FileType unite inoremap <silent> <buffer> <ESC><ESC> <ESC>:q<CR>
" nerdtree
map <C-D> :NERDTreeToggle<CR>
"""""""" vim-gitgutter
let g:gitgutter_sign_added = '+'
let g:gitgutter_sign_modified = '->'
let g:gitgutter_sign_removed = '-'
"""""""" taglist
let Tlist_Show_One_File = 1
let Tlist_Use_Right_Window = 1
let Tlist_Exit_OnlyWindow = 1
map <silent> <leader>l :TlistToggle<CR>
"""""""" yajs
autocmd BufRead,BufNewFile *.es6 setfiletype javascript
"""""""" vim-slim
autocmd BufRead,BufNewFile *.slim setfiletype slim
"""""""" ruby
autocmd BufRead,BufNewFile *.jbuilder setfiletype ruby
"""""""" jedi-vim
autocmd FileType python setlocal completeopt-=preview
"""""""" airline
" Powerline系フォントを利用する
let g:airline_powerline_fonts = 1
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tabline#buffer_idx_mode = 1
let g:airline#extensions#whitespace#mixed_indent_algo = 1
let g:airline_theme = 'papercolor'
if !exists('g:airline_symbols')
let g:airline_symbols = {}
endif
" unicode symbols
let g:airline_left_sep = '»'
let g:airline_left_sep = '▶'
let g:airline_right_sep = '«'
let g:airline_right_sep = '◀'
let g:airline_symbols.crypt = '🔒'
let g:airline_symbols.linenr = '␊'
let g:airline_symbols.linenr = ''
let g:airline_symbols.linenr = '¶'
let g:airline_symbols.maxlinenr = '☰'
let g:airline_symbols.maxlinenr = ''
let g:airline_symbols.branch = '⎇'
let g:airline_symbols.paste = 'ρ'
let g:airline_symbols.paste = 'Þ'
let g:airline_symbols.paste = '∥'
let g:airline_symbols.spell = 'Ꞩ'
let g:airline_symbols.notexists = '∄'
let g:airline_symbols.whitespace = 'Ξ'
" powerline symbols
let g:airline_left_sep = ''
let g:airline_left_alt_sep = ''
let g:airline_right_sep = ''
let g:airline_right_alt_sep = ''
let g:airline_symbols.branch = ''
"let g:airline_symbols.readonly = ''
let g:airline_symbols.readonly = '🔒'
"let g:airline_symbols.linenr = ''
" old vim-powerline symbols
" let g:airline_right_sep = '⮂'
" let g:airline_right_alt_sep = '⮃'
" deoplete
"let g:deoplete#enable_at_startup = 1
"let g:monster#completion#backend = 'solargraph'
" neosnippet
"imap <C-k> <Plug>(neosnippet_expand_or_jump)
"smap <C-k> <Plug>(neosnippet_expand_or_jump)
"xmap <C-k> <Plug>(neosnippet_expand_target)
"smap <expr><TAB> neosnippet#expandable_or_jumpable() ? "\<Plug>(neosnippet_expand_or_jump)" : "\<TAB>"
" For conceal markers.
"if has('conceal')
" set conceallevel=2 concealcursor=niv
"endif
" javascript-libraries-syntax.vim
let g:used_javascript_libs = 'jquery,react'
autocmd BufReadPre *.js let b:javascript_lib_use_jquery = 1
autocmd BufReadPre *.js let b:javascript_lib_use_react = 1
highlight Normal ctermbg=none
highlight NonText ctermbg=none
highlight LineNr ctermbg=none
highlight Folded ctermbg=none
highlight EndOfBuffer ctermbg=none