-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
149 lines (131 loc) · 3.04 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
" plugin
set helplang=ja
let g:airline#extensions#tabline#enabled=1
let g:airline#extensions#tabline#buffer_idx_mode=1
let g:airline_powerline_fonts=1
nmap <C-p> <Plug>AirlineSelectPrevTab
nmap <C-n> <Plug>AirlineSelectNextTab
let g:airline#extensions#tabline#buffer_idx_format = {
\ '0': '0 ',
\ '1': '1 ',
\ '2': '2 ',
\ '3': '3 ',
\ '4': '4 ',
\ '5': '5 ',
\ '6': '6 ',
\ '7': '7 ',
\ '8': '8 ',
\ '9': '9 '
\}
let g:airline_theme='powerlineish'
let g:table_mode_corner = '|'
let NERDTreeShowHidden = 1
nmap <C-b> :NERDTreeToggle<CR>
let g:lsp_diagnostics_echo_cursor = 0
let g:lsp_diagnostics_signs_enabled = 1
let g:lsp_diagnostics_signs_error = {'text': '❌'}
let g:lsp_diagnostics_signs_warning = {'text': '⚠'}
let g:lsp_diagnostics_signs_hint = {'text': '💡'}
" --- plugin management ---
" dein.vim settings {{{
" install dir {{{
let s:dein_dir = expand('~/.cache/dein')
let s:dein_repo_dir = s:dein_dir . '/repos/github.com/Shougo/dein.vim'
" }}}
" dein installation check {{{
if &runtimepath !~# '/dein.vim'
if !isdirectory(s:dein_repo_dir)
execute '!git clone https://github.com/Shougo/dein.vim' s:dein_repo_dir
endif
execute 'set runtimepath^=' . s:dein_repo_dir
endif
" }}}
" begin settings {{{
if dein#load_state(s:dein_dir)
call dein#begin(s:dein_dir)
" .toml file
let s:rc_dir = expand('~/.vim')
if !isdirectory(s:rc_dir)
call mkdir(s:rc_dir, 'p')
endif
let s:toml = s:rc_dir . '/dein.toml'
" read toml and cache
call dein#load_toml(s:toml, {'lazy': 0})
" end settings
call dein#end()
call dein#save_state()
endif
" }}}
" plugin installation check {{{
if dein#check_install()
call dein#install()
endif
" }}}
" plugin remove check {{{
let s:removed_plugins = dein#check_clean()
if len(s:removed_plugins) > 0
call map(s:removed_plugins, "delete(v:val, 'rf')")
call dein#recache_runtimepath()
endif
" }}}
" --- plugin management ---
" display
set number
set ambiwidth=double
" cursor
set cursorline
set cursorcolumn
set showmatch
" search
set hlsearch
set incsearch
set ignorecase
set smartcase
" undo hilight
if has('persistent_undo')
let undo_path=expand('~/.vim/undo')
exe 'set undodir=' ..undo_path
set undofile
endif
" indent
set smartindent
set autoindent
filetype plugin indent on
" clipboard
set clipboard+=unnamed
" syntax
syntax enable
" status line
set laststatus=2
set wildmenu
set ruler
set showcmd
" mouse
" enable mouse edit
"if has('mouse')
" set mouse=a
" if has('mouse_sgr')
" set ttymouse=sgr
" elseif v:version > 703 || v:version is 703 && has('patch632')
" set ttymouse=sgr
" else
" set ttymouse=xterm2
" endif
"endif
" ---custom kaymap---
" open .vimrc
nnoremap <C-s> :new ~/.vimrc<CR>
" esc esc: delete highlight
nnoremap <Esc><Esc> :nohlsearch<CR>
" カッコ、クォート補完
inoremap { {}<LEFT>
inoremap [ []<LEFT>
inoremap ( ()<LEFT>
inoremap " ""<LEFT>
inoremap ' ''<LEFT>
vnoremap { "zdi{<C-R>z}<ESC>
vnoremap [ "zdi[<C-R>z]<ESC>
vnoremap ( "zdi(<C-R>z)<ESC>
vnoremap " "zdi"<C-R>z^V"<ESC>
vnoremap ' "zdi'<C-R>z'<ESC>
" ---custom kaymap---