Skip to content

Commit ff5ff01

Browse files
authored
Merge pull request #2470 from h-east/update-ft_context
Update ft_context.{txt,jax}
2 parents 7e091bc + 0b5c2e1 commit ff5ff01

2 files changed

Lines changed: 53 additions & 38 deletions

File tree

doc/ft_context.jax

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
*ft_context.txt* For Vim バージョン 9.1. Last change: 2024 Jan 01
1+
*ft_context.txt* For Vim バージョン 9.2. Last change: 2026 Jan 10
22

33
これは ConTeXt ファイルタイププラグインのドキュメントである。
44

5-
NOTE: このプラグインは +vim9script が必要である。
5+
NOTE: このプラグインは |+vim9script| が必要である。
66

77
==============================================================================
88
☆内容 *context.vim* *ft-context*
@@ -19,11 +19,11 @@ NOTE: このプラグインは +vim9script が必要である。
1919
ConTeXt は、LaTeX と同じで、TeX 上に構築されたマクロベースの組版システムである:
2020
>
2121
https://wiki.contextgarden.net
22-
https://wiki.contextgarden.net/Vim
22+
https://wiki.contextgarden.net/Input_and_compilation/Text_editors/Vim
2323
<
2424
ConTeXt プラグインは構文ハイライト、組版した ConTeXt 文章の補完とサポートを提
25-
供する。文章を組版するのに推奨する方法は |:ConTeXt| を使うことである。これは
26-
`$PATH` 上で見付けた `mtxrun` スクリプトを動作させる
25+
供する。文章を組版するための推奨される方法は、$PATH にある `mtxrun` スクリプト
26+
を呼び出す |:ConTeXt| を使用することである
2727

2828
コマンドとその環境でよりきめ細かな制御をするには、`context.Typeset()` を直接使
2929
うことができる (または旧来の Vim script からは `context#Typeset()`)。例えば、
@@ -32,26 +32,31 @@ ConTeXt プラグインは構文ハイライト、組版した ConTeXt 文章の
3232
>
3333
import autoload 'context.vim'
3434
35+
var os = "linux" # システムに合わせて更新
36+
var arch = "arm64" # システムに合わせて更新
37+
3538
def MyConTeXt()
36-
const env = {'PATH':
37-
printf("%s/context/tex/texmf-<os>-<arch>/bin:%s", $HOME, $PATH)}
38-
context.Typeset("%", env)
39+
var env = {
40+
'PATH': $'{$HOME}/context/tex/texmf-{os}-{arch}/bin:{$PATH}'
41+
}
42+
context.Typeset("%", env)
3943
enddef
4044
41-
このコードは `~/.vim/after/ftplugin/context.vim` に置かれるかもしれない。そし
42-
て、カスタムコマンドを呼び出すためのマッピングを定義することができる:
43-
>
4445
nnoremap <silent><buffer><leader>t <scriptcmd>MyConTeXt()<cr>
4546
<
47+
このコードは `~/.vim/after/ftplugin/context.vim` に配置する必要がある。
48+
4649
`context.Typeset()` は、カスタムの組版コマンドを指定するための 3 番目のオプショ
47-
ナルな引数を受け入れる。これは、パスを受け取り、コマンドをリストとして返す関数
50+
ナルな引数を受け入れる。これは、パスを受け取り、コマンドを |list| として返す関数
4851
でなければならない。例えば:
4952
>
5053
def ConTeXtCustomCommand(path: string): list<string>
5154
return ['mtxrun', '--script', 'context', '--nonstopmode', path]
5255
enddef
5356
54-
context.ConTeXtTypeset("%", v:none, ConTeXtCustomCommand)
57+
def MyContext()
58+
context.Typeset("%", v:none, ConTeXtCustomCommand)
59+
enddef
5560
<
5661
大規模なプロジェクトでは、ルートドキュメントと様々な章ファイルで構成されること
5762
がよくある。章ファイルを編集する場合、ルートファイルに切り替えることなく、章
@@ -79,7 +84,8 @@ Vim は、カレントバッファの最初の 10 行内にマジック行を検
7984
- `context-data-metafun.vim`;
8085
- `context-data-tex.vim`.
8186

82-
同じコマンドを使用して、これらの構文ファイルを更新できる。
87+
存在する場合、そのようなファイルは構文のハイライトを強化するために自動的に読み
88+
込まれる。同じコマンドを使用して、これらの構文ファイルを更新できる。
8389

8490
*ft-context-commands*
8591
コマンド ~
@@ -106,8 +112,9 @@ Makefile が存在していても、代わりに `mtxrun` が呼び出される
106112
>
107113
g:context_ignore_makefile = 0
108114
<
109-
NOTE: |:make| を使用する前に、バッファの作業ディレクトリを組版するファイルの
110-
ディレクトリに設定する。
115+
NOTE: |:make| を使用する前に、バッファの作業ディレクトリがタイプセットしたい
116+
ファイルのディレクトリに設定されていることを確認すること。また、|:make|
117+
$PATH 内で `mtxrun` を検索することに注意。
111118

112119
*'g:context_extra_options'*
113120
`mtxrun` に渡す追加のオプションのリスト。
@@ -132,13 +139,14 @@ NOTE: Lua と MetaPost は個別のブロック内では常にハイライトさ
132139
*ft-context-mappings*
133140
マッピング ~
134141

135-
tp "reflow TeX paragraph"、TeX での段落を整形する。
142+
tp "reflow TeX paragraph"、TeX での段落を整形する。(モー
143+
ション)
136144

