-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig
198 lines (164 loc) · 4.69 KB
/
config
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
set rtp+=~/.fzf
set rtp+=~/.vim/bundle/Vundle.vim
"-----------------------------------
" Vundle Seting
"-----------------------------------
set nocompatible
syntax on
filetype off
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
source ~/.vimrc.d/cache/plugins.conf
call vundle#end()
source ~/.vimrc.d/cache/noplugins.conf
"-----------------------------------
set autowrite
set write
set modifiable
set signcolumn=yes
set updatetime=300 " RefleshTime
colorscheme molokai
set background=light
set background=dark
" Note: 正常にダークモードにする措置
" 改行時のコメントアウトの挙動
" https://vim-jp.org/vimdoc-ja/change.html#fo-table
set formatoptions-=roq
set backspace=indent,eol,start
set history=500
set ruler
set scrolloff=5
set number
set expandtab
set showtabline=2
set tabstop=2
set shiftwidth=2
set softtabstop=2
set shiftround
set smarttab
set wildmenu
set laststatus=2
set showcmd
set showmatch
set list
set listchars=tab:»-,trail:-,eol:↲,extends:»,precedes:«,nbsp:%
filetype plugin indent on
filetype plugin on
set mouse=a
set title
set showmatch
set nowrap
set spell
set spelllang=en,cjk
hi clear SpellBad
hi SpellBad cterm=underline
"Default
set encoding=utf-8
" Saved Encoding
set fenc=utf8
set fileencodings=utf-8,iso-2022-jp,sjis,euc-jp
"CR/LF FormatType
set fileformats=unix,mac,dos
"-----------------------------------
" searchAnd_viminfo.conf
"-----------------------------------
"when arrive to last result, return to first.
set wrapscan
"When doing to input, display result.
set incsearch
set viminfo=
" 94-gitgutter.conf
"-----------------------------------
let g:gitgutter_all = 1
let g:gitgutter_enabled = 1
let g:gitgutter_signs = 1
let g:gitgutter_set_sign_backgrounds = 1
let g:gitgutter_highlight_lines = 0
let g:gitgutter_highlight_linenrs = 1
let g:gitgutter_override_sign_column_highlight = 1
highlight! link SignColumn LineNr
highlight SognColumn ctermbg=black " Column bgcolor
" colors
highlight GitGutterAdd guifg=#57ca32 ctermfg=2
highlight GitGutterChange guifg=#caca32 ctermfg=3
highlight GitGutterDelete guifg=#ca3232 ctermfg=1
" line
highlight GitGutterAddLine guibg=#007209 ctermbg=22
highlight GitGutterChangeLine guibg=#a0a200 ctermbg=58
highlight GitGutterDeleteLine guibg=#970000 ctermbg=52
highlight link GitGutterChangeLine DiffText
"-----------------------------------
highlight lspReference ctermfg=red guifg=red ctermbg=green guibg=green
highlight link LspErrorHighlight ErrorMsg
highlight link LspWarningHighlight WarningMsg
highlight link LspInfoHighlight InfoMsg
" C-VでテキストをYankし,自動的にクリップボードにコピーする
set clipboard=unnamedplus,autoselect,exclude:.*
" WSL用
augroup myYank
autocmd!
autocmd TextYankPost * :call system('clip.exe', @")
augroup END
" Antialias enable
if has('mac') && has('gui_running')
set antialias
endif
"-----------------------------------
" git.conf
"-----------------------------------
hi diffAdded ctermfg=green
hi diffRemoved ctermfg=red
"-----------------------------------
" go.conf
"-----------------------------------
augroup LspGo
au!
autocmd User lsp_setup call lsp#register_server({
\ 'name': 'go-lang',
\ 'cmd': {server_info->['gopls']},
\ 'whitelist': ['go'],
\ })
autocmd FileType go setlocal omnifunc=lsp#complete
"autocmd FileType go nmap <buffer> gd <plug>(lsp-definition)
"autocmd FileType go nmap <buffer> ,n <plug>(lsp-next-error)
"autocmd FileType go nmap <buffer> ,p <plug>(lsp-previous-error)
augroup END
"-----------------------------------
" session.conf
"-----------------------------------
" session path
let s:session_path = expand('~/.vim/sessions')
if !isdirectory(s:session_path)
call mkdir(s:session_path, "p")
endif"
" save session
command! -nargs=1 SaveSession call s:saveSession(<f-args>)
function! s:saveSession(file)
execute 'silent mksession!' s:session_path . '/' . a:file
endfunction
" load session
command! -nargs=1 LoadSession call s:loadSession(<f-args>)
function! s:loadSession(file)
"execute 'silent source' a:file
execute 'silent source' s:session_path . '/' . a:file
endfunction
" delete session
command! -nargs=1 DeleteSession call s:deleteSession(<f-args>)
function! s:deleteSession(file)
call delete(expand(a:file))
endfunction
"----------------------------------------------------
" vimrc local config
"----------------------------------------------------
augroup vimrc-local
autocmd!
autocmd BufNewFile,BufReadPost * call s:vimrc_local(getcwd())
augroup END
function! s:vimrc_local(loc)
let files = findfile('.vimrc_local', a:loc . ';', -1)
for i in reverse(filter(files, 'filereadable(v:val)'))
source `=i`
endfor
endfunction
" include auth
source ~/.vimrc.d/cache/auth.conf