Skip to content

Update syntax.{txt,jax} #1215

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

Closed
wants to merge 18 commits into from
Closed
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
66 changes: 57 additions & 9 deletions doc/syntax.jax
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*syntax.txt* For Vim バージョン 9.0. Last change: 2022 Jun 10
*syntax.txt* For Vim バージョン 9.0. Last change: 2022 Dec 26


VIMリファレンスマニュアル by Bram Moolenaar
Expand Down Expand Up @@ -671,6 +671,22 @@ Vim 内での表示と同じように表示され、タブ文字もそのまま
>
:let g:html_no_pre = 1
<
*g:html_no_doc*
初期設定: 0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(これは、 @cmplstofB さんへの指摘ではありません)
このPRがmergeされた後で、#1216 の作業をおこないます。

1 の場合、DOCTYPE, <head>, <body> などを含む完全な HTML ドキュメントは生成され
ない。|g:html_use_css| が有効になっている場合 (デフォルト)、CSS を手動で定義す
る必要がある。|g:html_dynamic_folds| および |g:html_line_ids| 設定 (デフォルト
ではオフ) も、いくつかの JavaScript を挿入する。


*g:html_no_links*
初期設定: 0
URL のようなテキストには <a> タグを生成しない。

*g:html_no_modeline*
初期設定: 0
折り畳みを無効化するモードラインを生成しない。

*g:html_expand_tabs*
初期設定: 'tabstop' が 8 で 'expandtab' が 0 で 'vartabstop' が使われていない、
かつ、foldcolumn と行番号がない場合は 0。
Expand Down Expand Up @@ -1810,6 +1826,16 @@ htmlプロセッサー言語は複数ある。html.vimはインクルードし
そしてプリプロセッサー言語を含むすべての領域をクラスタhtmlPreprocに加えればよ
い。

*html-folding*
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

空白部分、原文まま(タブ7つ)でお願いします。

HTML 構文ファイルは、開始タグと終了タグ間の構文折り畳み |folding| (|:syn-fold|
を参照) を提供する。これは次の方法でオンにできる >

:let g:html_syntax_folding = 1
:set foldmethod=syntax

Note: 構文による折り畳みは、構文ハイライトを著しく遅くする可能性がある。特に巨
大なファイルではそうである。


HTML/OS (by Aestiva) *htmlos.vim* *ft-htmlos-syntax*

Expand Down Expand Up @@ -2924,6 +2950,15 @@ Append/Change/Insertコマンドに含まれるテキストいずれかの中の
る)。このオプションを有効化するなら、タブ幅を1文字にするとよい。そうすると文字
列中のタブの数を数えやすくなる。

GNU sed では、同じ行のテキストの後ろにコメントを書くことができる。BSD sed では
"#" が行頭である場合にしかコメントとみなされない。BSD 形式のコメントを強制す
る、すなわち行末コメントをエラーとして表示するには: >

:let g:sed_dialect = "bsd"
<
Note GNU sed と BSD sed の間には、この設定によって (まだ) 影響を受けていない他
の違いがある。

バグ:

変換コマンド(y)は置換コマンドとまったく同様に扱われる。つまり、この構文ファ
Expand Down Expand Up @@ -3306,16 +3341,20 @@ LOCALMATHをあなたが決めた新しいmathグループに書き換える必
*tex-style* *b:tex_stylish*
Tex: 新しいスタイルを始めるには ~

*.texファイルで "\makeatletter" を使う人がいるかもしれないので、コマンド中で
"@" が使えるようになっている。しかし*.texファイルは次の拡張子: sty cls clo dtx
ltx を持たないので @ をエラーと判断してハイライトする。これを解決するにはこう
する: >
"\makeatletter" を用いれば、*.tex ファイルのなかで "@" という文字を含むコマンド
を利用できる。しかしながら、拡張子が sty cls clo dtx ltx のどれでもない場合、@
を含むコマンドはエラーとして表示される。これを解決するには: >
Comment on lines +3344 to +3346
Copy link
Member

