-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnvim.vim
167 lines (143 loc) · 4.6 KB
/
nvim.vim
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
"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 like this:
call dein#add('altercation/vim-colors-solarized')
call dein#add('Shougo/deoplete.nvim')
call dein#add('Shougo/denite.nvim')
call dein#add('Shougo/neomru.vim')
call dein#add('scrooloose/nerdtree')
call dein#add('itchyny/lightline.vim')
" 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-------------------------
" ステータスライン
" --------------------
set laststatus=2 " ステータスラインを常に表示する
set ruler " ルーラを表示する
" インデント
" --------------------
set smartindent " 改行時にオートインデント
set expandtab " tab -> spaces
filetype plugin indent on " ファイルタイプに合わせたインデントを利用
if has("autocmd")
autocmd FileType perl setlocal ts=4 sts=4 sw=4
autocmd FileType cpp setlocal ts=4 sts=4 sw=4
autocmd FileType c setlocal ts=4 sts=4 sw=4
autocmd FileType ruby setlocal ts=2 sts=2 sw=2
autocmd FileType yaml setlocal ts=2 sts=2 sw=2
endif
" 表示
" --------------------
set number " 行番号を表示
set showmatch " 括弧の対応をハイライト
" コマンド補完
" --------------------
set wildchar=<tab> " TABキーでコマンド補完を開始
set wildmode=list:longest,list:full " リスト表示, 最長マッチ
" denite
" --------------------
nnoremap [denite] <Nop>
nmap <Space>u [denite]
nnoremap <silent> [denite]b :<C-u>Denite buffer<CR>
nnoremap <silent> [denite]a :<C-u>Denite -buffer-name=files buffer file_mru file<CR>
autocmd FileType denite call s:denite_my_settings()
function! s:denite_my_settings() abort
nnoremap <silent><buffer><expr> <CR>
\ denite#do_map('do_action')
nnoremap <silent><buffer><expr> d
\ denite#do_map('do_action', 'delete')
nnoremap <silent><buffer><expr> p
\ denite#do_map('do_action', 'preview')
nnoremap <silent><buffer><expr> q
\ denite#do_map('quit')
nnoremap <silent><buffer><expr> i
\ denite#do_map('open_filter_buffer')
nnoremap <silent><buffer><expr> <Space>
\ denite#do_map('toggle_select').'j'
endfunction
call denite#custom#map(
\ 'insert',
\ '<C-N>',
\ '<denite:move_to_next_line>',
\ 'noremap'
\)
call denite#custom#map(
\ 'insert',
\ '<C-P>',
\ '<denite:move_to_previous_line>',
\ 'noremap'
\)
" deoplete
" --------------------
let g:deoplete#enable_at_startup = 1
" NERDTree
" --------------------
nnoremap [nerdtree] <Nop>
nmap <Space>n [nerdtree]
nnoremap [nerdtree]t :<C-u>NERDTreeToggle<CR>
let g:NERDTreeShowHidden=1 " 隠しファイルを表示する
let g:NERDTreeDirArrowExpandable = '+' " ツリー表示
let g:NERDTreeDirArrowCollapsible = '-' " ツリー表示
" 検索
" --------------------
set wrapscan " 最後まで検索したら先頭へ
set ignorecase " 大文字小文字を区別しない
set smartcase " 大文字が含まれていたら区別する
" 色
" --------------------
let g:solarized_termcolors=256
colorscheme solarized
" バックアップ
" --------------------
set backup " バックアップを有効化
set backupdir=~/.vim_backup
set swapfile " スワップファイルを作成
set directory=~/.vim_swap
" 移動
" --------------------
" insert mode 中のカーソル移動
inoremap <C-e> <END>
inoremap <C-a> <HOME>
inoremap <C-n> <Down>
inoremap <C-p> <Up>
inoremap <C-b> <Left>
inoremap <C-f> <Right>
" タブ関係
" ---------------------
nnoremap [tab] <Nop>
nmap <Space>t [tab]
nnoremap <silent> [tab]c :<c-u>tabnew<cr>
nnoremap <silent> [tab]n :<c-u>tabnext<cr>
nnoremap <silent> [tab]p :<c-u>tabprevious<cr>
nnoremap <silent> [tab]x :<c-u>tabclose<cr>
" ColorColumn
" ---------------------
set colorcolumn=80
" Highlights
" ---------------------
augroup HighlightTrailingSpaces
autocmd!
autocmd VimEnter,WinEnter,ColorScheme * highlight TrailingSpaces term=underline guibg=Red ctermbg=Red
autocmd VimEnter,WinEnter * match TrailingSpaces /\s\+$/
augroup END
set list
set listchars=tab:»-,trail:-,eol:↲,extends:»,precedes:«,nbsp:%