Skip to content

Commit a42eb5f

Browse files
authored
Merge pull request #2118 from h-east/update-change
Update change.{txt,jax}
2 parents e761f2e + adcba42 commit a42eb5f

File tree

2 files changed

+113
-6
lines changed

2 files changed

+113
-6
lines changed

doc/change.jax

Lines changed: 56 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*change.txt* For Vim バージョン 9.1. Last change: 2025 May 28
1+
*change.txt* For Vim バージョン 9.1. Last change: 2025 Jun 26
22

33

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

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

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

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

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

18431845
[i]をつけると大文字・小文字を区別しない。
1844-
1846+
*:sort-l*
18451847
[l]をつけると現在のロケールの照合順序を使用してソート
18461848
する。
18471849
実装の詳細: 文字列の比較に strcoll() を使用する。ロケー
@@ -1875,13 +1877,14 @@ Vimはソート関数とソートコマンドを備えている。ソート関
18751877

18761878
[b] をつけると({pattern}によるマッチの後ろまたは内側の)
18771879
行の最初の2進数でソートする。
1878-
1880+
*:sort-u* *:sort-uniq*
18791881
[u]をつけると (u は unique=「一意の」という意味に基づ
18801882
く) 連続する同一行の最初の行だけを残す。([i]がつくと大
18811883
文字・小文字を無視する) このフラグがつかない場合、連続
18821884
する同一行はそのままの順序で残される。
18831885
Note: 先頭と末尾の空白が原因で異なる行にみなされるかも
18841886
しれない。
1887+
単にユニークにしたいだけの場合は、|:uniq| を使用する。
18851888

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

1930+
==============================================================================
1931+
8. テキストの重複除去 *deduplicating* *unique*
1932+
1933+
Vim には重複排除関数と重複排除コマンドがある。重複排除関数は |uniq()| で確認で
1934+
きる。
1935+
|:sort-uniq| も参照。
1936+
1937+
*:uni* *:uniq*
1938+
:[range]uni[q][!] [i][l][r][u] [/{pattern}/]
1939+
[range] 内で隣接する重複行を削除する。範囲を指定しない
1940+
場合は、すべての行が処理される。
1941+
1942+
[i] を指定すると、行を比較するときに大文字と小文字を区
1943+
別しない。
1944+
1945+
[l] を指定すると、現在の照合ロケールに基づいて比較が行
1946+
われる。詳細は |:sort-l| を参照。
1947+
1948+
[r] を指定すると、行全体ではなく /{pattern}/ にマッチ
1949+
するテキストに対して比較が行われる。
1950+
1951+
[u] を指定すると、繰り返されない行 (つまり、同じ行が直
1952+
後に続かない行) のみを保持する。
1953+
1954+
[!] を指定すると、直後に重複行がある行のみを保持する。
1955+
1956+
[!] と [u] の両方が指定された場合、[u] は無視され [!]
1957+
が適用される。
1958+
1959+
/{pattern}/ が指定され、[r] が指定されていない場合、
1960+
{pattern} にマッチするテキストはスキップされ、マッチの
1961+
後ろの部分で比較が行われる。
1962+
'ignorecase' はパターンに適用されるが、'smartcase'
1963+
使用されない。
1964+
スラッシュの代わりに、任意の非文字を使用できる。
1965+
1966+
例えば、2 番目のコンマ区切りフィールドに基づいて隣接す
1967+
る重複行を削除する場合: >
1968+
:uniq /[^,]*,/
1969+
< または、最初の 5 文字を無視してユニークな行のみを保持
1970+
する場合: >
1971+
:uniq u /.\{5}/
1972+
< {pattern} が空の場合 (例えば、// が使用されている場
1973+
合)、最後の検索パターンが使用される。
1974+
1975+
Note 先頭と末尾の空白により、行が異なるものとして扱わ
1976+
れる場合があることに注意。
1977+
位置に関係なくすべての重複を削除するには、|:sort-u|
1978+
たは外部ツールを使用すること。
1979+
19271980
vim:tw=78:ts=8:noet:ft=help:norl:

en/change.txt

Lines changed: 57 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*change.txt* For Vim version 9.1. Last change: 2025 May 28
1+
*change.txt* For Vim version 9.1. Last change: 2025 Jun 26
22

33

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

2425
For inserting text see |insert.txt|.
2526

@@ -1895,6 +1896,7 @@ And a few warnings:
18951896

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

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

19061908
With [i] case is ignored.
1907-
1909+
*:sort-l*
19081910
With [l] sort uses the current collation locale.
19091911
Implementation details: strcoll() is used to compare
19101912
strings. See |:language| to check or set the collation
@@ -1937,13 +1939,14 @@ found here: |sort()|, |uniq()|.
19371939

19381940
With [b] sorting is done on the first binary number in
19391941
the line (after or inside a {pattern} match).
1940-
1942+
*:sort-u* *:sort-uniq*
19411943
With [u] (u stands for unique) only keep the first of
19421944
a sequence of identical lines (ignoring case when [i]
19431945
is used). Without this flag, a sequence of identical
19441946
lines will be kept in their original order.
19451947
Note that leading and trailing white space may cause
19461948
lines to be different.
1949+
When you just want to make things unique, use |:uniq|.
19471950

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

1996+
==============================================================================
1997+
8. Deduplicating text *deduplicating* *unique*
1998+
1999+
Vim has a deduplicating function and a deduplicating command. The
2000+
deduplicating function can be found here: |uniq()|.
2001+
Also see |:sort-uniq|.
2002+
2003+
*:uni* *:uniq*
2004+
:[range]uni[q][!] [i][l][r][u] [/{pattern}/]
2005+
Remove duplicate lines that are adjacent to each other
2006+
in [range]. When no range is given, all lines are
2007+
processed.
2008+
2009+
With [i] case is ignored when comparing lines.
2010+
2011+
With [l] comparison uses the current collation locale.
2012+
See |:sort-l| for more details.
2013+
2014+
With [r] comparison is done on the text that matches
2015+
/{pattern}/ instead of the full line.
2016+
2017+
With [u] only keep lines that do not repeat (i.e., are
2018+
not immediately followed by the same line).
2019+
2020+
With [!] only keep lines that are immediately followed
2021+
by a duplicate.
2022+
2023+
If both [!] and [u] are given, [u] is ignored and [!]
2024+
takes effect.
2025+
2026+
When /{pattern}/ is specified and [r] is not used, the
2027+
text matched with {pattern} is skipped and comparison
2028+
is done on what comes after the match.
2029+
'ignorecase' applies to the pattern, but 'smartcase'
2030+
is not used.
2031+
Instead of the slash any non-letter can be used.
2032+
2033+
For example, to remove adjacent duplicate lines based
2034+
on the second comma-separated field: >
2035+
:uniq /[^,]*,/
2036+
< Or to keep only unique lines ignoring the first 5
2037+
characters: >
2038+
:uniq u /.\{5}/
2039+
< If {pattern} is empty (e.g. // is used), the last
2040+
search pattern is used.
2041+
2042+
Note that leading and trailing white space may cause
2043+
lines to be considered different.
2044+
To remove all duplicates regardless of position, use
2045+
|:sort-u| or external tools.
2046+
19932047
vim:tw=78:ts=8:noet:ft=help:norl:

0 commit comments

Comments
 (0)