@h-east h-east Jan 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • sufficessuffixesのtypoですね。typo報告スレに差分張りました。
    (extensions が妥当な気がする)
    ところで、clo だけ filetype.vim に見つからないですね。これもtypoなんでしょうか?

  • 直訳に寄せました。いかがでしょうか?

Suggested change
"\makeatletter" を用いれば、*.tex ファイルのなかで "@" という文字を含むコマンド
を利用できる。しかしながら、拡張子が sty cls clo dtx ltx のどれでもない場合、@
を含むコマンドはエラーとして表示される。これを解決するには: >
*.tex ファイルで "\makeatletter" を使用すると、"@" を含むコマンドを使用できる
ようになる。しかしながら、*.tex ファイルは sty cls clo dtx ltx のいずれかの接
尾辞ではないため、構文の強調表示によって @ の使用箇所がエラーとして表示される。
これを解決するには: >

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ここのsuffixはファイル拡張子のことを表していると思うのですが、「接尾辞」と訳すべきでしょうか。

参考

https://github.com/vim/vim/blob/ce93d162da8de2419c15b63286e2f72a8fe3bf2d/runtime/syntax/tex.vim#L81-L95

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

今はsuffixesになっているので、「接尾辞」でお願いします。
私がtypoのコメントで「(extensions が妥当な気がする)」と言っているのでそちらに反応して欲しかったです。

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ところで、clo だけ filetype.vim に見つからないですね。これもtypoなんでしょうか?

syntax/tex.vim には含まれているので typo ではなさそうです。


:let b:tex_stylish = 1
:set ft=tex

"let g:tex_stylish=1" を<.vimrc>に書くと<syntax/tex.vim>は常にこのような @ の
使用法を受け入れるようになる。
{訳注: この挙動は、おもに LaTeX において、「@ を含むコマンドは開発用途として
使う」という取り決めがあることに由来する(と思われる)。ちょうど、一般のプログ
ラミング言語における隠蔽変数のようなものである。「普通の」TeX ファイルを編集
するさいには、そのようなコマンドを扱うことはないから、@ を含んだコマンドが
「エラー」になるのはある意味で正しい挙動と言える。}
Comment on lines +3353 to +3357
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

L2957 辺りのコメントに書きましたが、この注釈が無いと分かり辛いと感じたのでしたら、原文(syntax.txt)に説明を追加する事を検討ください。


*tex-cchar* *tex-cole* *tex-conceal*
Tex: Conceal モードを活用する ~
Expand Down Expand Up @@ -5170,14 +5209,18 @@ CursorLineFold FoldColumn と同じだが 'cursorline' が設定されたとき
*hl-MatchParen*
MatchParen カーソル下の文字、または直後の文字が括弧であるとき、その文字と
対応する括弧に使われる。|pi_paren.txt|
*hl-MessageWindow*
MessageWindow `:echowindow` で表示されるポップアップウィンドウにおけるメッ
セージ。定義されていないときは |hl-WarningMsg| が用いられる。
*hl-ModeMsg*
ModeMsg 'showmode' のメッセージ(例、"-- INSERT --")。
*hl-MoreMsg*
MoreMsg |more-prompt|
*hl-NonText*
NonText ウィンドウの端の '@' と 'showbreak' で設定された文字など、実際
のテキストには存在しない文字(例. 全角文字が行末に収まらないと
き ">" が表示される)。
NonText ウィンドウの端の '@' や、'smoothscroll' を設定しているときの
行頭に表示される "<<<"、'showbreak' で設定された文字など、
実際のテキストには存在しない文字(例. 全角文字が行末に収まらな
いとき ">" が表示される)。
*hl-Normal*
Normal 通常のテキスト。
*hl-Pmenu*
Expand All @@ -5188,6 +5231,10 @@ PmenuSel ポップアップメニュー: 選択されている項目。
PmenuSbar ポップアップメニュー: スクロールバー。
*hl-PmenuThumb*
PmenuThumb ポップアップメニュー: スクロールバーのつまみ部分。
*hl-PopupNotification*
PopupNotification
|popup_notification()| で生成されたポップアップウィンドウ。
定義されていないときは |hl-WarningMsg| が用いられる。
*hl-Question*
Question ヒットエンタープロンプト|hit-enter|とyes/noクエスチョン。
*hl-QuickFixLine*
Expand Down Expand Up @@ -5461,7 +5508,8 @@ types.vim: *.[ch]
更されない。"b:current_syntax" は構文ファイルによって変更されるが、
"b:current_syntax" を一時的に保存・復元することで値が変わらないようになってい
る。構文ファイルによって設定された値が "w:current_syntax" に代入される。
Note: This resets the 'spell', 'spellcapcheck' and 'spellfile' options.
Note: この設定によって 'spell', 'spellcapcheck', 'spellfile' オプションは初期
設定に戻る。

