Skip to content

Commit afb054c

Browse files
committed
vim73-kaoriya-win64-20110520
1 parent e1b7b6e commit afb054c

File tree

11 files changed

+311
-16
lines changed

11 files changed

+311
-16
lines changed

CHANGES_kaoriya.txt

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,33 @@
1+
=== 20110520�̕ύX�_ ===
2+
* enc=utf-8���p����cp932��ucs2-le�ɂȂ���Ɏb��Ώ����܂���
3+
* �x�[�X�R�[�h��7.3.198�ɍX�V���܂���
4+
5+
=== 20110511�̕ύX�_ ===
6+
* �x�[�X�R�[�h��7.3.189�ɍX�V���܂���
7+
8+
=== 20110507�̕ύX�_ ===
9+
* �x�[�X�R�[�h��7.3.177�ɍX�V���܂���
10+
11+
=== 20110429�̕ύX�_ ===
12+
* �x�[�X�R�[�h��7.3.170�ɍX�V���܂���
13+
* plugins����runtimepath�ɉ�������@��ύX���܂���
14+
* googletranslate.vim(by mattn����)����荞�݂܂���
15+
* switches�f�B���N�g������������
16+
* switches/enabled�Ƀt�@�C��*.vim���쐬����ƑΉ������@�\���L��������܂�
17+
* ���p�”\�ȋ@�\(�t�@�C��)��switches/catalog�ɒu���Ă���܂�
18+
* �e�@�\�̓��e�̓t�@�C�����̐������Q�Ƃ��Ă�������
19+
20+
=== 20110412�̕ύX�_ ===
21+
* �x�[�X�R�[�h��7.3.161�ɍX�V���܂���
22+
23+
=== 20110403�̕ύX�_ ===
24+
* �x�[�X�R�[�h��7.3.154�ɍX�V���܂���
25+
* Ruby�C���^�[�t�F�[�X��L�������܂���
26+
* Thanks to h_east! >> http://d.hatena.ne.jp/h_east/20110403/p1
27+
28+
=== 20110402�̕ύX�_ ===
29+
* �x�[�X�R�[�h��7.3.152�ɍX�V���܂���
30+
131
=== 20110323�̕ύX�_ ===
232
* �x�[�X�R�[�h��7.3.143�ɍX�V���܂���
333
* �|��(src/po/ja*.po)���C�����܂���

README_kaoriya.txt

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
Vim version 7.3 ���艮�� �����}�j���A��
22

3-
Version: 1.6.2
3+
Version: 1.6.4
44
Author: MURAOKA Taro
55
Since: 23-Aug-1999
6-
Last Change: 21-Mar-2011.
6+
Last Change: 29-Apr-2011.
77

88
�T�v
99
Vim��vi�N���[���ɕ��ނ����e�L�X�g�G�f�B�^�ł��B
@@ -116,14 +116,20 @@ Vim
116116
http://luabinaries.sourceforge.net/
117117

118118
Ruby�Ƃ̘A�g
119-
����: Ruby�Ƃ̘A�g�@�\�͒񋟂������܂���B
119+
����: Ruby���C���X�g�[�����Ȃ��Ă�Vim�͎g�p�ł��܂��B
120120

121-
��ʓI�ɔz�z����Ă���Ruby(64bit��)�Ƃ̊ԂŃR���p�C���̃o�[�W�������قȂ�
122-
���߁AVim���őΉ����邱�Ƃ��e�Ղł͂���܂���B
121+
Ruby-mswin32��1.9.2���C���X�g�[�����邱�ƂŁARuby�C���^�[�t�F�[�X�𗘗p��
122+
���܂��BRuby���C���X�g�[�����Ă��Ȃ��ꍇ�́ARuby�C���^�[�t�F�[�G�X�͎����I
123+
�ɖ����ƂȂ�܂��BRuby�C���^�[�t�F�[�X�̏ڍׂɂ‚��Ă�":help ruby"�Ƃ���
124+
Vim�t���̃}�j���A�����Q�Ƃ��Ă��������B
125+
126+
64bit�ł�Vim���g���ꍇ��64bit�ł�Ruby���A32bit�ł��g���ꍇ��32bit�ł�
127+
Ruby���C���X�g�[�������������B
123128

124129
- Ruby-mswin32 �z�z�T�C�g
125-
http://www.ruby-lang.org/ja/
126130
http://www.garbagecollect.jp/ruby/mswin32/ja/
131+
- Ruby�S�ʂ̏��
132+
http://www.ruby-lang.org/ja/
127133

128134
�g�p����
129135
���艮�ł̃��C�Z���X�̓I���W�i����Vim�ɏ]���܂��B�ڂ�����origdoc/README.txt
@@ -190,6 +196,7 @@ Vim
190196
http://code.google.com/p/vimdoc-ja/?hl=ja
191197
- ���艮�Ń����e�i
192198
MURAOKA Taro <[email protected]>
199+
Twitter @kaoriya
193200

194201
�ӎ�
195202
�������A�f���炵���G�f�B�^�ł���Vim���t���[�\�t�g�E�F�A�Ƃ��Č��J&�Ǘ����A
@@ -207,6 +214,7 @@ Vim
207214
runtime/keymap/tutcode_cp932.vim
208215
- MATSUMOTO Yasuhiro <[email protected]>
209216
diffs/ (�ꕔ�R�[�h���p/�A�h�o�C�X/�V�ђ���)
217+
googletranslate.vim
210218
- NAKADAIRA Yukihiro <http://code.google.com/u/yukihiro.nakadaira/>
211219
plugins/autofmt
212220
- NISHIOKA Takuhiro <[email protected]>

plugins/googletranslate/README.mkd

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# googletranslate.vim
2+
3+
### Description
4+
Translate text using Google Translate API.
5+
6+
### Usage
7+
:GoogleTranslate
8+
translate current line.
9+
10+
:'<,'>GoogleTranslate
11+
translate text that blockwize visual.
12+
13+
:GoogleTranslate ja
14+
translate current line to japanese.
15+
16+
:GoogleTranslate zh-cn ja
17+
translate current line from chinese to japanese.
18+
19+
:GoogleTranslate zh-cn ja 谷歌翻译
20+
translate '谷歌翻译' from chinese to japanese.
21+
22+
:Trans
23+
alias for :GoogleTranslate
24+
25+
### See Also
26+
- <http://www.vim.org/scripts/script.php?script_id=2609>
27+
- <http://www.vim.org/scripts/script.php?script_id=2996>
28+
- <http://oracleabc.com/b/archives/665>
29+
- :h mlang.txt
30+
- :h locale
31+
- :h language
32+
- :h v:lang
33+
34+
### Author
35+
* mattn
36+
* hotoo
Lines changed: 187 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,187 @@
1+
" vim:set ts=8 sts=2 sw=2 tw=0:
2+
"
3+
" googletranslate.vim - Translate between English and Locale Language
4+
" using Google
5+
" @see [http://code.google.com/apis/ajaxlanguage/ Google AJAX Language API]
6+
"
7+
" Author: Yasuhiro Matsumoto <[email protected]>
8+
" Contribute: hotoo (闲耘™)
9+
" Contribute: MURAOKA Taro <[email protected]>
10+
" Based On: excitetranslate.vim
11+
" Last Change: 29-Apr-2011.
12+
13+
if !exists('g:googletranslate_options')
14+
let g:googletranslate_options = ["register","buffer"]
15+
endif
16+
" default language setting.
17+
if !exists('g:googletranslate_locale')
18+
let g:googletranslate_locale = substitute(v:lang, '^\([a-z]*\).*$', '\1', '')
19+
endif
20+
21+
let s:endpoint = 'http://ajax.googleapis.com/ajax/services/language/translate'
22+
23+
function! s:CheckLang(word)
24+
let all = strlen(a:word)
25+
let eng = strlen(substitute(a:word, '[^\t -~]', '', 'g'))
26+
return eng * 2 < all ? '' : 'en'
27+
endfunction
28+
29+
function! s:nr2byte(nr)
30+
if a:nr < 0x80
31+
return nr2char(a:nr)
32+
elseif a:nr < 0x800
33+
return nr2char(a:nr/64+192).nr2char(a:nr%64+128)
34+
else
35+
return nr2char(a:nr/4096%16+224).nr2char(a:nr/64%64+128).nr2char(a:nr%64+128)
36+
endif
37+
endfunction
38+
39+
function! s:nr2enc_char(charcode)
40+
if &encoding == 'utf-8'
41+
return nr2char(a:charcode)
42+
endif
43+
let char = s:nr2byte(a:charcode)
44+
if strlen(char) > 1
45+
let char = strtrans(iconv(char, 'utf-8', &encoding))
46+
endif
47+
return char
48+
endfunction
49+
50+
" @see http://vim.g.hatena.ne.jp/eclipse-a/20080707/1215395816
51+
function! s:char2hex(c)
52+
if a:c =~# '^[:cntrl:]$' | return '' | endif
53+
let r = ''
54+
for i in range(strlen(a:c))
55+
let r .= printf('%%%02X', char2nr(a:c[i]))
56+
endfor
57+
return r
58+
endfunction
59+
function! s:encodeURI(s)
60+
return substitute(a:s, '[^0-9A-Za-z-._~!''()*#$&+,/:;=?@]',
61+
\ '\=s:char2hex(submatch(0))', 'g')
62+
endfunction
63+
function! s:encodeURIComponent(s)
64+
return substitute(a:s, '[^0-9A-Za-z-._~!''()*]',
65+
\ '\=s:char2hex(submatch(0))', 'g')
66+
endfunction
67+
68+
function! s:quote(s)
69+
let q = '"'
70+
if &shellxquote == '"'
71+
let q = "'"
72+
endif
73+
return q.a:s.q
74+
endfunction
75+
76+
function! GoogleTranslate(word, from, to)
77+
if !executable("curl")
78+
echohl WarningMsg
79+
echo "GoogleTranslate require 'curl' command."
80+
echohl None
81+
return
82+
endif
83+
let mode = a:from . "|" . a:to
84+
let data = 'v=1.0&langpair='.mode.'&q='.s:encodeURIComponent(a:word)
85+
let oldshellredir=&shellredir
86+
setlocal shellredir=>
87+
let text = system("curl -s -d ".s:quote(data)." ".s:endpoint)
88+
let &shellredir=oldshellredir
89+
let text = iconv(text, "utf-8", &encoding)
90+
let text = substitute(text, '\\u\(\x\x\x\x\)', '\=s:nr2enc_char("0x".submatch(1))', 'g')
91+
let [null,true,false] = [0,1,0]
92+
let obj = eval(text)
93+
if type(obj.responseData) == 4
94+
let text = obj.responseData.translatedText
95+
let text = substitute(text, '&gt;', '>', 'g')
96+
let text = substitute(text, '&lt;', '<', 'g')
97+
let text = substitute(text, '&quot;', '"', 'g')
98+
let text = substitute(text, '&apos;', "'", 'g')
99+
let text = substitute(text, '&nbsp;', ' ', 'g')
100+
let text = substitute(text, '&yen;', '\&#65509;', 'g')
101+
let text = substitute(text, '&#\(\d\+\);', '\=s:nr2enc_char(submatch(1))', 'g')
102+
let text = substitute(text, '&amp;', '\&', 'g')
103+
else
104+
if !has_key(obj, 'responseDetails')
105+
let obj.responseDetails = 'unknown server error'
106+
endif
107+
echohl WarningMsg
108+
echo obj.responseDetails
109+
echohl None
110+
let text = ''
111+
endif
112+
return text
113+
endfunction
114+
115+
function! GoogleTranslateRange(...) range
116+
" Concatenate input string.
117+
let curline = a:firstline
118+
let strline = ''
119+
120+
if a:0 >= 3
121+
let strline = a:3
122+
else
123+
while curline <= a:lastline
124+
let tmpline = substitute(getline(curline), '^\s\+\|\s\+$', '', 'g')
125+
if tmpline=~ '\m^\a' && strline =~ '\m\a$'
126+
let strline = strline .' '. tmpline
127+
else
128+
let strline = strline . tmpline
129+
endif
130+
let curline = curline + 1
131+
endwhile
132+
endif
133+
134+
let from = ''
135+
let to = g:googletranslate_locale
136+
if a:0 == 0
137+
let from = s:CheckLang(strline)
138+
let to = 'en'==from ? g:googletranslate_locale : 'en'
139+
elseif a:0 == 1
140+
let to = a:1
141+
elseif a:0 >= 2
142+
let from = a:1
143+
let to = a:2
144+
endif
145+
146+
" Do translate.
147+
let jstr = GoogleTranslate(strline, from, to)
148+
if len(jstr) == 0
149+
return
150+
endif
151+
152+
" Echo
153+
if index(g:googletranslate_options, 'echo') != -1
154+
echo jstr
155+
endif
156+
" Put to buffer.
157+
if index(g:googletranslate_options, 'buffer') != -1
158+
" Open or go result buffer.
159+
let bufname = '==Google Translate=='
160+
let winnr = bufwinnr(bufname)
161+
if winnr < 1
162+
silent execute 'below 10new '.escape(bufname, ' ')
163+
nmap <buffer> q :<c-g><c-u>bw!<cr>
164+
vmap <buffer> q :<c-g><c-u>bw!<cr>
165+
else
166+
if winnr != winnr()
167+
execute winnr.'wincmd w'
168+
endif
169+
endif
170+
setlocal buftype=nofile bufhidden=hide noswapfile wrap ft=
171+
" Append translated string.
172+
if line('$') == 1 && getline('$').'X' ==# 'X'
173+
call setline(1, jstr)
174+
else
175+
call append(line('$'), '--------')
176+
call append(line('$'), jstr)
177+
endif
178+
normal! Gzt
179+
endif
180+
" Put to unnamed register.
181+
if index(g:googletranslate_options, 'register') != -1
182+
let @" = jstr
183+
endif
184+
endfunction
185+
186+
command! -nargs=* -range GoogleTranslate <line1>,<line2>call GoogleTranslateRange(<f-args>)
187+
command! -nargs=* -range Trans <line1>,<line2>call GoogleTranslateRange(<f-args>)
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
scriptencoding utf-8
2+
" vim:set ts=8 sts=2 sw=2 tw=0 et:
3+
"
4+
" Switches by existance of files in $VIM/switches/enabled directory.
5+
"
6+
" (ほぼ)起動時の$VIM/switches/enabledディレクトリ下のファイルの有無を調べるス
7+
" イッチ.
8+
"
9+
" Last Change: 29-Apr-2011.
10+
" Maintainer: MURAOKA Taro <[email protected]>
11+
12+
let g:kaoriya_switch = {}
13+
for path in split(glob($VIM.'/switches/enabled/*.vim'), '\n')
14+
let g:kaoriya_switch[fnamemodify(path, ':t:r')] = 1
15+
endfor
16+
17+
function! kaoriya#switch#enabled(name)
18+
if exists('g:kaoriya_switch')
19+
if has_key(g:kaoriya_switch, a:name)
20+
return g:kaoriya_switch[a:name]
21+
endif
22+
endif
23+
return 0
24+
endfunction

plugins/kaoriya/encode_japan.vim

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"
33
" 日本語向けにエンコードを設定するサンプル - Vim7用
44
"
5-
" Last Change: 01-Aug-2007.
6-
" Maintainer: MURAOKA Taro <koron@tka.att.ne.jp>
5+
" Last Change: 15-May-2011.
6+
" Maintainer: MURAOKA Taro <koron[email protected]>
77

88
" 各エンコードを示す文字列のデフォルト値。s:CheckIconvCapabilityを()呼ぶことで
99
" 実環境に合わせた値に修正される。
@@ -39,7 +39,7 @@ function! s:DetermineFileencodings()
3939
let value = 'ucs-bom,ucs-2le,ucs-2'
4040
if &encoding ==? 'utf-8'
4141
" UTF-8環境向けにfileencodingsを設定する
42-
let value = value. ','.s:enc_jisx. ','.s:enc_cp932. ','.s:enc_eucjp
42+
let value = s:enc_jisx. ','.s:enc_cp932. ','.s:enc_eucjp. ','.value
4343
elseif &encoding ==? 'cp932'
4444
" CP932環境向けにfileencodingsを設定する
4545
let value = value. ','.s:enc_jisx. ','.s:enc_utf8. ','.s:enc_eucjp
@@ -58,6 +58,10 @@ endfunction
5858

5959
" 本ファイルを読み込み(sourceした)時に、最適な設定を実行する。
6060
"
61-
set encoding=japan
61+
if kaoriya#switch#enabled('utf-8')
62+
set encoding=utf-8
63+
else
64+
set encoding=japan
65+
endif
6266
call s:CheckIconvCapability()
6367
call s:DetermineFileencodings()

runtime/tutor/tutor.ja.euc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ NOTE:
259259

260260
1. �ʲ��� ---> �ȼ����줿�Ԥ���Ƭ�˥���������ư���ޤ���
261261

262-
2. 2dw �򥿥��פ���ñ��2��ʬ��ư���ޤ���
262+
2. 2dw �򥿥��פ���ñ��2��ʬ�����ޤ���
263263

264264
3. 3e �򥿥��פ���3���ܤ�ñ��ν�ü�˰�ư���ޤ���
265265

runtime/tutor/tutor.ja.sjis

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ NOTE:
259259

260260
1. �ȉ��� ---> �Ǝ����ꂽ�s�̐擪�ɃJ�[�\�����ړ����܂��B
261261

262-
2. 2dw ���^�C�v���ĒP��2�•��ړ����܂��B
262+
2. 2dw ���^�C�v���ĒP��2�•�����܂��B
263263

264264
3. 3e ���^�C�v����3�–ڂ̒P��̏I�[�Ɉړ����܂��B
265265

runtime/tutor/tutor.ja.utf-8

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ NOTE: 冒険したい人は、ノーマルモードにてコマンドなしに
259259

260260
1. 以下の ---> と示された行の先頭にカーソルを移動します。
261261

262-
2. 2dw をタイプして単語2つ分移動します
262+
2. 2dw をタイプして単語2つ分削除します
263263

264264
3. 3e をタイプして3つ目の単語の終端に移動します。
265265

0 commit comments

Comments
 (0)