-
Notifications
You must be signed in to change notification settings - Fork 0
/
_gvimrc
executable file
·117 lines (104 loc) · 3.49 KB
/
_gvimrc
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
"=============================================================================
" Description: .gvimrc
" Author:
" Last Modified: 2013-10-29 15:38
" Version: 0.01
"=============================================================================
scriptencoding utf-8
"----------------------------------------
" システム設定
"----------------------------------------
" エラー時の音とビジュアルベルの抑制
set noerrorbells
set novisualbell
set visualbell t_vb=
if has('multi_byte_ime') || has('xim')
set iminsert=0 imsearch=0
if has('xim') && has('GUI_GTK')
" XIMの入力開始キー
" set imactivatekey=C-space
endif
endif
" IMEの状態をカラー表示
"if has('multi_byte_ime')
" highlight Cursor guifg=NONE guibg=Green
" highlight CursorIM guifg=NONE guibg=Purple
"endif
"----------------------------------------
" 表示設定
"----------------------------------------
" ツールバーを非表示
" set guioptions-=T
" コマンドラインの高さ
" set cmdheight=2
" カラー設定
colorscheme mycolor
" フォント設定
" フォントは英語名で指定すると問題が起きにくくなります
if has('xfontset')
set guifont=Ricty\ 10
elseif has('unix')
set guifont=VL\ Gothic\ 10
" set guifont=Ricty\ 10
elseif has('mac')
" set guifont=Osaka-Mono:h14
elseif has('win32') || has('win64')
set guifont=VL_Gothic:h10:cSHIFTJIS
" set guifont=Ricty:h10:cSHIFTJIS
" set guifontwide=MS_Gothic:h10:cSHIFTJIS
" set guifontwide=Ricty:h10:cSHIFTJIS
endif
" 印刷用フォント
if has('printer')
if has('win32') || has('win64')
" set printfont=MS_Mincho:h12:cSHIFTJIS
" set printfont=MS_Gothic:h12:cSHIFTJIS
endif
endif
""""""""""""""""""""""""""""""
" Window位置の保存と復帰
""""""""""""""""""""""""""""""
if has('unix')
let s:infofile = '~/.vimpos'
else
let s:infofile = '~/_vimpos'
endif
function! s:SaveWindowParam(filename)
redir => pos
exec 'winpos'
redir END
let pos = matchstr(pos, 'X[-0-9 ]\+,\s*Y[-0-9 ]\+$')
let file = expand(a:filename)
let str = []
let cmd = 'winpos '.substitute(pos, '[^-0-9 ]', '', 'g')
cal add(str, cmd)
let l = &lines
let c = &columns
cal add(str, 'set lines='. l.' columns='. c)
silent! let ostr = readfile(file)
if str != ostr
call writefile(str, file)
endif
endfunction
augroup SaveWindowParam
autocmd!
execute 'autocmd SaveWindowParam VimLeave * call s:SaveWindowParam("'.s:infofile.'")'
augroup END
if filereadable(expand(s:infofile))
execute 'source '.s:infofile
endif
unlet s:infofile
"----------------------------------------
"メニューアイテム作成
"----------------------------------------
silent! aunmenu &File.Save
silent! aunmenu &File.保存(&S)
silent! aunmenu &File.差分表示(&D)\.\.\.
let message_revert="再読込しますか?"
amenu <silent> 10.330 &File.再読込(&U)<Tab>:e! :if confirm(message_revert, "&Yes\n&No")==1<Bar> e! <Bar> endif<CR>
amenu <silent> 10.331 &File.バッファ削除(&K)<Tab>:bd :confirm bd<CR>
amenu <silent> 10.340 &File.保存(&W)<Tab>:w :if expand('%') == ''<Bar>browse confirm w<Bar>else<Bar>confirm w<Bar>endif<CR>
amenu <silent> 10.341 &File.更新時保存(&S)<Tab>:update :if expand('%') == ''<Bar>browse confirm w<Bar>else<Bar>confirm update<Bar>endif<CR>
amenu <silent> 10.400 &File.現バッファ差分表示(&D)<Tab>:DiffOrig :DiffOrig<CR>
amenu <silent> 10.401 &File.裏バッファと差分表示(&D)<Tab>:Diff\ # :Diff #<CR>
amenu <silent> 10.402 &File.差分表示(&D)<Tab>:Diff :browse vertical diffsplit<CR>