Skip to content

Update change.{txt,jax} #2118

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 56 additions & 3 deletions doc/change.jax
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*change.txt* For Vim バージョン 9.1. Last change: 2025 May 28
*change.txt* For Vim バージョン 9.1. Last change: 2025 Jun 26


VIMリファレンスマニュアル by Bram Moolenaar
Expand All @@ -20,6 +20,7 @@
5. テキストのコピーと移動 |copy-move|
6. テキストの整形 |formatting|
7. テキストのソート |sorting|
8. テキストの重複除去 |deduplicating|

テキストの挿入に関しては |insert.txt| を参照。

Expand Down Expand Up @@ -1832,6 +1833,7 @@ autocommand と連携して、クールに振舞うはずである。

Vimはソート関数とソートコマンドを備えている。ソート関数については |sort()|、
|uniq()| を参照。
|:uniq| も参照。

*:sor* *:sort*
:[range]sor[t][!] [b][f][i][l][n][o][r][u][x] [/{pattern}/]
Expand All @@ -1841,7 +1843,7 @@ Vimはソート関数とソートコマンドを備えている。ソート関
[!]をつけると順序が逆になる。

[i]をつけると大文字・小文字を区別しない。

*:sort-l*
[l]をつけると現在のロケールの照合順序を使用してソート
する。
実装の詳細: 文字列の比較に strcoll() を使用する。ロケー
Expand Down Expand Up @@ -1875,13 +1877,14 @@ Vimはソート関数とソートコマンドを備えている。ソート関

[b] をつけると({pattern}によるマッチの後ろまたは内側の)
行の最初の2進数でソートする。

*:sort-u* *:sort-uniq*
[u]をつけると (u は unique=「一意の」という意味に基づ
く) 連続する同一行の最初の行だけを残す。([i]がつくと大
文字・小文字を無視する) このフラグがつかない場合、連続
する同一行はそのままの順序で残される。
Note: 先頭と末尾の空白が原因で異なる行にみなされるかも
しれない。
単にユニークにしたいだけの場合は、|:uniq| を使用する。

/pattern/が指定され、フラグ[r]がない場合は{pattern}に
マッチするテキストはスキップされる。これによって、その
Expand Down Expand Up @@ -1924,4 +1927,54 @@ Note: `:global` といっしょに `:sort` を使ってもマッチする行を
ソートは中断することができる。しかし中断するのが遅いと行が重複してしまうかもし
れない。これも使っているシステムのライブラリ関数による。

==============================================================================
8. テキストの重複除去 *deduplicating* *unique*

Vim には重複排除関数と重複排除コマンドがある。重複排除関数は |uniq()| で確認で
きる。
|:sort-uniq| も参照。

*:uni* *:uniq*
:[range]uni[q][!] [i][l][r][u] [/{pattern}/]
[range] 内で隣接する重複行を削除する。範囲を指定しない
場合は、すべての行が処理される。

[i] を指定すると、行を比較するときに大文字と小文字を区
別しない。

[l] を指定すると、現在の照合ロケールに基づいて比較が行
われる。詳細は |:sort-l| を参照。

[r] を指定すると、行全体ではなく /{pattern}/ にマッチ
するテキストに対して比較が行われる。

[u] を指定すると、繰り返されない行 (つまり、同じ行が直
後に続かない行) のみを保持する。

[!] を指定すると、直後に重複行がある行のみを保持する。

[!] と [u] の両方が指定された場合、[u] は無視され [!]
が適用される。

/{pattern}/ が指定され、[r] が指定されていない場合、
{pattern} にマッチするテキストはスキップされ、マッチの
後ろの部分で比較が行われる。
'ignorecase' はパターンに適用されるが、'smartcase' は
使用されない。
スラッシュの代わりに、任意の非文字を使用できる。

例えば、2 番目のコンマ区切りフィールドに基づいて隣接す
る重複行を削除する場合: >
:uniq /[^,]*,/
< または、最初の 5 文字を無視してユニークな行のみを保持
する場合: >
:uniq u /.\{5}/
< {pattern} が空の場合 (例えば、// が使用されている場
合)、最後の検索パターンが使用される。

