Skip to content

Commit 53cfc8f

Browse files
authored
Merge pull request #879 from tsuyoshicho/update/misc-20210124
Update {autocmd,filetype}.{txt,jax}
2 parents a475c63 + 8f46de1 commit 53cfc8f

File tree

4 files changed

+97
-41
lines changed

4 files changed

+97
-41
lines changed

doc/autocmd.jax

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*autocmd.txt* For Vim バージョン 8.2. Last change: 2020 Oct 26
1+
*autocmd.txt* For Vim バージョン 8.2. Last change: 2021 Jan 28
22

33

44
VIMリファレンスマニュアル by Bram Moolenaar
@@ -54,6 +54,7 @@
5454
{pat} |autocmd-patterns| に一致するファイルで、{event}
5555
のときに自動的に実行するコマンドのリストに、{cmd} を加
5656
える。
57+
{event} には "*" は使えない。 *E1155*
5758
Note: クォートは :autocmd への引数と見なされ、コメント
5859
を開始しない。
5960
{cmd} は常に既存の自動コマンドの後に追加されるので、
@@ -67,6 +68,10 @@
6768
特殊なパターン<buffer>や<buffer=N>はバッファローカルな自動コマンドを定義する。
6869
|autocmd-buflocal| を参照。
6970

71+
`:autocmd` が Vim9 script (スクリプトが `:vim9script` で始まるのと `:def` 関数
72+
内) にあると {cmd} は Vim9 script として実行される。したがってこの依存は自動コ
73+
マンドが定義された位置に依存し、トリガーされた位置ではない。
74+
7075
Note: '|' が {cmd} の前にある場合、":autocmd" コマンドの後には別のコマンドを続
7176
けることができる。これは動作する: >
7277
:augroup mine | au! BufRead | augroup END
@@ -306,6 +311,9 @@ Vimは以下のイベントを認識する。イベント名が大文字か小
306311
|VimLeavePre| Vimを終了する前、viminfoファイルを書き出す前
307312
|VimLeave| Vimを終了する前、viminfoファイルを書き出した後
308313

314+
|VimSuspend| Vimがサスペンドした時
315+
|VimResume| Vimがサスペンド後復帰した時
316+
309317
端末
310318
|TerminalOpen| 端末バッファが生成された後
311319
|TerminalWinOpen| 新しいウィンドウで端末バッファが生成された後
@@ -558,14 +566,18 @@ CmdlineChanged コマンドラインのテキストに変更が加えられた
558566
|cmdwin-char|
559567
*CmdlineEnter*
560568
CmdlineEnter ユーザーがコマンドを入力もしくは文字列を検索で
561-
きるコマンドラインにカーソルが移動した後。
569+
きるコマンドラインにカーソルが移動した後、非イ
570+
ンタラクティブなマッピング内での ":" 利用を含
571+
むが、|<Cmd>| の利用は含まない。
562572
<afile> はコマンドラインの種類を示す 1 文字に
563573
設定される。
564574
|cmdwin-char|
565575
*CmdlineLeave*
566-
CmdlineLeave カーソルがコマンドラインを離れる前。CTRL-C
567-
しくは <Esc> の入力によってコマンドラインを放
568-
棄する場合も同様。
576+
CmdlineLeave カーソルがコマンドラインを離れる前、非インタラ
577+
クティブなマッピング内での ":" 利用を含むが、
578+
|<Cmd>| の利用は含まない。CTRL-C もしくは
579+
<Esc> の入力によってコマンドラインを放棄する場
580+
合も同様。
569581
コマンドの結果がエラーとなる場合は、コマンドラ
570582
インは引き続き実行中となる。
571583
<afile> はコマンドラインの種類を示す 1 文字に
@@ -832,6 +844,7 @@ FuncUndefined ユーザー定義関数が使われたが、定義されてい
832844
ある。パターンは関数名に対して照合される。
833845
<amatch><afile> の両方とも関数名に設定され
834846
る。
847+
コンパイルされた |Vim9| 関数では発生しない。
835848
NOTE: Vim script を書くときには autoload 関数
836849
を使う方がよい。
837850
|autoload-functions|を参照。
@@ -1193,6 +1206,7 @@ VimLeave Vim を終了する前で、ファイル .viminfo を書き込
11931206
異常終了の検出には |v:dying| を使うこと。
11941207
終了時に v:dying が 2 以上のときはこのイベント
11951208
は発生しない。
1209+
終了コードは |v:exiting| から得る。
11961210
*VimLeavePre*
11971211
VimLeavePre Vim を終了する前で、ファイル .viminfo を書き込
11981212
む直前。これは終了時にたまたまカレントバッファ
@@ -1203,10 +1217,22 @@ VimLeavePre Vim を終了する前で、ファイル .viminfo を書き込
12031217
< 異常終了の検出には |v:dying| を使うこと。
12041218
終了時に v:dying が 2 以上のときはこのイベント
12051219
は発生しない。
1220+
終了コードは |v:exiting| から得る。
12061221
*VimResized*
12071222
VimResized Vimウィンドウのサイズが変わったとき。よって
12081223
'lines''columns' が変更される。しかし開始
12091224
時には発生しない。
1225+
*VimResume*
1226+
VimResume Vimがサスペンドと |VimSuspend| がトリガーした
1227+
後、Vimのインスタンスが復帰したとき。
1228+
|:checktime| を実行してVimがサスペンド中にバッ
1229+
ファ内容に変化がなかったことを保証するのに便利
1230+
である: >
1231+
:autocmd VimResume * checktime
1232+
< *VimSuspend*
1233+
VimSuspend Vimのインスタンスがサスペンドしたとき。Vim内で
1234+
CTRL-Z がタイプされた時だけであり、SIGSTOP か
1235+
SIGTSTP シグナルがVimに送られた時ではない。
12101236
*WinEnter*
12111237
WinEnter 別のウィンドウに入った後。Vimの開始直後、1個目
12121238
のウィンドウに入ったときは発生しない。ウィンド

