-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
150 lines (129 loc) · 5.03 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
" 表示関連
" set list "不可視文字表示
set listchars=tab:>-,trail:-
set number "行番号を表示
set cursorline
set title "編集中のファイル名を表示
set showmatch "かっこ入力時に対応する括弧を表示
set autoread
set laststatus=2
set scrolloff=8
" コマンド関連
set wildmenu
set showcmd
" エンコード関連
set enc=utf-8
set fenc=utf-8
set fileencodings=utf-8,shift-jis
" インデント関連
set tabstop=4 "タグ文字の幅
set shiftwidth=4 "自動で挿入されるインデントの幅
set smartindent
" 検索関連
set incsearch
set hlsearch
set ignorecase "大文字小文字の区別なく検索する
set smartcase "検索文字列に大文字が含まれている場合は区別して検索する
set wrapscan "検索時に最後までいったら最初に戻る
" バックアップ関連
set nobackup
set noswapfile
nnoremap sj <C-w>j
nnoremap sk <C-w>k
nnoremap sh <C-w>h
nnoremap sl <C-w>l
set backspace=indent,eol,start
set clipboard=unnamed,unnamedplus
" dein.vimの設定
if &compatible
set nocompatible
endif
set runtimepath+=~/.cache/dein/repos/github.com/Shougo/dein.vim
call dein#begin(expand('~/.vim/dein'))
call dein#add('Shougo/dein.vim')
call dein#add('Shougo/neocomplete.vim')
call dein#add('Shougo/unite.vim')
call dein#add('Shougo/vimproc.vim', {'build': {'mac' : 'make -f make_mac.mak', }, })
call dein#add('Shougo/neomru.vim')
call dein#add('davidhalter/jedi-vim')
call dein#add('Shougo/neosnippet.vim')
call dein#add('Shougo/neosnippet-snippets')
call dein#add('posva/vim-vue')
call dein#add('fatih/vim-go')
call dein#add('tpope/vim-fugitive')
call dein#add('mechatroner/rainbow_csv')
call dein#end()
" dein#end()のあとに書かないと反映されない
colorscheme ron
syntax on
" Neocompleteを有効化
let g:neocomplete#enable_at_startup = 1
autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS
autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags
autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS
autocmd FileType python setlocal omnifunc=pythoncomplete#Complete
autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags
""" Uniteの設定
"unite prefix key.
nnoremap [unite] <Nop>
nmap <Space>f [unite]
"unite general settings
let g:unite_source_menu_menus = get(g:,'unite_source_menu_menus',{})
"インサートモードで開始
let g:unite_enable_start_insert = 1
"最近開いたファイル履歴の保存数
let g:unite_source_file_mru_limit = 50
"file_mruの表示フォーマットを指定。空にすると表示スピードが高速化される
let g:unite_source_file_mru_filename_format = ''
"現在開いているファイルのディレクトリ下のファイル一覧。
"開いていない場合はカレントディレクトリ
nnoremap <silent> [unite]f :<C-u>UniteWithBufferDir -buffer-name=files file<CR>
"バッファ一覧
nnoremap <silent> [unite]b :<C-u>Unite buffer<CR>
"レジスタ一覧
nnoremap <silent> [unite]r :<C-u>Unite -buffer-name=register register<CR>
"最近使用したファイル一覧
nnoremap <silent> [unite]m :<C-u>Unite file_mru<CR>
"ブックマーク一覧
nnoremap <silent> [unite]c :<C-u>Unite bookmark<CR>
"ブックマークに追加
nnoremap <silent> [unite]a :<C-u>UniteBookmarkAdd<CR>
"uniteを開いている間のキーマッピング
autocmd FileType unite call s:unite_my_settings()
function! s:unite_my_settings()"{{{
"ESCでuniteを終了
nmap <buffer> <ESC> <Plug>(unite_exit)
"入力モードのときjjでノーマルモードに移動
imap <buffer> jj <Plug>(unite_insert_leave)
"入力モードのときctrl+wでバックスラッシュも削除
imap <buffer> <C-w> <Plug>(unite_delete_backward_path)
"ctrl+jで縦に分割して開く
nnoremap <silent> <buffer> <expr> <C-j> unite#do_action('split')
inoremap <silent> <buffer> <expr> <C-j> unite#do_action('split')
"ctrl+lで横に分割して開く
nnoremap <silent> <buffer> <expr> <C-l> unite#do_action('vsplit')
inoremap <silent> <buffer> <expr> <C-l> unite#do_action('vsplit')
"ctrl+oでその場所に開く
nnoremap <silent> <buffer> <expr> <C-o> unite#do_action('open')
inoremap <silent> <buffer> <expr> <C-o> unite#do_action('open')
endfunction"}}}
" neosnippetの設定(コピペ)
" Plugin key-mappings.
" Note: It must be "imap" and "smap". It uses <Plug> mappings.
imap <C-k> <Plug>(neosnippet_expand_or_jump)
smap <C-k> <Plug>(neosnippet_expand_or_jump)
xmap <C-k> <Plug>(neosnippet_expand_target)
" SuperTab like snippets behavior.
" Note: It must be "imap" and "smap". It uses <Plug> mappings.
imap <C-k> <Plug>(neosnippet_expand_or_jump)
"imap <expr><TAB>
" \ pumvisible() ? "\<C-n>" :
" \ neosnippet#expandable_or_jumpable() ?
" \ "\<Plug>(neosnippet_expand_or_jump)" : "\<TAB>"
smap <expr><TAB> neosnippet#expandable_or_jumpable() ?
\ "\<Plug>(neosnippet_expand_or_jump)" : "\<TAB>"
" For conceal markers.
if has('conceal')
set conceallevel=2 concealcursor=niv
endif
let g:neosnippet#snippets_directory='~/.vim/dein/vim-snippets/snippets'