Skip to content

Commit b82c184

Browse files
authored
Merge pull request #1332 from vim-jp/hh-update-usr_05
Update usr_05.{txt,jax}
2 parents e1196ea + 5eb4f54 commit b82c184

File tree

2 files changed

+71
-22
lines changed

2 files changed

+71
-22
lines changed

doc/usr_05.jax

Lines changed: 36 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*usr_05.txt* For Vim バージョン 9.0. Last change: 2019 May 23
1+
*usr_05.txt* For Vim バージョン 9.0. Last change: 2023 Sep 12
22

33
VIM USER MANUAL - by Bram Moolenaar
44

@@ -315,17 +315,27 @@ CTRL-U でアンドゥすることができます。":iunmap <C-U>" で元に戻
315315

316316

317317
*restore-cursor* *last-position-jump* >
318-
autocmd BufReadPost *
319-
\ if line("'\"") >= 1 && line("'\"") <= line("$") && &ft !~# 'commit'
320-
\ | exe "normal! g`\""
321-
\ | endif
318+
augroup RestoreCursor
319+
autocmd!
320+
autocmd BufReadPost *
321+
\ let line = line("'\"")
322+
\ | if line >= 1 && line <= line("$") && &filetype !~# 'commit'
323+
\ && index(['xxd', 'gitrebase'], &filetype) == -1
324+
\ | execute "normal! g`\""
325+
\ | endif
326+
augroup END
322327
323328
自動コマンドをもう一つ。ファイルを読み込んだ直後に実行される自動コマンドを定義
324329
しています。後ろのごちゃごちゃした部分は「'" マークが定義されているかどうかを
325-
チェックし、定義があればそこにジャンプする」という意味です。コマンドを複数行に
326-
分けて書くために、行頭に "\" を書いています。行がやたらと長くなるのを防ぐため
327-
です。|line-continuation|参照。"\" は Vim script 内でのみ使えます。コマンドラ
328-
インで入力するときは使えません。
330+
チェックし、定義があればそこにジャンプする」という意味です。コミットやリベース
331+
メッセージの場合は、前回とは違うメッセージになる可能性が高く、また、xxd(1) を
332+
使ってバイナリファイルをフィルタリングして編集を行う場合は、入力ファイルを行っ
333+
たり来たり変換して、いわば二面性を持っているため、このようなことは行いません。
334+
|using-xxd| も参照してください。
335+
336+
コマンドを複数行に分けて書くために、行頭に "\" を書いています。行がやたらと長
337+
くなるのを防ぐためです。|line-continuation| 参照。"\" は Vim script 内でのみ使
338+
えます。コマンドラインで入力するときは使えません。
329339

330340
>
331341
command DiffOrig vert new | set bt=nofile | r ++edit # | 0d_ | diffthis
@@ -429,6 +439,16 @@ matchit プラグインを使い始めるには、以下の行をあなたの vi
429439
ここの "fancytext" はパッケージ名なので、実際には別の名前になるで
430440
しょう。
431441

442+
editorconfig パッケージの追加 *editorconfig-install*
443+
444+
matchit パッケージと同様に、Vim の起動時に配布されている editorconfig プラグイ
445+
ンを読み込むには、vimrc ファイルに以下の行を追加します: >
446+
packadd! editorconfig
447+
448+
Vim を再起動するとプラグインがアクティブになり、以下でプラグインについて読むこ
449+
とができます: >
450+
:h editorconfig.txt
451+
432452
パッケージについてのより詳しい情報は次の項目を参照してください: |packages|
433453

434454
==============================================================================
@@ -448,13 +468,18 @@ matchit プラグインを使い始めるには、以下の行をあなたの vi
448468
|add-filetype-plugin|をします。
449469

450470

451-
☆グローバルプラグイン *standard-plugin*
471+
☆グローバルプラグイン *standard-plugin* *distributed-plugins*
452472