ウィンドウの独自構文が定義されると、同じバッファの他のウィンドウで実行された構
文コマンド (:syntax clear を含む) が影響しなくなる。逆に、そのウィンドウで実行
Expand Down
109 changes: 80 additions & 29 deletions en/syntax.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*syntax.txt* For Vim version 9.0. Last change: 2022 Jun 10
*syntax.txt* For Vim version 9.0. Last change: 2022 Dec 26


VIM REFERENCE MANUAL by Bram Moolenaar
Expand Down Expand Up @@ -500,7 +500,7 @@ Force to omit the line numbers: >
Go back to the default to use 'number' by deleting the variable: >
:unlet g:html_number_lines
<
*g:html_line_ids*
*g:html_line_ids*
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

こちらの変更を syntax.jax へ反映お願いします。

Default: 1 if |g:html_number_lines| is set, 0 otherwise.
When 1, adds an HTML id attribute to each line number, or to an empty <span>
inserted for that purpose if no line numbers are shown. This ID attribute
Expand Down Expand Up @@ -692,6 +692,22 @@ the rendered page generated by 2html.vim.
>
:let g:html_no_pre = 1
<
*g:html_no_doc*
Default: 0.
When 1 it doesn't generate a full HTML document with a DOCTYPE, <head>,
<body>, etc. If |g:html_use_css| is enabled (the default) you'll have to
define the CSS manually. The |g:html_dynamic_folds| and |g:html_line_ids|
settings (off by default) also insert some JavaScript.


*g:html_no_links*
Default: 0.
Don't generate <a> tags for text that looks like an URL.

*g:html_no_modeline*
Default: 0.
Don't generate a modeline disabling folding.

*g:html_expand_tabs*
Default: 0 if 'tabstop' is 8, 'expandtab' is 0, 'vartabstop' is not in use,
and no fold column or line numbers occur in the generated HTML;
Expand Down Expand Up @@ -1872,6 +1888,16 @@ following two lines to the syntax coloring file for that language
Now you just need to make sure that you add all regions that contain
the preprocessor language to the cluster htmlPreproc.

*html-folding*
The HTML syntax file provides syntax |folding| (see |:syn-fold|) between start
and end tags. This can be turned on by >

:let g:html_syntax_folding = 1
:set foldmethod=syntax

Note: Syntax folding might slow down syntax highlighting significantly,
especially for large files.


HTML/OS (by Aestiva) *htmlos.vim* *ft-htmlos-syntax*

Expand Down Expand Up @@ -2400,7 +2426,7 @@ you set the variable: >

:let papp_include_html=1

in your startup file it will try to syntax-hilight html code inside phtml
in your startup file it will try to syntax-highlight html code inside phtml
sections, but this is relatively slow and much too colourful to be able to
edit sensibly. ;)

Expand Down Expand Up @@ -2932,30 +2958,30 @@ Default folding is rather detailed, i.e., small syntax units like "if", "do",

You can set "ruby_foldable_groups" to restrict which groups are foldable: >

:let ruby_foldable_groups = 'if case %'
:let ruby_foldable_groups = 'if case %'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

