-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
executable file
·269 lines (228 loc) · 7.31 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
" Add ~/.vimrc or .config/nvim/init.vim {{{
" execute 'source' fnameescape(expand('~/.vim/.vimrc'))
"
" }}}
" ~/.vim/rc/.vimrc
" my .vimrc is custumizing Shougo's .vimrc.
" https://github.com/Shougo/shougo-s-github/tree/master/vim
let g:statline_syntastic = 0
if !&compatible
set nocompatible
endif
" reset augroup
augroup MyAutoCmd
autocmd!
augroup END
" dein settings {{{
" dein自体の自動インストール
let s:cache_home = empty($XDG_CACHE_HOME) ? expand('~/.cache') : $XDG_CACHE_HOME
let s:dein_dir = s:cache_home . '/dein'
let s:dein_repo_dir = s:dein_dir . '/repos/github.com/Shougo/dein.vim'
if !isdirectory(s:dein_repo_dir)
call system('git clone https://github.com/Shougo/dein.vim ' . shellescape(s:dein_repo_dir))
endif
let &runtimepath = s:dein_repo_dir .",". &runtimepath
" プラグイン読み込み&キャッシュ作成
let s:toml_file = fnamemodify(expand('<sfile>'), ':h').'/dein.toml'
let s:lazy_toml = fnamemodify(expand('<sfile>'), ':h').'/dein_lazy.toml'
if dein#load_state(s:dein_dir)
call dein#begin(s:dein_dir)
call dein#add('Shougo/ddc.vim')
call dein#add('vim-denops/denops.vim')
" Install your sources
call dein#add('Shougo/ddc-around')
" " Install your filters
call dein#add('Shougo/ddc-matcher_head')
call dein#add('Shougo/ddc-sorter_rank')
call dein#load_toml(s:toml_file, {'lazy': 0})
call dein#load_toml(s:lazy_toml, {'lazy': 1})
call dein#end()
call dein#save_state()
endif
" 不足プラグインの自動インストール
if has('vim_starting') && dein#check_install()
call dein#install()
endif
" }}}
function! s:source_rc(path) abort
execute 'source' fnameescape(expand('~/.vim/rc/' . a:path))
endfunction
filetype off
filetype plugin indent off
set path +=~/.vim/rc
" Use ',' instead of '\'.
" Use <Leader> in global plugin.
let g:mapleader = ','
" Use <LocalLeader> in filetype plugin.
let g:maplocalleader = 'm'
" Release keymappings for plug-in.
nnoremap ; <Nop>
xnoremap ; <Nop>
nnoremap m <Nop>
xnoremap m <Nop>
nnoremap , <Nop>
xnoremap , <Nop>
syntax on
"Setting vim ColorScheme
" let g:hybrid_custom_term_colors = 1
" let g:hybrid_reduced_contrast = 1 " Remove this line if using the default palette
set autochdir
set directory=$HOME/.vim/tmp "スワップファイル用のディレクトリを指定する
set backupdir=~/.vim/tmp
set mouse=a
set hidden "変更中のファイルでも、保存しないで他のファイルを表示する
set number "行番号を表示する
set cindent
let loaded_matchparen = 1
set tabstop=4 "Tabをスペース2つに設定
set expandtab "Tabを半角スペースで設定
set shiftwidth=2 "vimにより生成されるファイルのtabを2つに設定
set smarttab "新しい行を作った時に高度な自動インデントを行う
set whichwrap=b,s,h,l,<,>,[,] " カーソルを行頭、行末で止めない
set magic
set autoindent smartindent
" set cursorline
set diffopt=vertical
set backspace=indent,eol,start
set laststatus=2
set clipboard^=unnamedplus
if has('persistent_undo')
set undodir=~/.vim/undo
set undofile
endif
"""autocmd
" 保存時に行末の空白を除去する
" autocmd BufWritePre * :%s/\s\+$//ge
augroup vimrcEx
au BufRead * if line("'\"") > 0 && line("'\"") <= line("$") |
\ exe "normal g`\"" | endif
augroup END
"
" "Keymapping -normal
noremap <Tab> >>
noremap <S-Tab> <<
nmap \c <Plug>(caw:zeropos:toggle)
vmap \c <Plug>(caw:zeropos:toggle)
nnoremap <F1> :%y+<CR>
nnoremap <F2> :<C-u>.tabedit ~/Documents/codes/Competition/Snipet/Snipet.cpp<CR>GVggyZZpggdd39Go
nnoremap <F3> :<C-u>.tabedit ~/Documents/codes/Competition/Snipet/Templete.cpp<CR>
nnoremap <F4> :<C-u>.tabedit ~/Documents/codes/Competition/Snipet/Snipet.cpp<CR>
nnoremap = GVgg=
nnoremap / /\v
" http://inari.hatenablog.com/entry/2014/05/05/231307
""""""""""""""""""""""""""""""
" 全角スペースの表示
""""""""""""""""""""""""""""""
function! ZenkakuSpace()
highlight ZenkakuSpace cterm=underline ctermfg=lightblue guibg=darkgray
endfunction
if has('syntax')
augroup ZenkakuSpace
autocmd!
autocmd ColorScheme * call ZenkakuSpace()
autocmd VimEnter,WinEnter,BufRead * let w:m1=matchadd('ZenkakuSpace', ' ')
augroup END
call ZenkakuSpace()
endif
""""""""""""""""""""""""""""""
"https://github.com/koara-local/dotvim/blob/master/vimrc
set nofoldenable
set foldcolumn=1 " 左側に折りたたみガイド表示
set foldmethod=indent " 折畳の判別
set foldtext=Mopp_fold() " 折りたたみ時の表示設定
set foldopen=block,hor,insert,jump,mark,percent,quickfix,search,tag,undo " fold内に移動すれば自動で開く
function! Mopp_fold()
let line = ' ' . substitutegetline(v:foldstart), '^\s*', '', '')
for i in range(&shiftwidth * v:foldlevel - 2)
let line = '-' . line
endfor
let line = '+' . line
let tail = printf('[ %2d Lines Lv%02d ] --- ',
(v:foldend - v:foldstart + 1), v:foldlevel)
let space_size = (winwidth(0) - &foldcolumn
- strdisplaywidth(line . tail) - 1) -
((&number) ? max([&numberwidth,
len(line('$'))]) : 0)
return printf('%s%' . space_size .
'S%s', line, '', tail)
endfunction
" dein
if 1
"---------------------------------------------------------------------------
"" Encoding:
"
call s:source_rc('encoding.rc.vim')
"---------------------------------------------------------------------------
"" Search:
"
" Ignore the case of normal letters.
set ignorecase
" If the search pattern contains upper case characters, override ignorecase
" option.
set smartcase
" Enable incremental search.
set incsearch
" Don't highlight search result.
set nohlsearch
" Searches wrap around the end of the file.
set wrapscan
"---------------------------------------------------------------------------
"" FileType:
"
call s:source_rc('filetype.rc.vim')
""---------------------------------------------------------------------------
" Mappings:
" "
call s:source_rc('mappings.rc.vim')
""
" Plugins:
""
call s:source_rc('plugins.rc.vim')
" filetype on
filetype plugin indent on
endif
"setting for haskell
set tags=tags;/,codex.tags;/
let g:tagbar_type_haskell = {
\ 'ctagsbin' : 'hasktags',
\ 'ctagsargs' : '-x -c -o-',
\ 'kinds' : [
\ 'm:modules:0:1',
\ 'd:data: 0:1',
\ 'd_gadt: data gadt:0:1',
\ 't:type names:0:1',
\ 'nt:new types:0:1',
\ 'c:classes:0:1',
\ 'cons:constructors:1:1',
\ 'c_gadt:constructor gadt:1:1',
\ 'c_a:constructor accessors:1:1',
\ 'ft:function types:1:1',
\ 'fi:function implementations:0:1',
\ 'o:others:0:1'
\ ],
\ 'sro' : '.',
\ 'kind2scope' : {
\ 'm' : 'module',
\ 'c' : 'class',
\ 'd' : 'data',
\ 't' : 'type'
\ },
\ 'scope2kind' : {
\ 'module' : 'm',
\ 'class' : 'c',
\ 'data' : 'd',
\ 'type' : 't'
\ }
\ }
"setting for python
"/root/.pyenv/versions/neovim3/bin/python
let g:python2_host_prog = $PYENV_ROOT . 'versions/neovim2/bin/python'
let g:python3_host_prog = $PYENV_ROOT . 'versions/neovim3/bin/python'
" vimdiffの色設定
syntax on
set t_Co=256
colorscheme iceberg
highlight DiffAdd cterm=bold ctermfg=10 ctermbg=22
highlight DiffDelete cterm=bold ctermfg=10 ctermbg=52
highlight DiffChange cterm=bold ctermfg=10 ctermbg=17
highlight DiffText cterm=bold ctermfg=10 ctermbg=21