Skip to content

Commit 124bb73

Browse files
authored
Merge pull request #1718 from vim-jp/hh-update-if_tcl
Update if_tcl.{txt,jax}
2 parents 2c08fc3 + cf74049 commit 124bb73

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

doc/if_tcl.jax

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*if_tcl.txt* For Vim バージョン 9.1. Last change: 2022 Jan 08
1+
*if_tcl.txt* For Vim バージョン 9.1. Last change: 2024 Oct 05
22

33

44
VIMリファレンスマニュアル by Ingo Wilken
@@ -458,14 +458,14 @@ stdinからの入力は、今のところサポートされていない。
458458
いくつかの小さな(そして、たぶん役に立つ)Tclスクリプトを紹介しよう。
459459

460460
このスクリプトはバッファ全体の行をソートする(名前のリストとか、そのようなも
461-
のであると仮定する):
461+
のであると仮定する): >
462462
set buf $::vim::current(buffer)
463463
set lines [$buf get top bottom]
464464
set lines [lsort -dictionary $lines]
465465
$buf set top bottom $lines
466466
467-
このスクリプトは、バッファ内の行を反転する。"::vim::lbase" と "$buf last" は、
468-
どんな行番号の設定でも機能することに注目
467+
このスクリプトは、バッファ内の行を反転する。Note "::vim::lbase" と "$buf last"
468+
は、どんな行番号の設定でも機能することに注目: >
469469
set buf $::vim::current(buffer)
470470
set t $::vim::lbase
471471
set b [$buf last]
@@ -478,7 +478,7 @@ stdinからの入力は、今のところサポートされていない。
478478
incr b -1
479479
}
480480
481-
このスクリプトは、現在の範囲の各行に連続した番号を付け加える:
481+
このスクリプトは、現在の範囲の各行に連続した番号を付け加える: >
482482
set buf $::vim::current(buffer)
483483
set i $::vim::range(start)
484484
set n 1
@@ -488,25 +488,25 @@ stdinからの入力は、今のところサポートされていない。
488488
incr i ; incr n
489489
}
490490
491-
同じことが、":tcldo" による2つのexコマンドで、より迅速に行える:
491+
同じことが、":tcldo" による2つのexコマンドで、より迅速に行える: >
492492
:tcl set n 1
493493
:[range]tcldo set line "$n\t$line" ; incr n
494494
495-
このプロシージャは、各バッファでexコマンドを走らせる(Ron Aaron氏のアイデア):
495+
このプロシージャは、各バッファでexコマンドを走らせる(Ron Aaron氏のアイデア): >
496496
proc eachbuf { cmd } {
497497
foreach b [::vim::buffer list] {
498498
$b command $cmd
499499
}
500500
}
501-
こんな風に使う:
501+
こんな風に使う: >
502502
:tcl eachbuf %s/foo/bar/g
503503
Tclの文字列とバックスラッシュの置換には気をつけてほしい。疑わしいときは、丸括
504504
弧でexコマンドを括っておくとよい。
505505

506506

507507
いくつかのTclコマンドをずっとvimで使いたいというなら、それらをファイル(例えば
508508
Unixマシンでは "~/.vimrc.tcl" など)に入れておき、スタートアップファイル(Unixマ
509-
シンなら標準で "~/.vimrc")に以下の行を付け加える:
509+
シンなら標準で "~/.vimrc")に以下の行を付け加える: >
510510
if has("tcl")
511511
tclfile ~/.vimrc.tcl
512512
endif

en/if_tcl.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*if_tcl.txt* For Vim version 9.1. Last change: 2022 Jan 08
1+
*if_tcl.txt* For Vim version 9.1. Last change: 2024 Oct 05
22

33

44
VIM REFERENCE MANUAL by Ingo Wilken
@@ -461,14 +461,14 @@ Input from stdin is currently not supported.
461461
Here are a few small (and maybe useful) Tcl scripts.
462462

463463
This script sorts the lines of the entire buffer (assume it contains a list
464-
of names or something similar):
464+
of names or something similar): >
465465
set buf $::vim::current(buffer)
466466
set lines [$buf get top bottom]
467467
set lines [lsort -dictionary $lines]
468468
$buf set top bottom $lines
469469
470470
This script reverses the lines in the buffer. Note the use of "::vim::lbase"
471-
and "$buf last" to work with any line number setting.
471+
and "$buf last" to work with any line number setting: >
472472
set buf $::vim::current(buffer)
473473
set t $::vim::lbase
474474
set b [$buf last]
@@ -481,7 +481,7 @@ and "$buf last" to work with any line number setting.
481481
incr b -1
482482
}
483483
484-
This script adds a consecutive number to each line in the current range:
484+
This script adds a consecutive number to each line in the current range: >
485485
set buf $::vim::current(buffer)
486486
set i $::vim::range(start)
487487
set n 1
@@ -491,25 +491,25 @@ This script adds a consecutive number to each line in the current range:
491491
incr i ; incr n
492492
}
493493
494-
The same can also be done quickly with two Ex commands, using ":tcldo":
494+
The same can also be done quickly with two Ex commands, using ":tcldo": >
495495
:tcl set n 1
496496
:[range]tcldo set line "$n\t$line" ; incr n
497497
498-
This procedure runs an Ex command on each buffer (idea stolen from Ron Aaron):
498+
This procedure runs an Ex command on each buffer (idea stolen from Ron Aaron): >
499499
proc eachbuf { cmd } {
500500
foreach b [::vim::buffer list] {
501501
$b command $cmd
502502
}
503503
}
504-
Use it like this:
504+
Use it like this: >
505505
:tcl eachbuf %s/foo/bar/g
506506
Be careful with Tcl's string and backslash substitution, tough. If in doubt,
507507
surround the Ex command with curly braces.
508508

509509

510510
If you want to add some Tcl procedures permanently to vim, just place them in
511511
a file (e.g. "~/.vimrc.tcl" on Unix machines), and add these lines to your
512-
startup file (usually "~/.vimrc" on Unix):
512+
startup file (usually "~/.vimrc" on Unix): >
513513
if has("tcl")
514514
tclfile ~/.vimrc.tcl
515515
endif

0 commit comments

Comments
 (0)