137145
i$ "inside inline math block"、インラインの数式ブロック内
138-
部を選択する。
146+
部を選択する。(テキストオブジェクトの選択)
139147

140148
a$ "around inline math block"、インラインの数式ブロックを
141-
選択する。
149+
選択する。(テキストオブジェクトの選択)
142150

143151
]] [count] セクションの開始に進む。
144152

en/ft_context.txt

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
*ft_context.txt* For Vim version 9.1. Last change: 2024 Jan 01
1+
*ft_context.txt* For Vim version 9.2. Last change: 2026 Jan 10
22

33
This is the documentation for the ConTeXt filetype plugin.
44

5-
NOTE: the plugin requires +vim9script.
5+
NOTE: the plugin requires |+vim9script|.
66

77
==============================================================================
88
CONTENTS *context.vim* *ft-context*
@@ -19,11 +19,11 @@ Introduction ~
1919
ConTeXt, similarly to LaTeX, is a macro-based typesetting system built on TeX:
2020
>
2121
https://wiki.contextgarden.net
22-
https://wiki.contextgarden.net/Vim
22+
https://wiki.contextgarden.net/Input_and_compilation/Text_editors/Vim
2323
<
2424
The ConTeXt plugin provides syntax highlighting, completion and support for
2525
typesetting ConTeXt documents. The recommended way to typeset a document is to
26-
use |:ConTeXt|. This will invoke the `mtxrun` script that is found in `$PATH`.
26+
use |:ConTeXt|, which invokes the `mtxrun` script that is found in $PATH.
2727

2828
For more fine grained control over the command and its environment,
2929
`context.Typeset()` can be used directly (or `context#Typeset()` from legacy
@@ -32,26 +32,31 @@ Vim script). For instance, if a version of ConTeXt is installed in
3232
>
3333
import autoload 'context.vim'
3434
35+
var os = "linux" # Update to match your system
36+
var arch = "arm64" # Update to match your system
37+
3538
def MyConTeXt()
36-
const env = {'PATH':
37-
printf("%s/context/tex/texmf-<os>-<arch>/bin:%s", $HOME, $PATH)}
38-
context.Typeset("%", env)
39+
var env = {
40+
'PATH': $'{$HOME}/context/tex/texmf-{os}-{arch}/bin:{$PATH}'
41+
}
42+
context.Typeset("%", env)
3943
enddef
4044
41-
This code may go in `~/.vim/after/ftplugin/context.vim`. A mapping can then be
42-
defined to invoke the custom command:
43-
>
4445
nnoremap <silent><buffer><leader>t <scriptcmd>MyConTeXt()<cr>
4546
<
47+
This code should go in `~/.vim/after/ftplugin/context.vim`.
48+
4649
`context.Typeset()` accepts a third optional argument to specify a custom
4750
typesetting command. That must be a function that takes a path and returns the
48-
command as a List. For example:
51+
command as a |list|. For example:
4952
>
5053
def ConTeXtCustomCommand(path: string): list<string>
5154
return ['mtxrun', '--script', 'context', '--nonstopmode', path]
5255
enddef
5356
54-
context.ConTeXtTypeset("%", v:none, ConTeXtCustomCommand)
57+
def MyContext()
58+
context.Typeset("%", v:none, ConTeXtCustomCommand)
59+
enddef
5560
<
5661
Large projects are often organized as a root document and various chapter
5762
files. When editing a chapter file, it is convenient to invoke |:ConTeXt|
@@ -67,7 +72,7 @@ one in the current buffer. The root document does not have to be opened in
6772
Vim.
6873

6974
To extend completion and syntax highlighting, you may generate supporting
70-
files using ConTeXt and add them to your configuration. If you configuration
75+
files using ConTeXt and add them to your configuration. If your configuration
7176
resides in `~/.vim`, you may use these commands:
7277
>
7378
mkdir -p ~/.vim/syntax/shared
@@ -81,7 +86,8 @@ The last command will create the following syntax files:
8186
- `context-data-metafun.vim`;
8287
- `context-data-tex.vim`.
8388

84-
The same command can be used to update those syntax files.
89+
If present, such files will be automatically loaded to enhance syntax
90+
highlighting. The same command can be used to update those syntax files.
8591

8692
*ft-context-commands*
8793
Commands ~
@@ -109,8 +115,9 @@ and this option is not set, standard `make` is used. If this option is set,
109115
>
110116
g:context_ignore_makefile = 0
111117
<
112-
NOTE: before using |:make|, set the working directory of the buffer to the
113-
directory of the file to be typeset.
118+
NOTE: before using |:make|, ensure that the working directory of the buffer is
119+
set to the directory of the file you want to typeset. Additionally, be aware
120+
that |:make| searches for `mtxrun in $PATH.
114121

115122
*'g:context_extra_options'*
116123
A list of additional options to pass to `mtxrun`.
@@ -135,11 +142,11 @@ When set, do not define any mappings.
135142
*ft-context-mappings*
136143
Mappings ~
137144

138-
tp "reflow TeX paragraph".
145+
tp "reflow TeX paragraph" (motion).
139146

140-
i$ "inside inline math block".
147+
i$ "inside inline math block" (text object selection).
141148

142-
a$ "around inline math block".
149+
a$ "around inline math block" (text object selection).
143150

144151
]] [count] start of sections forward.
145152

0 commit comments

Comments
 (0)