doc/filetype.jax

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*filetype.txt* For Vim バージョン 8.2. Last change: 2020 Sep 28
1+
*filetype.txt* For Vim バージョン 8.2. Last change: 2021 Jan 21
22

33

44
VIMリファレンスマニュアル by Bram Moolenaar
@@ -153,6 +153,7 @@ NOTE: Vi互換とは全てのオプションがグローバルであることを
153153
*.w g:filetype_w |ft-cweb-syntax|
154154
*.i g:filetype_i |ft-progress-syntax|
155155
*.p g:filetype_p |ft-pascal-syntax|
156+
*.pp g:filetype_pp |ft-pascal-syntax|
156157
*.sh g:bash_is_sh |ft-sh-syntax|
157158
*.tex g:tex_flavor |ft-tex-plugin|
158159

@@ -553,17 +554,17 @@ GIT COMMIT *ft-gitcommit-plugin*
553554

554555
MAN *ft-man-plugin* *:Man* *man.vim*
555556

556-
マニュアルページを洗練された方法で表示する。ユーザーマニュアルの
557-
|find-manpage|も参照のこと。
557+
このプラグインはマニュアルページを洗練された方法で表示する。ユーザーマニュアル
558+
の詳細な情報は |find-manpage| も参照のこと。
558559

559-
マニュアルページを読み込む前に ":Man" を利用するには、起動vimrcファイルでこの
560-
スクリプトを読み込む必要がある: >
560+
マニュアルページが読み込まれる前に |:Man| を利用するには、起動 |vimrc| ファイ
561+
ルでこのスクリプトを読み込む必要がある: >
561562
562563
runtime ftplugin/man.vim
563564
564565
オプション:
565-
'iskeyword' マニュアルページの名前の上でCTRL-]を使えるようにするために文字
566-
'.' が追加される。
566+
'iskeyword' マニュアルページの名前の上で CTRL-] の利用をサポートするように
567+
するために文字 '.' が追加される。
567568

568569
コマンド:
569570
Man {name} {name} についてのマニュアルページを表示する。
@@ -573,24 +574,25 @@ Man {number} {name}
573574

574575
グローバルキーマップ:
575576
<Leader>K カーソル下の単語についてのマニュアルページを表示する。
576-
<Plug>ManPreGetPage 同上、マッピングを使うことを可能にする: >
577-
nmap <F1> <Plug>ManPreGetPage<CR>
577+
<Plug>ManPreGetPage
578+
同上、マッピングを使うことを可能にする: >
579+
nmap <F1> <Plug>ManPreGetPage
578580
579581
ローカルキーマップ:
580582
CTRL-] カーソルの下の単語についてのマニュアルページへ移動する。
581583
CTRL-T 直前のマニュアルページへ戻る。
582-
q ":quit" と同じ
584+
q |:quit| コマンドと同じ。
583585