Note 先頭と末尾の空白により、行が異なるものとして扱わ
れる場合があることに注意。
位置に関係なくすべての重複を削除するには、|:sort-u| ま
たは外部ツールを使用すること。

vim:tw=78:ts=8:noet:ft=help:norl:
60 changes: 57 additions & 3 deletions en/change.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*change.txt* For Vim version 9.1. Last change: 2025 May 28
*change.txt* For Vim version 9.1. Last change: 2025 Jun 26


VIM REFERENCE MANUAL by Bram Moolenaar
Expand All @@ -20,6 +20,7 @@ commands with the "." command.
5. Copying and moving text |copy-move|
6. Formatting text |formatting|
7. Sorting text |sorting|
8. Deduplicating text |deduplicating|

For inserting text see |insert.txt|.

Expand Down Expand Up @@ -1895,6 +1896,7 @@ And a few warnings:

Vim has a sorting function and a sorting command. The sorting function can be
found here: |sort()|, |uniq()|.
Also see |:uniq|.

*:sor* *:sort*
:[range]sor[t][!] [b][f][i][l][n][o][r][u][x] [/{pattern}/]
Expand All @@ -1904,7 +1906,7 @@ found here: |sort()|, |uniq()|.
With [!] the order is reversed.

With [i] case is ignored.

*:sort-l*
With [l] sort uses the current collation locale.
Implementation details: strcoll() is used to compare
strings. See |:language| to check or set the collation
Expand Down Expand Up @@ -1937,13 +1939,14 @@ found here: |sort()|, |uniq()|.

With [b] sorting is done on the first binary number in
the line (after or inside a {pattern} match).

*:sort-u* *:sort-uniq*
With [u] (u stands for unique) only keep the first of
a sequence of identical lines (ignoring case when [i]
is used). Without this flag, a sequence of identical
lines will be kept in their original order.
Note that leading and trailing white space may cause
lines to be different.
When you just want to make things unique, use |:uniq|.

When /{pattern}/ is specified and there is no [r] flag
the text matched with {pattern} is skipped, so that
Expand Down Expand Up @@ -1990,4 +1993,55 @@ The sorting can be interrupted, but if you interrupt it too late in the
process you may end up with duplicated lines. This also depends on the system
library function used.

==============================================================================
8. Deduplicating text *deduplicating* *unique*

Vim has a deduplicating function and a deduplicating command. The
deduplicating function can be found here: |uniq()|.
Also see |:sort-uniq|.

*:uni* *:uniq*
:[range]uni[q][!] [i][l][r][u] [/{pattern}/]
Remove duplicate lines that are adjacent to each other
in [range]. When no range is given, all lines are
processed.

With [i] case is ignored when comparing lines.

With [l] comparison uses the current collation locale.
See |:sort-l| for more details.

With [r] comparison is done on the text that matches
/{pattern}/ instead of the full line.

With [u] only keep lines that do not repeat (i.e., are
not immediately followed by the same line).

With [!] only keep lines that are immediately followed
by a duplicate.

If both [!] and [u] are given, [u] is ignored and [!]
takes effect.

When /{pattern}/ is specified and [r] is not used, the
text matched with {pattern} is skipped and comparison
is done on what comes after the match.
'ignorecase' applies to the pattern, but 'smartcase'
is not used.
Instead of the slash any non-letter can be used.

For example, to remove adjacent duplicate lines based
on the second comma-separated field: >
:uniq /[^,]*,/
< Or to keep only unique lines ignoring the first 5
characters: >
:uniq u /.\{5}/
< If {pattern} is empty (e.g. // is used), the last
search pattern is used.

Note that leading and trailing white space may cause
lines to be considered different.
To remove all duplicates regardless of position, use
|:sort-u| or external tools.

vim:tw=78:ts=8:noet:ft=help:norl: