-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
executable file
·198 lines (190 loc) · 6.7 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
set encoding=utf-8 "このvimrcのエンコーディング
set fileencodings=utf-8,iso-2022-jp,euc-jp,sjis
set fileformats=unix,dos,mac
set nowrap
set number "行番号を表示
set expandtab "タブはスペースに変換
set tabstop=4 "ハードタブの表示幅
set shiftwidth=4 "ソフトタブのインデント幅
set smartindent "自動インデントの設定
set autoindent
set nosmarttab "同じインデントにコメントを書きたいとき、#を入力すると行頭に行ってしまうので
set guicursor= "カーソル形状を変えない
set cursorline "カーソル行ハイライト カーソル移動が遅くなる可能性あり
autocmd FileType help wincmd H "ヘルプを横に開く
set cmdheight=2
au Colorscheme * hi Folded ctermfg=229 guifg=#E6DB74
au Colorscheme * hi Normal ctermbg=None guibg=black
au ColorScheme * hi ColorColumn ctermbg=234 guibg=gray10
au ColorScheme * hi MatchParen ctermfg=15 guifg=white
set noswapfile
set nobackup
set nowritebackup
let loaded_matchparen = 1 "カーソルを見失うので対応するかっこのハイライトを消す
set noshowmatch
set backspace=indent,eol,start "バックスペースで行を跨いで文字を消せるようにする
set hidden "新しいbufferを開くときに編集を保存するか聞かない
set nofixeol "文末に自動で改行をつけない
set shortmess=A "スワップファイルが発見されたときに "注意" しない
set ambiwidth=single " Vimであいまいな幅の文字の論理幅を1にする
set foldmethod=marker
set undodir=~/.vim/undo
set undofile
set clipboard=unnamedplus
set fillchars=fold:\
function! Myfold()
return substitute(getline(v:foldstart), ".{{"."{", '', '')
endfunction
set foldtext=Myfold()
set foldopen=
"ターミナルモードをEscで抜けられるようにする
silent! tnoremap <silent> <ESC> <C-\><C-n>
"コマンドライン行でC-a,C-eで行頭、行末
cnoremap <C-a> <Home>
cnoremap <C-e> <End>
let mapleader = "\<Space>"
command! V exe "silent !code --goto '" . expand("%") . ":" . line(".") . ":" . col(".") . "'" | redraw!
call plug#begin('~/.vim/plugged_vim')
Plug 'tomasr/molokai'
Plug 'h1mesuke/vim-alignta'
Plug 'tyru/capture.vim'
Plug 'luochen1990/rainbow' "{{{
let g:rainbow_active = 1
let g:rainbow_conf = {
\ 'guifgs': [
\ 'cyan',
\ 'magenta',
\ 'yellow',
\ 'red',
\ 'green',
\ 'blue',
\ ],
\ 'ctermfgs': [
\ 'cyan',
\ 'magenta',
\ 'yellow',
\ 'red',
\ 'green',
\ 'blue',
\ ],
\ 'operators': '_,_',
\ 'parentheses': [
\ 'start=/(/ end=/)/ fold',
\ 'start=/\[/ end=/\]/ fold',
\ 'start=/{/ end=/}/ fold'
\ ],
\ 'separately': {
\ '*': {},
\ 'tex': {
\ 'parentheses': ['start=/(/ end=/)/', 'start=/\[/ end=/\]/'],
\ },
\ 'lisp': {
\ 'guifgs': [
\ 'royalblue3',
\ 'darkorange3',
\ 'seagreen3',
\ 'firebrick',
\ 'darkorchid3'
\ ],
\ },
\ 'vim': {
\ 'parentheses': [
\ 'start=/(/ end=/)/',
\ 'start=/\[/ end=/\]/',
\ 'start=/{/ end=/}/ fold',
\ 'start=/(/ end=/)/ containedin=vimFuncBody',
\ 'start=/\[/ end=/\]/ containedin=vimFuncBody',
\ 'start=/{/ end=/}/ fold containedin=vimFuncBody'
\ ],
\ },
\ 'html': {
\ 'parentheses': [
\ 'start=/\v\<((area|base|br|col|embed|hr|img|input|keygen|link|'.
\ 'menuitem|meta|param|source|track|wbr)[ >])@!\z([-_:a-zA-Z0-9]+)'.
\ '(\s+[-_:a-zA-Z0-9]+(\=("[^"]*"|'."'".'[^'."'".']*'."'".'|[^ '."'".
\ '"><=`]*))?)*\>/ end=#</\z1># fold'
\ ],
\ },
\ 'css': 0,
\ 'nerdtree': 0,
\ }
\}
"}}}
Plug 'dstein64/vim-startuptime'
Plug 'tpope/vim-fugitive' "{{{
"fugitiveのdiffを垂直分割する
set diffopt+=vertical
"}}}
"Plug 'airblade/vim-gitgutter' "{{{
" set updatetime=100
" au Colorscheme * hi GitGutterAdd guifg=green guibg=#232526
" au Colorscheme * hi GitGutterChange guifg=yellow guibg=#232526
" au Colorscheme * hi GitGutterDelete guifg=red guibg=#232526
""}}}
Plug 'vim-jp/vimdoc-ja' "{{{
set helplang=ja,en
"}}}
Plug 'mbbill/undotree' "{{{
let g:undotree_ShortIndicators = 1
let g:undotree_WindowLayout = 2
"}}}
Plug 'powerman/vim-plugin-AnsiEsc'
Plug 'tpope/vim-surround'
Plug 'christoomey/vim-tmux-navigator' "{{{
let g:tmux_navigator_no_mappings = 1
nnoremap <silent> <M-h> :TmuxNavigateLeft<cr>
nnoremap <silent> <M-j> :TmuxNavigateDown<cr>
nnoremap <silent> <M-k> :TmuxNavigateUp<cr>
nnoremap <silent> <M-l> :TmuxNavigateRight<cr>
nnoremap <silent> <M-\> :TmuxNavigatePrevious<cr>
silent! tnoremap <silent> <M-h> <C-\><C-n>:TmuxNavigateLeft<cr>
silent! tnoremap <silent> <M-j> <C-\><C-n>:TmuxNavigateDown<cr>
silent! tnoremap <silent> <M-k> <C-\><C-n>:TmuxNavigateUp<cr>
silent! tnoremap <silent> <M-l> <C-\><C-n>:TmuxNavigateRight<cr>
silent! tnoremap <silent> <M-\> <C-\><C-n>:TmuxNavigatePrevious<cr>
inoremap <silent> <M-h> <C-\><C-n>:TmuxNavigateLeft<cr>
inoremap <silent> <M-j> <C-\><C-n>:TmuxNavigateDown<cr>
inoremap <silent> <M-k> <C-\><C-n>:TmuxNavigateUp<cr>
inoremap <silent> <M-l> <C-\><C-n>:TmuxNavigateRight<cr>
inoremap <silent> <M-\> <C-\><C-n>:TmuxNavigatePrevious<cr>
vnoremap <silent> <M-h> <C-\><C-n>:TmuxNavigateLeft<cr>
vnoremap <silent> <M-j> <C-\><C-n>:TmuxNavigateDown<cr>
vnoremap <silent> <M-k> <C-\><C-n>:TmuxNavigateUp<cr>
vnoremap <silent> <M-l> <C-\><C-n>:TmuxNavigateRight<cr>
vnoremap <silent> <M-\> <C-\><C-n>:TmuxNavigatePrevious<cr>
cnoremap <silent> <M-h> <C-\><C-n>:TmuxNavigateLeft<cr>
cnoremap <silent> <M-j> <C-\><C-n>:TmuxNavigateDown<cr>
cnoremap <silent> <M-k> <C-\><C-n>:TmuxNavigateUp<cr>
cnoremap <silent> <M-l> <C-\><C-n>:TmuxNavigateRight<cr>
cnoremap <silent> <M-\> <C-\><C-n>:TmuxNavigatePrevious<cr>
let g:previous_window = -1
function SmartInsert()
if &buftype == 'terminal'
if g:previous_window != winnr()
startinsert
endif
let g:previous_window = winnr()
else
let g:previous_window = -1
endif
endfunction
au BufEnter * call SmartInsert()
"}}}
Plug 'tmux-plugins/vim-tmux-focus-events'
Plug 'jpalardy/vim-slime' "{{{
let g:slime_no_mappings = 1
xmap <C-j> <Plug>SlimeRegionSend
nmap <C-j> <Plug>SlimeParagraphSend
let g:slime_target = "tmux"
""{marked}"
""{right-of}"
let g:slime_default_config = {"socket_name": get(split($TMUX, ","), 0), "target_pane": ":.2"}
let g:slime_python_ipython = 1
let g:slime_dont_ask_default = 1
"}}}
call plug#end()
filetype plugin indent on
set t_Co=256
syntax on
silent! set termguicolors
silent! colorscheme molokai