584586
水平の代わりに垂直分割を使用するには: >
585587
let g:ft_man_open_mode = 'vert'
586588
新しいタブを使うには: >
587589
let g:ft_man_open_mode = 'tab'
588590
589-
折畳を有効にするにはこの変数を使う: >
590-
let g:ft_man_folding_enable = 1
591-
もしデフォルトの折畳が好みではないのなら、代わりに autocommand を使って望んだ
592-
折畳スタイルを追加できる。例: >
593-
autocmd FileType man setlocal foldmethod=indent foldenable
591+
折畳 |folding| を有効にするにはこの変数を使う: >
592+
let g:ft_man_folding_enable = 1
593+
もしデフォルトの折畳が好みではないのなら、代わりに |autocommand| を使って望ん
594+
だ折畳スタイルを追加できる。例: >
595+
autocmd FileType man setlocal foldmethod=indent foldenable
594596
595597
:Man {number} {name} が man {number} {name} のように振る舞い、ページが見つから
596598
ない場合に man {name} を実行させたくなければ、これを使用する: >
@@ -603,8 +605,8 @@ q ":quit" と同じ
603605
604606
MANPAGER *manpager.vim*
605607

606-
:Man コマンドを使うと、Vim をマンページにできる(その構文はマンページをハイライ
607-
ト表示しCTRL-] でヒットしたリンク先のマンページをたどる)。
608+
|:Man| コマンドを使うと、Vim をマンページにできる(その構文はマンページをハイラ
609+
イト表示しCTRL-] でヒットしたリンク先のマンページをたどる)。
608610

609611
bash, zsh, ksh もしくは dash の場合、設定ファイル (.bashrc, .zshrc, ...) に以
610612
下の設定を追加する。

en/autocmd.txt

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*autocmd.txt* For Vim version 8.2. Last change: 2020 Oct 26
1+
*autocmd.txt* For Vim version 8.2. Last change: 2021 Jan 28
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -54,7 +54,8 @@ effects. Be careful not to destroy your text.
5454
:au[tocmd] [group] {event} {pat} [++once] [++nested] {cmd}
5555
Add {cmd} to the list of commands that Vim will
5656
execute automatically on {event} for a file matching
57-
{pat} |autocmd-patterns|.
57+
{pat} |autocmd-patterns|.
58+
Here {event} cannot be "*". *E1155*
5859
Note: A quote character is seen as argument to the
5960
:autocmd and won't start a comment.
6061
Vim always adds the {cmd} after existing autocommands,
@@ -70,6 +71,11 @@ effects. Be careful not to destroy your text.
7071
The special pattern <buffer> or <buffer=N> defines a buffer-local autocommand.
7172
See |autocmd-buflocal|.
7273

74+
If the `:autocmd` is in Vim9 script (a script that starts with `:vim9script`
75+
and in a `:def` function) then {cmd} will be executed as in Vim9
76+
script. Thus this depends on where the autocmd is defined, not where it is
77+
triggered.
78+
7379
Note: The ":autocmd" command can only be followed by another command when the
7480
'|' appears before {cmd}. This works: >
7581
:augroup mine | au! BufRead | augroup END
@@ -301,6 +307,9 @@ Name triggered by ~
301307
|VimLeavePre| before exiting Vim, before writing the viminfo file
302308
|VimLeave| before exiting Vim, after writing the viminfo file
303309

310+
|VimSuspend| when suspending Vim
311+
|VimResume| when Vim is resumed after being suspended
312+
304313
Terminal
305314
|TerminalOpen| after a terminal buffer was created
306315
|TerminalWinOpen| after a terminal buffer was created in a new window
@@ -551,12 +560,15 @@ CmdlineChanged After a change was made to the text in the
551560
*CmdlineEnter*
552561
CmdlineEnter After moving the cursor to the command line,
553562
where the user can type a command or search
554-
string.
563+
string; including non-interactive use of ":"
564+
in a mapping, but not when using |<Cmd>|.
555565
<afile> is set to a single character,
556566
indicating the type of command-line.
557567
|cmdwin-char|
558568
*CmdlineLeave*
559-
CmdlineLeave Before leaving the command line.
569+
CmdlineLeave Before leaving the command line; including
570+
non-interactive use of ":" in a mapping, but
571+
not when using |<Cmd>|.
560572
Also when abandoning the command line, after
561573
typing CTRL-C or <Esc>.
562574
When the commands result in an error the
@@ -840,6 +852,8 @@ FuncUndefined When a user function is used but it isn't
840852
when it's used. The pattern is matched
841853
against the function name. Both <amatch> and
842854
<afile> are set to the name of the function.
855+
Not triggered when compiling a |Vim9|
856+
function.
843857
NOTE: When writing Vim scripts a better
844858
alternative is to use an autoloaded function.
845859
See |autoload-functions|.
@@ -1207,6 +1221,7 @@ VimLeave Before exiting Vim, just after writing the
12071221
To detect an abnormal exit use |v:dying|.
12081222
When v:dying is 2 or more this event is not
12091223
triggered.
1224+
To get the exit code use |v:exiting|.
12101225
*VimLeavePre*
12111226
VimLeavePre Before exiting Vim, just before writing the
12121227
.viminfo file. This is executed only once,
@@ -1217,10 +1232,22 @@ VimLeavePre Before exiting Vim, just before writing the
12171232
< To detect an abnormal exit use |v:dying|.
12181233
When v:dying is 2 or more this event is not
12191234
triggered.
1235+
To get the exit code use |v:exiting|.
12201236
*VimResized*
12211237
VimResized After the Vim window was resized, thus 'lines'
12221238
and/or 'columns' changed. Not when starting
12231239
up though.
1240+
*VimResume*
1241+
VimResume When the Vim instance is resumed after being
1242+
suspended and |VimSuspend| was triggered.
1243+
Useful for triggering |:checktime| and ensure
1244+
the buffers content did not change while Vim
1245+
was suspended: >
1246+
:autocmd VimResume * checktime
1247+
< *VimSuspend*
1248+
VimSuspend When the Vim instance is suspended. Only when
1249+
CTRL-Z was typed inside Vim, not when the
1250+
SIGSTOP or SIGTSTP signal was sent to Vim.
12241251
*WinEnter*
12251252
WinEnter After entering another window. Not done for
12261253
the first window, when Vim has just started.

