-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
75 lines (59 loc) · 1.64 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
" viとの互換性を無効にする(INSERT中のカーソルキーが有効、コントロールコードを無効)
set nocompatible
" 括弧入力時の対応する括弧を表示
set showmatch
" 行番号の表示
set number
" 保存し内で終了するときに確認ダイアログ
set confirm
" Windowsでパスの区切り文字をスラッシュで扱う
set shellslash
" リアルタイム検索
set incsearch
" 自動でインデントを整える
set smartindent
" jjをescにバインド
" inoremap: insertモードのみ
" noremap: normal/visualモード
" noremap!: insert/commandモード
inoremap <silent> jj <ESC>
" emacsのキーバインド
noremap <C-p> <Up>
noremap <C-n> <Down>
noremap <C-b> <Left>
noremap <C-f> <Right>
noremap <C-a> <HOME>
noremap <C-e> <END>
noremap! <C-p> <Up>
noremap! <C-n> <Down>
noremap! <C-b> <Left>
noremap! <C-f> <Right>
noremap! <C-a> <HOME>
noremap! <C-e> <END>
" インデントをスペース4つ
set expandtab
set tabstop=4
set shiftwidth=4
" クリップボードを共有
set clipboard&
set clipboard^=unnamed
if has("nvim")
" nvimのみの設定
" カラーを変更する
set termguicolors
else
" vimのみの設定
" コメントの色を黄色
hi Comment ctermfg=3
" 検索時に最後まで行ったら最初に戻る
set wrapscan
" 検索結果をハイライト表示
set hlsearch
"BSで削除できるものを指定する
" indent : 行頭の空白
" eol : 改行
" start : 挿入モード開始位置より手前の文字
set backspace=indent,eol,start
" シンタックスハイライトの有効化
syntax enable
endif