こちらの変更を .jax へ反映お願いします。

<
The value is a space-separated list of keywords:

keyword meaning ~
-------- ------------------------------------- ~
ALL Most block syntax (default)
NONE Nothing
if "if" or "unless" block
if "if" or "unless" block
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同上。

def "def" block
class "class" block
module "module" block
do "do" block
do "do" block
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同上。

begin "begin" block
case "case" block
for "for", "while", "until" loops
{ Curly bracket block or hash literal
[ Array literal
% Literal with "%" notation, e.g.: %w(STRING), %!STRING!
/ Regexp
{ Curly bracket block or hash literal
[ Array literal
% Literal with "%" notation, e.g.: %w(STRING), %!STRING!
/ Regexp
Comment on lines +2977 to +2980
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同上。

string String and shell command output (surrounded by ', ", `)
: Symbol
# Multiline comment
<< Here documents
: Symbol
# Multiline comment
<< Here documents
Comment on lines +2982 to +2984
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同上。

__END__ Source code after "__END__" directive

*ruby_no_expensive*
Expand Down Expand Up @@ -3021,16 +3047,25 @@ satisfied with it for my own projects.
SED *sed.vim* *ft-sed-syntax*

To make tabs stand out from regular blanks (accomplished by using Todo
highlighting on the tabs), define "highlight_sedtabs" by putting >

:let highlight_sedtabs = 1
highlighting on the tabs), define "g:sed_highlight_tabs" by putting >

:let g:sed_highlight_tabs = 1
<
Comment on lines +3050 to +3053
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同上。

in the vimrc file. (This special highlighting only applies for tabs
inside search patterns, replacement texts, addresses or text included
by an Append/Change/Insert command.) If you enable this option, it is
also a good idea to set the tab width to one character; by doing that,
you can easily count the number of tabs in a string.

GNU sed allows comments after text on the same line. BSD sed only allows
comments where "#" is the first character of the line. To enforce BSD-style
comments, i.e. mark end-of-line comments as errors, use: >

:let g:sed_dialect = "bsd"
<
Note that there are other differences between GNU sed and BSD sed which are
not (yet) affected by this setting.

Bugs:

The transform command (y) is treated exactly like the substitute
Expand Down Expand Up @@ -3153,7 +3188,7 @@ The default is to use the twice sh_minlines. Set it to a smaller number to
speed up displaying. The disadvantage is that highlight errors may appear.

syntax/sh.vim tries to flag certain problems as errors; usually things like
extra ']'s, 'done's, 'fi's, etc. If you find the error handling problematic
unmatched "]", "done", "fi", etc. If you find the error handling problematic
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同上。

for your purposes, you may suppress such error highlighting by putting
the following line in your .vimrc: >

Expand Down Expand Up @@ -3586,6 +3621,14 @@ highlighting is to put the following line in your |vimrc|: >
<


WDL *wdl.vim* *wdl-syntax*

The Workflow Description Language is a way to specify data processing workflows
with a human-readable and writeable syntax. This is used a lot in
bioinformatics. More info on the spec can be found here:
https://github.com/openwdl/wdl


Comment on lines +3624 to +3631
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同上。

XF86CONFIG *xf86conf.vim* *ft-xf86conf-syntax*

The syntax of XF86Config file differs in XFree86 v3.x and v4.x. Both
Expand Down Expand Up @@ -3793,7 +3836,7 @@ SYNTAX ISKEYWORD SETTING *:syn-iskeyword*

clear: Syntax specific iskeyword setting is disabled and the
buffer-local 'iskeyword' setting is used.
{option} Set the syntax 'iskeyword' option to a new value.
{option} Set the syntax 'iskeyword' option to a new value.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同上。


Example: >
:syntax iskeyword @,48-57,192-255,$,_
Expand Down Expand Up @@ -4866,7 +4909,7 @@ is mostly used, because it looks better.
In the next section you can find information about indivisual highlight groups
and how to specify colors for them. Most likely you want to just select a set
of colors by using the `:colorscheme` command, for example: >

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同上。

colorscheme pablo
<
*:colo* *:colorscheme* *E185*
Expand Down Expand Up @@ -4905,6 +4948,7 @@ Before the color scheme will be loaded all default color list scripts
autocommand event is triggered. After the color scheme has been loaded the
|ColorScheme| autocommand event is triggered.

*colorscheme-override*
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同上。

If a color scheme is almost right, you can add modifications on top of it by
using the |ColorScheme| autocommand. For example, to remove the background
color (can make it transparent in some terminals): >
Expand All @@ -4917,7 +4961,7 @@ Change a couple more colors: >
augroup my_colorschemes
au!
au Colorscheme pablo hi Normal ctermbg=NONE
\ | higlight Special ctermfg=63
\ | highlight Special ctermfg=63
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同上。

\ | highlight Identifier ctermfg=44
augroup END

Expand Down Expand Up @@ -4959,7 +5003,7 @@ in their own color.

*highlight-clear* *:hi-clear*
:hi[ghlight] clear Reset all highlighting to the defaults. Removes all
highlighting for groups added by the user!
highlighting for groups added by the user.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同上。

Uses the current value of 'background' to decide which
default colors to use.
If there was a default link, restore it. |:hi-link|
Expand Down Expand Up @@ -5270,7 +5314,7 @@ guisp={color-name} *highlight-guisp*
"gg" is the Green value
"bb" is the Blue value
All values are hexadecimal, range from "00" to "ff". Examples: >
:highlight Comment guifg=#11f0c3 guibg=#ff00ff
:highlight Comment guifg=#11f0c3 guibg=#ff00ff
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同上。

<
If you are authoring a color scheme and use the same hexadecimal value
repeatedly, you can define a name for it in |v:colornames|. For
Expand Down Expand Up @@ -5360,23 +5404,26 @@ LineNrBelow Line number for when the 'relativenumber'
*hl-CursorLineNr*
CursorLineNr Like LineNr when 'cursorline' is set and 'cursorlineopt'
contains "number" or is "both", for the cursor line.
*hl-CursorLineSign*
CursorLineSign Like SignColumn when 'cursorline' is set for the cursor line.
*hl-CursorLineFold*
CursorLineFold Like FoldColumn when 'cursorline' is set for the cursor line.
*hl-CursorLineSign*
CursorLineSign Like SignColumn when 'cursorline' is set for the cursor line.
Comment on lines +5409 to +5410
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同上。

*hl-MatchParen*
MatchParen Character under the cursor or just before it, if it
is a paired bracket, and its match. |pi_paren.txt|

*hl-MessageWindow*
MessageWindow Messages popup window used by `:echowindow`. If not defined
|hl-WarningMsg| is used.
*hl-ModeMsg*
ModeMsg 'showmode' message (e.g., "-- INSERT --").
*hl-MoreMsg*
MoreMsg |more-prompt|
*hl-NonText*
NonText '@' at the end of the window, characters from 'showbreak'
and other characters that do not really exist in the text
(e.g., ">" displayed when a double-wide character doesn't
fit at the end of the line).
NonText '@' at the end of the window, "<<<" at the start of the window
for 'smoothscroll', characters from 'showbreak' and other
characters that do not really exist in the text, such as the
">" displayed when a double-wide character doesn't fit at the
end of the line.
*hl-Normal*
Normal Normal text.
*hl-Pmenu*
Expand All @@ -5387,6 +5434,10 @@ PmenuSel Popup menu: Selected item.
PmenuSbar Popup menu: Scrollbar.
*hl-PmenuThumb*
PmenuThumb Popup menu: Thumb of the scrollbar.
*hl-PopupNotification*
PopupNotification
Popup window created with |popup_notification()|. If not
defined |hl-WarningMsg| is used.
*hl-Question*
Question |hit-enter| prompt and yes/no questions.
*hl-QuickFixLine*
Expand Down