en/filetype.txt

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*filetype.txt* For Vim version 8.2. Last change: 2020 Sep 28
1+
*filetype.txt* For Vim version 8.2. Last change: 2021 Jan 21
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -147,6 +147,7 @@ can be used to overrule the filetype used for certain extensions:
147147
*.w g:filetype_w |ft-cweb-syntax|
148148
*.i g:filetype_i |ft-progress-syntax|
149149
*.p g:filetype_p |ft-pascal-syntax|
150+
*.pp g:filetype_pp |ft-pascal-syntax|
150151
*.sh g:bash_is_sh |ft-sh-syntax|
151152
*.tex g:tex_flavor |ft-tex-plugin|
152153

@@ -563,16 +564,15 @@ Local mappings:
563564

564565
MAN *ft-man-plugin* *:Man* *man.vim*
565566

566-
Displays a manual page in a nice way. Also see the user manual
567-
|find-manpage|.
568-
569-
To start using the ":Man" command before any manual page was loaded, source
570-
this script from your startup vimrc file: >
567+
This plugin displays a manual page in a nice way. See |find-manpage| in the
568+
user manual for more information.
571569

570+
To start using the |:Man| command before any manual page has been loaded,
571+
source this script from your startup |vimrc| file: >
572572
runtime ftplugin/man.vim
573573
574574
Options:
575-
'iskeyword' the '.' character is added to be able to use CTRL-] on the
575+
'iskeyword' The '.' character is added to support the use of CTRL-] on the
576576
manual page name.
577577

578578
Commands:
@@ -582,24 +582,25 @@ Man {number} {name}
582582

583583
Global mapping:
584584
<Leader>K Displays the manual page for the word under the cursor.
585-
<Plug>ManPreGetPage idem, allows for using a mapping: >
586-
nmap <F1> <Plug>ManPreGetPage<CR>
585+
<Plug>ManPreGetPage
586+
idem, allows for using a mapping: >
587+
nmap <F1> <Plug>ManPreGetPage
587588
588589
Local mappings:
589590
CTRL-] Jump to the manual page for the word under the cursor.
590591
CTRL-T Jump back to the previous manual page.
591-
q Same as ":quit"
592+
q Same as the |:quit| command.
592593

593594
To use a vertical split instead of horizontal: >
594595
let g:ft_man_open_mode = 'vert'
595596
To use a new tab: >
596597
let g:ft_man_open_mode = 'tab'
597598
598-
To enable folding use this: >
599-
let g:ft_man_folding_enable = 1
600-
If you do not like the default folding, use an autocommand to add your desired
599+
To enable |folding|, use this: >
600+
let g:ft_man_folding_enable = 1
601+
If you do not like the default folding, use an |autocommand| to add your desired
601602
folding style instead. For example: >
602-
autocmd FileType man setlocal foldmethod=indent foldenable
603+
autocmd FileType man setlocal foldmethod=indent foldenable
603604
604605
If you would like :Man {number} {name} to behave like man {number} {name} by
605606
not running man {name} if no page is found, then use this: >
@@ -612,7 +613,7 @@ page in a Vim window: >
612613
613614
MANPAGER *manpager.vim*
614615

615-
The :Man command allows you to turn Vim into a manpager (that syntax highlights
616+
The |:Man| command allows you to turn Vim into a manpager (that syntax highlights
616617
manpages and follows linked manpages on hitting CTRL-]).
617618

618619
For bash,zsh,ksh or dash, add to the config file (.bashrc,.zshrc, ...)

0 commit comments

Comments
 (0)