1
- *repeat.txt* For Vim バージョン 8.0. Last change: 2016 Sep 11
1
+ *repeat.txt* For Vim バージョン 8.0. Last change: 2016 Nov 21
2
2
3
3
4
4
VIMリファレンスマニュアル by Bram Moolenaar
@@ -480,7 +480,7 @@ Vimスクリプトのパッケージは1つかそれ以上のプラグインを
480
480
Vim が起動した時、.vimrcを処理した後、'packpath' に含まれる "pack/*/start" ディ
481
481
レクトリの下の全てのディレクトリをスキャンする。最初にそのディレクトリは
482
482
'runtimepath' に追加される。次に全てのプラグインがロードされる。
483
- See | packload-two-steps | for how these two steps can be useful.
483
+ これら2つのステップがどのように役立つかについては、 | packload-two-steps | 参照。
484
484
485
485
上記の例では "pack/foo/start/foobar/plugin/foo.vim" を見つけて
486
486
"~/.vim/pack/foo/start/foobar" を 'runtimepath' に追加する。
@@ -503,23 +503,22 @@ Note "pack/foo/opt" 以下のファイルは自動的に読み込まれず、"pa
503
503
これはプラグインの読み込みを無効化していても効果がある。自動読み込みは一度だけ
504
504
行われる。
505
505
506
- If the package has an "after" directory, that directory is added to the end of
507
- 'runtimepath' , so that anything there will be loaded later.
506
+ パッケージに "after"ディレクトリがある場合、そのディレクトリは 'runtimepath'
507
+ の末尾に追加さる。そのため、後でロードされるものが存在する。
508
508
509
509
510
- Using a single plugin and loading it automatically ~
510
+ プラグインを使用して自動的にロードする ~
511
511
512
- If you don't have a package but a single plugin, you need to create the extra
513
- directory level:
512
+ パッケージでなくプラグインがある場合は、別のディレクトリ階層を作成する必要がある。
514
513
% mkdir -p ~/.vim/pack/foo/start/foobar
515
514
% cd ~/.vim/pack/foo/start/foobar
516
515
% unzip /tmp/someplugin.zip
517
516
518
- You would now have these files:
517
+ これで、次のファイルが作成される。
519
518
pack/foo/start/foobar/plugin/foo.vim
520
519
pack/foo/start/foobar/syntax/some.vim
521
520
522
- From here it works like above.
521
+ ここから上のように動作する。
523
522
524
523
525
524
任意のプラグイン ~
@@ -530,94 +529,95 @@ From here it works like above.
530
529
これは 'packpath' の "pack/*/opt/foodebug" から
531
530
~/.vim/pack/foo/opt/foodebug/plugin/debugger.vim を見つけ読み込む。
532
531
533
- This could be done if some conditions are met. For example, depending on
534
- whether Vim supports a feature or a dependency is missing.
532
+ これは、いくつかの条件が満たされた場合に実行できる。たとえば、Vimが機能を
533
+ サポートしているか依存関係がないかによって異なる。
535
534
536
- You can also load an optional plugin at startup, by putting this command in
537
- your | .vimrc | : >
535
+ このコマンドをあなたの | .vimrc | : に入れることで、起動時に任意のプラグインを読
536
+ み込むこともできる。
538
537
:packadd! foodebug
539
- The extra "!" is so that the plugin isn't loaded if Vim was started with
540
- | --noplugin | .
538
+ 余分な "!" は Vimが | --noplugin | で起動されていれば、プラグインがロードされな
539
+ いようになっている。
541
540
542
541
パッケージが "opt" ディレクトリしか持たなかったとしても一向に構わない。その場
543
542
合、それを使いたいときは(明示的に)読み込む必要がある。
544
543
545
544
546
545
どこに何を置くか ~
547
546
548
- Since color schemes, loaded with `:colorscheme ` , are found below
549
- "pack/*/start" and "pack/*/opt", you could put them anywhere. We recommend
550
- you put them below "pack/*/opt", for example
551
- ".vim/pack/mycolors/opt/dark/colors/very_dark.vim".
547
+ `:colorscheme ` で読み込まれた配色は "pack/*/start"と "pack/*/opt" の下にあるの
548
+ でどこにでも置くことがでる。たとえば、
549
+ ".vim/pack/mycolors/opt/dark/colors/very_dark.vim" のように、 "pack/*/opt"の下
550
+ に置くことをお勧めする。
552
551
553
- Filetype plugins should go under "pack/*/start", so that they are always
554
- found. Unless you have more than one plugin for a file type and want to
555
- select which one to load with `:packadd ` . E.g. depending on the compiler
556
- version: >
552
+ Filetypeプラグインはファイルタイプに複数のプラグインがあり、`:packadd ` でロード
553
+ するプラグインを選択したいのでない限り "pack/*/start" の下に置く必要がある。
554
+ 例えば、コンパイラのバージョンによって異なる。 >
557
555
if foo_compiler_version > 34
558
556
packadd foo_new
559
557
else
560
558
packadd foo_old
561
559
endif
562
560
563
- The "after" directory is most likely not useful in a package. It's not
564
- disallowed though.
561
+ "after"ディレクトリは、パッケージ内で有用でない可能性が最も高い。
562
+ しかし、それは許されていない。
565
563
566
564
==============================================================================
567
565
6. Vimパッケージを作る *package-create*
568
566
569
- This assumes you write one or more plugins that you distribute as a package.
570
-
571
- If you have two unrelated plugins you would use two packages, so that Vim
572
- users can chose what they include or not. Or you can decide to use one
573
- package with optional plugins, and tell the user to add the ones he wants with
574
- `: packadd ` .
575
-
576
- Decide how you want to distribute the package. You can create an archive or
577
- you could use a repository. An archive can be used by more users, but is a
578
- bit harder to update to a new version. A repository can usually be kept
579
- up-to-date easily, but it requires a program like "git" to be available.
580
- You can do both, github can automatically create an archive for a release.
581
-
582
- Your directory layout would be like this:
583
- start/foobar/plugin/foo.vim " always loaded, defines commands
584
- start/foobar/plugin/bar.vim " always loaded, defines commands
585
- start/foobar/autoload/foo.vim " loaded when foo command used
586
- start/foobar/doc/foo.txt " help for foo.vim
587
- start/foobar/doc/tags " help tags
588
- opt/fooextra/plugin/extra.vim " optional plugin, defines commands
589
- opt/fooextra/autoload/extra.vim " loaded when extra command used
590
- opt/fooextra/doc/extra.txt " help for extra.vim
591
- opt/fooextra/doc/tags " help tags
592
-
593
- This allows for the user to do: >
567
+ パッケージとして配布する1つ以上のプラグインを記述していることを前提とする。
568
+
569
+ 2つの無関係なプラグインがある場合は、2つのパッケージを使用するので、Vimユーザ
570
+ はそのパッケージに含まれるものを選択できる。あるいは、オプションのプラグイン
571
+ で1つのパッケージを使用し、 `: packadd ` で必要なプラグインを追加するようにユーザ
572
+ ーに指示することもできる。
573
+
574
+ パッケージの配布方法を決める。アーカイブを作成することも、リポジトリを使用する
575
+ こともできる。より多くのユーザーがアーカイブを使用できるが、新しいバージョンに
576
+ 更新するのは少し難しくなる。リポジトリは通常、最新の状態に保つことができるが、
577
+ "git"のようなプログラムが必要である。両方を行うことができる、githubは自動的に
578
+ リリース用のアーカイブを作成することができる。
579
+
580
+ ディレクトリ構成は次のようになる。 >
581
+ start/foobar/plugin/foo.vim " 常にロードされ、コマンドを定義する
582
+ start/foobar/plugin/bar.vim " 常にロードされ、コマンドを定義する
583
+ start/foobar/autoload/foo.vim " fooコマンドが使用されたときに読み込まれる
584
+ start/foobar/doc/foo.txt " foo.vimのヘルプ
585
+ start/foobar/doc/tags " ヘルプタグ
586
+ opt/fooextra/plugin/extra.vim " オプションのプラグイン、コマンドの定義
587
+ opt/fooextra/autoload/extra.vim " extraコマンドが使用されたときに読み込まれる
588
+ opt/fooextra/doc/extra.txt " extra.vimのヘルプ
589
+ opt/fooextra/doc/tags " ヘルプタグ
590
+
591
+ これにより、ユーザーは次の操作を行うことができる。 >
594
592
mkdir ~/.vim/pack/myfoobar
595
593
cd ~/.vim/pack/myfoobar
596
594
git clone https://github.com/you/foobar.git
597
595
598
- Here "myfoobar" is a name that the user can choose, the only condition is that
599
- it differs from other packages.
596
+ ここで "myfoobar"はユーザーが選択できる名前だが、唯一の条件は他のパッケージ
597
+ とは異なることである。
600
598
601
- In your documentation you explain what the plugins do, and tell the user how
602
- to load the optional plugin: >
599
+
600
+ ドキュメントでは、プラグインの機能について説明し、オプションのプラグインをロー
601
+ ドする方法をユーザーに伝える。 >
603
602
:packadd! fooextra
604
603
605
- You could add this packadd command in one of your plugins, to be executed when
606
- the optional plugin is needed.
604
+ このpackaddコマンドをプラグインの1つに追加して、オプションのプラグインが必要な
605
+ ときに実行することができる。
606
+
607
607
608
- Run the `:helptags ` command to generate the doc/tags file. Including this
609
- generated file in the package means that the user can drop the package in his
610
- pack directory and the help command works right away. Don't forget to re-run
611
- the command after changing the plugin help: >
608
+ `:helptags ` コマンドを実行して、 doc/tagsファイルを生成する。この生成されたファ
609
+ イルをパッケージに含めるということは、パッケージディレクトリにパッケージを落と
610
+ すことができ、ヘルプコマンドがすぐに動作することを意味する。プラグインヘルプを
611
+ 変更した後にコマンドを再実行することを忘れないでほしい。 >
612
612
:helptags path/start/foobar/doc
613
613
:helptags path/opt/fooextra/doc
614
614
615
615
616
- Dependencies between plugins ~
616
+ プラグイン間の依存関係 ~
617
617
*packload-two-steps*
618
- Suppose you have two plugins that depend on the same functionality. You can
619
- put the common functionality in an autoload directory, so that it will be
620
- found automatically. Your package would have these files:
618
+ 同じ機能に依存する2つのプラグインがあるとする。共通機能をautoloadディレクト
619
+ リに置くことで、自動的に見つかるようにすることができる。あなたのパッケージに
620
+ は次のファイルがある。
621
621
622
622
pack/foo/start/one/plugin/one.vim >
623
623
call foolib#getit()
@@ -626,8 +626,8 @@ found automatically. Your package would have these files:
626
626
< pack/foo/start/lib/autoload/foolib.vim >
627
627
func foolib#getit()
628
628
629
- This works, because loading packages will first add all found directories to
630
- 'runtimepath' before sourcing the plugins.
629
+ これは動作する。なぜなら、パッケージをロードすると、プラグインを入手する前に
630
+ 見つかったすべてのディレクトリが 'runtimepath' に追加されるからである。
631
631
632
632
==============================================================================
633
633
7. スクリプトのデバッグ *debug-scripts*
0 commit comments