-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gvimrc
122 lines (105 loc) · 3.32 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
117
118
119
120
121
122
"----------------------------------------
"システム設定
"----------------------------------------
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 guioptions-=m
"メニューバー初期化
"source $VIMRUNTIME/delmenu.vim
"set langmenu=ja_jp.utf-8
"source $VIMRUNTIME/menu.vim
"カラー設定:
colorscheme mycolor
if executable("vimtweak.dll")
autocmd guienter * call libcallnr("vimtweak","SetAlpha",200)
endif
"フォント設定
"フォントは英語名で指定すると問題が起きにくくなります
if has('xfontset')
" set guifontset=a14,r14,k14
elseif has('unix')
elseif has('mac')
set guifont=Osaka-Mono:h14
elseif has('win32') || has('win64')
scriptencoding cp932
" set guifont=MS_Gothic:h12:cSHIFTJIS
" set guifontwide=MS_Gothic:h12:cSHIFTJIS
endif
if has('gui_running') && has ('mac')
set fuoptions=maxvert,maxhorz
"au GUIEnter * set fullscreen
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 = '~/.vim/.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>
if has('win32') && has('kaoriya')
gui
set transparency=180
endif