-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
186 lines (171 loc) · 4.97 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
"dein Scripts-----------------------------
if &compatible
set nocompatible " Be iMproved
endif
" Required:
set runtimepath^=~/.cache/dein/repos/github.com/Shougo/dein.vim
" Required:
if dein#load_state('~/.cache/dein')
call dein#begin('~/.cache/dein')
" Let dein manage dein
" Required:
call dein#add('~/.cache/dein/repos/github.com/Shougo/dein.vim')
" Add or remove your plugins here:
call dein#add('vim-jp/vimdoc-ja')
call dein#add('Shougo/neosnippet.vim')
call dein#add('Shougo/neosnippet-snippets')
call dein#add('scrooloose/nerdtree')
call dein#add('Shougo/unite.vim')
call dein#add('Shougo/neomru.vim')
call dein#add('tpope/vim-rails')
call dein#add('tpope/vim-endwise')
call dein#add('tpope/vim-fugitive')
call dein#add('itchyny/lightline.vim')
call dein#add('airblade/vim-gitgutter')
call dein#add('nathanaelkane/vim-indent-guides')
call dein#add('fatih/vim-go')
call dein#add('simeji/winresizer')
call dein#add('othree/yajs.vim')
" http://blog.remora.cx/2010/12/vim-ref-with-unite.html
""""""""""""""""""""""""""""""
" Unit.vimの設定
""""""""""""""""""""""""""""""
" 入力モードで開始する
let g:unite_enable_start_insert=-1
" バッファ一覧
noremap <C-P> :Unite buffer<CR>
" ファイル一覧
noremap <C-N> :Unite -buffer-name=file file<CR>
" 最近使ったファイルの一覧
noremap <C-Z> :Unite file_mru<CR>
" sourcesを「今開いているファイルのディレクトリ」とする
noremap :uff :<C-u>UniteWithBufferDir file -buffer-name=file<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>
""""""""""""""""""""""""""""""""
" You can specify revision/branch/tag.
call dein#add('Shougo/vimshell', { 'rev': '3787e5' })
" Required:
call dein#end()
call dein#save_state()
endif
" Required:
filetype plugin indent on
syntax enable
" If you want to install not installed plugins on startup.
if dein#check_install()
call dein#install()
endif
"End dein Scripts-------------------------
" lightlineの設定
set background=dark
colorscheme iceberg
let g:lightline = {
\ 'colorscheme': 'default',
\ 'active': {
\ 'left': [
\ ['mode', 'paste'],
\ ['gitbranch', 'readonly', 'filename', 'modified'],
\ ],
\ },
\ }
" インデントを可視化する
let g:indent_guides_enable_on_vim_startup = 1
let g:indent_guides_start_level = 1
let g:indent_guides_auto_colors = 0
autocmd VimEnter,Colorscheme * :hi IndentGuidesOdd guibg=red ctermbg=237
autocmd VimEnter,Colorscheme * :hi IndentGuidesEven guibg=green ctermbg=239
" 基本的な設定
set backspace=indent,eol,start
set encoding=utf-8
set fileencodings=utf-8
set fileformats=unix,dos,mac
set helplang=ja
" モードによってカーソルの形を変更する
if has('vim_starting')
let &t_SI .= "\e[6 q"
let &t_EI .= "\e[2 q"
let &t_SR .= "\e[4 q"
endif
" 行番号のハイライト
set cursorline
nnoremap ss :<C-u>sp<CR>
nnoremap sv :<C-u>vs<CR>
nnoremap sq :<C-u>q<CR>
nnoremap sQ :<C-u>bd<CR>
nnoremap st :<C-u>tabnew<CR>
nnoremap sn gl
nnoremap sp gT
nnoremap s= <C-w>=
nnoremap sj <C-w>j
nnoremap sk <C-w>k
nnoremap sl <C-w>l
nnoremap sh <C-w>h
nnoremap sJ <C-w>J
nnoremap sK <C-w>K
nnoremap sL <C-w>L
nnoremap sH <C-w>H
nnoremap ; :
nnoremap : ;
vnoremap : :
vnoremap : ;
" 不可視文字を表示する
set list
set listchars=tab:\▸\-,extends:»,precedes:«,nbsp:%,trail:.
" 検索語句のハイライト
set hlsearch
set incsearch
set ignorecase
set smartcase
" コマンド補完をわかりやすく
set wildmenu
nnoremap <silent><Esc><Esc> :<C-u>set nohlsearch!<CR>
" 行数を表示
set number
" スワップファイルを作成しない
set noswapfile
" コマンド履歴を2行に設定
"set cmdheight=2
" カッコの対応を強調
set showmatch
" タブをスペースに変換
set expandtab
" 自動インデントでずれる幅
set shiftwidth=2
" タブをスペース2つ分にする
set tabstop=2
" ビープ音を削除
set visualbell t_vb=
set noerrorbells
" ステータスラインの設定
set laststatus=2
set noshowmode
set showcmd
set clipboard=unnamed,autoselect
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
if &term =~ "xterm"
let &t_SI .= "\e[?2004h"
let &t_EI .= "\e[?2004l"
let &pastetoggle = "\e[201~"
function XTermPasteBegin(ret)
set paste
return a:ret
endfunction
inoremap <special> <expr> <Esc>[200~ XTermPasteBegin("")
endif