453473
Vim を起動すると、自動的にいくつものグローバルプラグインがロードされます。特に
454474
何もしなくて大丈夫です。グローバルプラグインは、ほとんどの人が欲しいと思うだろ
455475
う機能を提供しています。それらの機能は Vim の中にコンパイルして組み込まれてい
456476
るのではなく、Vim script として実装されています。ヘルプの目次にプラグインの一
457-
覧があります|standard-plugin-list||load-plugins|も参照してください。
477+
覧があります |standard-plugin-list|
478+
479+
ローカルにインストールされたプラグインとパッケージ (別個のヘルプファイルが付属)
480+
については、同様のリストがヘルプセクション |local-additions| にあります。
481+
482+
|load-plugins|も参照してください。
458483

459484
*add-global-plugin*
460485
グローバルプラグインを追加すると、いつでもその機能を使えるようになります。

en/usr_05.txt

Lines changed: 35 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*usr_05.txt* For Vim version 9.0. Last change: 2019 May 23
1+
*usr_05.txt* For Vim version 9.0. Last change: 2023 Sep 12
22

33
VIM USER MANUAL - by Bram Moolenaar
44

@@ -308,17 +308,27 @@ This switches on three very clever mechanisms:
308308

309309

310310
*restore-cursor* *last-position-jump* >
311-
autocmd BufReadPost *
312-
\ if line("'\"") >= 1 && line("'\"") <= line("$") && &ft !~# 'commit'
313-
\ | exe "normal! g`\""
314-
\ | endif
311+
augroup RestoreCursor
312+
autocmd!
313+
autocmd BufReadPost *
314+
\ let line = line("'\"")
315+
\ | if line >= 1 && line <= line("$") && &filetype !~# 'commit'
316+
\ && index(['xxd', 'gitrebase'], &filetype) == -1
317+
\ | execute "normal! g`\""
318+
\ | endif
319+
augroup END
315320
316321
Another autocommand. This time it is used after reading any file. The
317322
complicated stuff after it checks if the '" mark is defined, and jumps to it
318-
if so. The backslash at the start of a line is used to continue the command
319-
from the previous line. That avoids a line getting very long.
320-
See |line-continuation|. This only works in a Vim script file, not when
321-
typing commands at the command-line.
323+
if so. It doesn't do that for a commit or rebase message, which are likely
324+
a different one than last time, and when using xxd(1) to filter and edit
325+
binary files, which transforms input files back and forth, causing them to
326+
have dual nature, so to speak. See also |using-xxd|.
327+
328+
The backslash at the start of a line is used to continue the command from the
329+
previous line. That avoids a line getting very long. See |line-continuation|.
330+
This only works in a Vim script file, not when typing commands at the
331+
command line.
322332

323333
>
324334
command DiffOrig vert new | set bt=nofile | r ++edit # | 0d_ | diffthis
@@ -417,6 +427,15 @@ an archive or as a repository. For an archive you can follow these steps:
417427
Here "fancytext" is the name of the package, it can be anything
418428
else.
419429

430+
Adding the editorconfig package *editorconfig-install*
431+
432+
Similar to the matchit package, to load the distributed editorconfig plugin
433+
when Vim starts, add the following line to your vimrc file: >
434+
packadd! editorconfig
435+
436+
After restarting your Vim, the plugin is active and you can read about it at: >
437+
:h editorconfig.txt
438+
420439
More information about packages can be found here: |packages|.
421440

422441
==============================================================================
@@ -436,13 +455,18 @@ The global plugins will be discussed first, then the filetype ones
436455
|add-filetype-plugin|.
437456

438457

439-
GLOBAL PLUGINS *standard-plugin*
458+
GLOBAL PLUGINS *standard-plugin* *distributed-plugins*
440459

441460
When you start Vim, it will automatically load a number of global plugins.
442461
You don't have to do anything for this. They add functionality that most
443462
people will want to use, but which was implemented as a Vim script instead of
444463
being compiled into Vim. You can find them listed in the help index
445-
|standard-plugin-list|. Also see |load-plugins|.
464+
|standard-plugin-list|.
465+
466+
For locally installed plugins and packages (which come with a separated help
467+
file) a similar list can be found in the help section |local-additions|.
468+
469+
Also see |load-plugins|.
446470

447471
*add-global-plugin*
448472
You can add a global plugin to add functionality that will always be present

0 commit comments

Comments
 (0)