diff --git a/README.mkd b/README.mkd index d890da8..a7fd08a 100644 --- a/README.mkd +++ b/README.mkd @@ -10,6 +10,8 @@ scripts/ |(予定) 管理用のスクリプトを置いてあります。 src/po/, runtime/lang |Vimに付属の日本語翻訳ファイルが置いてあります。 src/po/ja.po |Vimのメッセージ翻訳ファイルのマスター(UTF-8) runtime/lang/menu\_ja\_jp.utf-8.vim |Vimの日本語メニューファイルのマスター(UTF-8) +runtime/doc/\*-ja.UTF-8.1 |日本語manファイル(UTF-8) +runtime/doc/\*.1 |原文manファイル src/po/ 及び runtime/lang/ 配下の、上記以外のファイルは基本的にマスターから変換するものなので通常直接は編集しないでください。 @@ -52,3 +54,29 @@ src/po/ 及び runtime/lang/ 配下の、上記以外のファイルは基本的 7. euc-jp と sjis 版の作成 本来なら自動化すべきところなので、今は忘れて良い。 + + +## manファイル更新手順 + +1. 原文manファイルの更新 + + Vimのソースファイルの runtime/doc/ ディレクトリから、原文manファイルを本リポジトリにコピー。 + + $ cd /path/to/vim/runtime/doc + $ cp evim.1 vim.1 vimdiff.1 vimtutor.1 xxd.1 /path/to/lang-ja/runtime/doc + +2. 翻訳 + + 原文の差分を見つつ翻訳ファイルを更新する。 + + $ git diff | gvim -R - + +3. 表示確認 + + 以下のコマンドで表示を確認できる。 + + $ groff -Tutf8 -Dutf8 -mandoc -mja vim-ja.UTF-8.1 | less -R + +4. コミット + + 原文と日本語訳は常に同じバージョンがコミットされているように注意すること。 diff --git a/runtime/doc/evim-ja.UTF-8.1 b/runtime/doc/evim-ja.UTF-8.1 new file mode 100644 index 0000000..1b7a657 --- /dev/null +++ b/runtime/doc/evim-ja.UTF-8.1 @@ -0,0 +1,51 @@ +.TH EVIM 1 "2002 February 16" +.SH 名前 +evim \- easy Vim, モードレスエディタ Vim +.SH 書式 +.br +.B evim +[options] [file ..] +.br +.B eview +.SH 説明 +.B eVim +は +.B Vim +を起動して、モードレスエディタとして動作するためのオプションを設定します。 +Vim の動作が point-and-click エディタのような動作になります。 +MS-Windows のメモ帳のような動作です。 +.B eVim +は常に GUI で起動し、メニューとツールバーを表示します。 +.PP +どうしても Vim の操作に馴染めない場合に使ってください。 +編集効率は下がります。 +.PP +.B eview +は同様に、読み込み専用モードで起動します。evim \-R と同じです。 +.PP +引数や Vim についての詳細は vim(1) を参照してください。 +.PP +オプション 'insertmode' が設定され、テキストを直接、入力できるようになりま +す。 +.br +コピーとペーストのキー操作が MS-Windows と同じになるように、マップが設定され +ます。 +CTRL-X が切り取り、CTRL-C がコピー、CTRL-V がペーストです。 +標準の CTRL-V の操作は CTRL-Q に割り当てられます。 +.SH オプション +vim(1) を参照してください。 +.SH ファイル +.TP 15 +/usr/local/lib/vim/evim.vim +eVim の初期化スクリプト。 +.SH 別名 +evim は "gumbies のための Vim" とも呼ばれています。 +evim を使っているあなたはきっと、頭にハンカチをかぶっているのです。 +(訳注: gumbies は Monty Python に登場するおもしろ集団。ハンカチをかぶっ +ている。) +.SH 関連項目 +vim(1) +.SH 著者 +.B Vim +のほとんどの機能は Bram Moolenaar が開発し、多くの人が協力しました。 +メニューの Help/Credits を参照してください。 diff --git a/runtime/doc/evim.1 b/runtime/doc/evim.1 new file mode 100644 index 0000000..bb859ce --- /dev/null +++ b/runtime/doc/evim.1 @@ -0,0 +1,49 @@ +.TH EVIM 1 "2002 February 16" +.SH NAME +evim \- easy Vim, edit a file with Vim and setup for modeless editing +.SH SYNOPSIS +.br +.B evim +[options] [file ..] +.br +.B eview +.SH DESCRIPTION +.B eVim +starts +.B Vim +and sets options to make it behave like a modeless editor. +This is still Vim but used as a point-and-click editor. +This feels a lot like using Notepad on MS-Windows. +.B eVim +will always run in the GUI, to enable the use of menus and toolbar. +.PP +Only to be used for people who really can't work with Vim in the normal way. +Editing will be much less efficient. +.PP +.B eview +is the same, but starts in read-only mode. It works just like evim \-R. +.PP +See vim(1) for details about Vim, options, etc. +.PP +The 'insertmode' option is set to be able to type text directly. +.br +Mappings are setup to make Copy and Paste work with the MS-Windows keys. +CTRL-X cuts text, CTRL-C copies text and CTRL-V pastes text. +Use CTRL-Q to obtain the original meaning of CTRL-V. +.SH OPTIONS +See vim(1). +.SH FILES +.TP 15 +/usr/local/lib/vim/evim.vim +The script loaded to initialize eVim. +.SH AKA +Also Known As "Vim for gumbies". +When using evim you are expected to take a handkerchief, +make a knot in each corner and wear it on your head. +.SH SEE ALSO +vim(1) +.SH AUTHOR +Most of +.B Vim +was made by Bram Moolenaar, with a lot of help from others. +See the Help/Credits menu. diff --git a/runtime/doc/vim-ja.UTF-8.1 b/runtime/doc/vim-ja.UTF-8.1 new file mode 100644 index 0000000..a4788b3 --- /dev/null +++ b/runtime/doc/vim-ja.UTF-8.1 @@ -0,0 +1,501 @@ +.TH VIM 1 "2006 Apr 11" +.SH 名前 +vim \- Vi IMproved, プログラマのテキストエディタ +.SH 書式 +.br +.B vim +[options] [file ..] +.br +.B vim +[options] \- +.br +.B vim +[options] \-t tag +.br +.B vim +[options] \-q [errorfile] +.PP +.br +.B ex +.br +.B view +.br +.B gvim +.B gview +.B evim +.B eview +.br +.B rvim +.B rview +.B rgvim +.B rgview +.SH 説明 +.B Vim +は Vi 互換のテキストエディタです。 +どのような種類のプレインテキストでも編集できます。 +特に、プログラムの編集に力を発揮します。 +.PP +Vi に多くの改良が加えられています: +多段アンドゥ、マルチウィンドウ、マルチバッファ、構文強調表示、 +コマンドライン編集、ファイル名補完、ヘルプ、ビジュアル選択、などなど。 +.B Vim +と Vi の違いについての要約は ":help vi_diff.txt" を参照してください。 +.PP +.B Vim +の実行中は ":help" コマンドでヘルプを引くことができます。 +下記、オンラインヘルプの項を参照してください。 +.PP +.B Vim +は次のようなコマンドで起動できます。 +.PP + vim file +.PP +正確な書式は次の通りです: +.PP + vim [options] [filelist] +.PP +filelist を省略した場合は、空のバッファが開かれます。 +指定した場合は、以下の四つのうちどれか一つの方法でファイルが開かれます。 +.TP 12 +file .. +ファイルのリスト。 +一番目のファイルがカレントファイルになり、バッファに読み込まれます。 +カーソルは、バッファの一行目に置かれます。 +他のファイルを表示するには ":next" コマンドを使ってください。 +ファイル名がダッシュで始まるファイルを開く場合は、 +filelist の前に "\-\-" を指定してください。 +.TP +\- +ファイルは標準入力から読み込まれます。コマンドは標準エラー (ttyからの入 +力になっているはず) から読み込まれます。 +.TP +\-t {tag} +開くファイルとカーソルの初期位置は "tag" に依存します。goto label の一種です。 +tags ファイルから {tag} が検索され、関連したファイルがカレントファイルになり +ます。そして、関連したコマンドが実行されます。 +これは主に C 言語のファイルを開くときに使われます。その場合 {tag} に関数など +を指定して使います。 +関数を含んでいるファイルが開かれ、その関数の先頭にカーソルが移動する、 +という動作になります。 +詳しくは ":help tag\-commands" を参照してください。 +.TP +\-q [errorfile] +クイックフィックスモードで起動します。 +[errorfile] に指定したファイルが読み込まれ、最初のエラーが表示されます。 +[errorfile] を省略した場合は、オプション 'errorfile' が使われます (初期設定 +は、Amiga では "AztecC.Err"、その他のシステムでは "errors.err" です)。 +":cn" コマンドで次のエラーにジャンプできます。 +詳しくは ":help quickfix" を参照してください。 +.PP +.B Vim +は、起動されたときの実行ファイルの名前によって動作を変えます +(実行ファイルの実体が同じであっても)。 +.TP 10 +vim +"普通" に起動します。標準の状態です。 +.TP +ex +Ex モードで起動します。 +ノーマルモードに切り替えるには ":vi" コマンドを使ってください。 +引数に "\-e" を指定した場合と同じです。 +.TP +view +読み込み専用モードで起動します。ファイルの保存が制限されます。 +引数に "\-R" を指定した場合と同じです。 +.TP +gvim gview +GUI バージョン。 +新しいウィンドウを開いて起動します。 +引数に "\-g" を指定した場合と同じです。 +.TP +evim eview +簡易モードの GUI バージョン。 +新しいウィンドウを開いて起動します。 +引数に "\-y" を指定した場合と同じです。 +.TP +rvim rview rgvim rgview +上記と同じですが、制限モードで起動します。シェルコマンドを実行したり、 +.B Vim +をサスペンドしたりできなくなります。 +引数に "\-Z" を指定した場合と同じです。 +.SH オプション +ファイル名の前でも後ろでも、好きな順番でオプションを指定できます。 +パラメータを必要としない引数は、一つのダッシュにまとめて指定できます。 +.TP 12 ++[num] +一番目のファイルの "num" 行目にカーソルを移動します。 +"num" を省略した場合は、一行目にカーソルが移動します。 +.TP ++/{pat} +一番目のファイルの、最初に {pat} が見つかった行にカーソルが移動します。 +検索パターンについては ":help search\-pattern" を参照してください。 +.TP ++{command} +.TP +\-c {command} +一番目のファイルが読み込まれた後に {command} が実行されます。 +{command} は Ex コマンドとして解釈されます。 +{command} に空白を含める場合は、ダブルクォートで囲んでください (シェルに依存)。 +例: vim "+set si" main.c +.br +Note: "+" と "\-c" は合わせて 10 個まで指定できます。 +.TP +\-S {file} +一番目のファイルが読み込まれた後に {file} が実行されます。 +これは \-c "source {file}" と同じ動作です。 +{file} の先頭が '\-' の場合は使えません。 +{file} が省略された場合は、"Session.vim" が使われます (ただし \-S が最後の引 +数だった場合のみ)。 +.TP +\-\-cmd {command} +"\-c" と同じですが、vimrc を処理する前にコマンドが実行されます。 +これらのコマンドは "\-c" コマンドとは別に、10 個まで指定できます。 +.TP +\-A +アラビア語がサポートされていて、アラビア語キーマップがある場合は、 +アラビア語モードで起動します ('arabic' がオンになります)。 +右横書きのファイルを編集できます。 +サポートされていない場合はエラーメッセージを表示して終了します。 +.TP +\-b +バイナリモード。 +バイナリファイルを編集ためのオプションがいくつか設定されます。 +.TP +\-C +互換モード。'compatible' オプションがオンになります。 + .vimrc ファイルの有無に関わらず、 +.B Vim +の動作が Vi 互換になります。 +.TP +\-d +差分モードで起動します。 +二つか三つの四つのファイルを引数に指定してください。 +指定されたファイルが開かれ、それらのファイルの差分が表示されます。 +vimdiff(1) と同様の動作です。 +.TP +\-d {device} +{device} を端末として開きます。 +Amiga でのみ使います。 +例: +"\-d con:20/30/600/150". +.TP +\-D +デバッグ。スクリプトの最初のコマンドが実行されるところからデバッグモードを開 +始します。 +.TP +\-e +Ex モードで起動します。 +実行ファイルの名前が "ex" の場合と同じです。 +.TP +\-E +改良版 Ex モードで起動します。 +実行ファイルの名前が "exim" の場合と同じです。 +.TP +\-f +フォアグラウンド。GUI バージョンで、プロセスをフォークしなくなります。 +Amiga の場合は、新しいウィンドウで再起動しなくなります。 +メールソフトなどから +.B Vim +を起動して、編集が終わるまで待機したいような場合に使ってください。 +Amiga では、":sh" と "!" コマンドは機能しなくなります。 +.TP +\-\-nofork +フォアグラウンド。GUI バージョンで、プロセスをフォークしなくなります。 +.TP +\-F +ペルシア語がサポートされていて、ペルシア語キーマップがある場合は、 +ペルシア語モードで起動します ('fkmap' と 'rightleft' がオンになります)。 +右横書きのファイルを編集できます。 +サポートされていない場合はエラーメッセージを表示して終了します。 +.TP +\-g +GUI がサポートされている場合は、GUI で起動します。 +サポートされていない場合はエラーメッセージを表示して終了します。 +.TP +\-h +コマンドライン引数やオプションのヘルプを表示して終了します。 +.TP +\-H +ヘブライ語がサポートされていて、ヘブライ語キーマップがある場合は、 +ヘブライ語モードで起動します ('hkmap' と 'rightleft' がオンになります)。 +右横書きのファイルを編集できます。 +サポートされていない場合はエラーメッセージを表示して終了します。 +.TP +\-i {viminfo} +viminfo ファイルを使う設定になっている場合は、初期設定の "~/.viminfo" の代わ +りに、指定されたファイルを設定します。 +"NONE" を指定すると、.viminfo ファイルを使わないように設定できます。 +.TP +\-L +\-r と同じです。 +.TP +\-l +lisp モード。 +オプションの 'lisp' と 'showmatch' がオンになります。 +.TP +\-m +ファイルの変更を不可能にします。 +オプション 'write' がオフになります。 +バッファを変更することはできますが、ファイルを保存することはできません。 +.TP +\-M +変更を不可能にします。オプションの 'modifiable' と 'write' がオフになり、 +ファイルの変更と保存ができなくなります。 +Note: それらのオプションを設定すれば変更できるようになります。 +.TP +\-N +非互換モード。'compatible' オプションがオフになります。 + .vimrc ファイルの有無に関わらず、 +.B Vim +の改良された機能が有効になります。Vi との互換性が少し失われます。 +.TP +\-n +スワップファイルを使用しません。 +クラッシュしてもリカバリできなくなります。 +フロッピーディスクのような非常に低速なメディアのファイルを読み書きするときに +便利です。 +":set uc=0" と設定しても同じです。 +戻すには ":set uc=200" と設定してください。 +.TP +\-nb +NetBeans と接続し、エディタサーバーになります。 +詳しくはヘルプを参照してください。 +.TP +\-o[N] +N 個のウィンドウを水平分割で開きます。 +N を省略した場合は、引数のファイルを個別のウィンドウで開きます。 +.TP +\-O[N] +N 個のウィンドウを垂直分割で開きます。 +N を省略した場合は、引数のファイルを個別のウィンドウで開きます。 +.TP +\-p[N] +N 個のタブページを開きます。 +N を省略した場合は、引数のファイルを個別のタブページで開きます。 +.TP +\-R +読み込み専用モード。 +オプション 'readonly' がオンになります。 +バッファを変更することはできますが、間違ってファイルを上書きしてしまうのを防 +ぐことができます。 +ファイルを保存したい場合は、":w!" のように、Ex コマンドに感嘆符を付けてくだ +さい。 +\-R オプションは \-n オプションの効果も含んでいます (下記参照)。 +オプション 'readonly' は ":set noro" でオフにできます。 +詳しくは ":help 'readonly'" を参照してください。 +.TP +\-r +スワップファイルの一覧を表示します。リカバリに関する情報も表示されます。 +.TP +\-r {file} +リカバリモード。 +スワップファイルを使って、クラッシュした編集セッションを復活させます。 +スワップファイルは、ファイル名に ".swp" を加えた名前のファイルです。 +詳しくは ":help recovery" を参照してください。 +.TP +\-s +サイレントモード。"ex" という名前で起動するか、"\-e" オプションの後で +"\-s" オプションが指定された場合のみ。 +.TP +\-s {scriptin} +{scriptin} をスクリプトファイルとして読み込まれます。 +ファイル中の文字列は、手で入力したときと同じように処理されます。 +これは ":source! {scriptin}" と同じ動作です。 +エディタが終了する前にファイルの終わりまで読み込んだ場合、 +それ以降はキーボードから入力を読み込みます。 +.TP +\-T {terminal} +端末の名前を指定します。 +端末が自動的に認識されない場合に使ってください。 +Vim が組み込みでサポートしている名前か、 +termcap または terminfo ファイルで定義されている名前を指定してください。 +.TP +\-u {vimrc} +{vimrc} ファイルを使って初期化します。 +他の初期化処理はスキップされます。 +特殊なファイルを編集する場合などに使ってください。 +すべての初期化をスキップするには "NONE" を指定してください。 +詳しくは ":help initialization" を参照してください。 +.TP +\-U {gvimrc} +{gvimrc} ファイルを使って GUI を初期化します。 +他の GUI の初期化はスキップされます。 +すべての GUI の初期化をスキップするには "NONE" を指定してください。 +詳しくは ":help gui\-init" を参照してください。 +.TP +\-V[N] +冗長モード。スクリプトファイルを実行したり viminfo ファイルを読み書きするた +びにメッセージを表示します。N に指定した数値が 'verbose' に設定されます。 +省略した場合は 10 になります。 +.TP +\-v +Vi モードで起動します。 +実行ファイルの名前が "vi" の場合と同じです。 +実行ファイルの名前が "ex" の場合だけ効果があります。 +.TP +\-w {scriptout} +入力した文字を {scriptout} に記録します。 +"vim \-s" や "source!" で実行するためのスクリプトファイルを作成するのに便利 +です。 +{scriptout} ファイルがすでに存在した場合は追加保存されます。 +.TP +\-W {scriptout} +\-w と同じですが、ファイルがすでに存在した場合は上書きされます。 +.TP +\-x +ファイルを暗号化して書き込みます。暗号化キーの入力プロンプトが表示されます。 +.TP +\-X +X サーバーと通信しません。端末での起動時間を短くできます。 +しかし、ウィンドウタイトルの変更やクリップボードは使えなくなります。 +.TP +\-y +簡易モードで起動します。 +実行ファイルの名前が "evim" や "eview" の場合と同じです。 +.B Vim +の動作がモードレスエディタ (click-and-type editor) のようになります。 +.TP +\-Z +制限モード。 +実行ファイルの名前が "r" で始まっている場合と同じです。 +.TP +\-\- +オプション指定の末尾を示す記号です。 +これ以降の引数はすべてファイル名として扱われます。 +ファイル名が '\-' で始まっているファイルを開くときに使ってください。 +.TP +\-\-echo\-wid +GTK GUI のみ: Window ID を標準出力に出力します。 +.TP +\-\-help +ヘルプを表示して終了します。"\-h" と同じです。 +.TP +\-\-literal +引数のファイル名をリテラル文字列として扱います。ワイルドカードを展開しませ +ん。Unix のように、シェルがワイルドカードを展開する場合は機能しません。 +.TP +\-\-noplugin +プラグインをロードしません。\-u NONE はこの動作を含んでいます。 +.TP +\-\-remote +Vim サーバーと通信し、引数に指定されたファイルを Vim サーバーで開きます。 +サーバーが存在しない場合は、エラーメッセージを表示され、起動中の Vim でファ +イルが開かれます。 +.TP +\-\-remote\-expr {expr} +Vim サーバーと通信し、{expr} に与えられた式を Vim サーバーで実行し、結果を標 +準出力に出力します。 +.TP +\-\-remote\-send {keys} +Vim サーバーと通信し、{keys} に与えられたキーを Vim サーバーに送信します。 +.TP +\-\-remote\-silent +\-\-remote と同じですが、サーバーが存在しなくてもエラーメッセージを表示しま +せん。 +.TP +\-\-remote\-wait +\-\-remote と同じですが、ファイルが開かれるのを確認できるまで待機します。 +.TP +\-\-remote\-wait\-silent +\-\-remote\-wait と同じですが、サーバーが存在しなくてもエラーメッセージを表 +示しません。 +.TP +\-\-serverlist +Vim サーバーの一覧を表示します。 +.TP +\-\-servername {name} +サーバーの名前を {name} に設定します。\-\-remote 引数を指定しなかった場合 +は、起動中の Vim の名前として使われるので、後からその名前を使ってサーバー通 +信できます。 +.TP +\-\-socketid {id} +GTK GUI のみ: GtkPlug メカニズムを使って gvim を別のウィンドウの中で実行しま +す。 +.TP +\-\-version +バージョン情報を表示して終了します。 +.SH オンラインヘルプ +ヘルプを開くには、 +.B Vim +の中で ":help" と入力してください。 +":help 調べたい項目" と入力すれば、指定した項目のヘルプが表示されます。 +例: "ZZ" コマンドのヘルプを表示するには ":help ZZ" と入力します。 + や CTRL\-D を使って補完することもできます +(":help cmdline\-completion" 参照)。 +ヘルプには、項目から項目へジャンプできるようにタグが埋め込まれています +(ハイパーリンクのようなものです。":help" 参照)。 +すべてのヘルプファイルはこの方法で開くことができます。 +例: ":help syntax.txt"。 +.SH ファイル +.TP 15 +/usr/local/lib/vim/doc/*.txt +.B Vim +のヘルプファイル。 +ファイルの一覧は ":help doc\-file\-list" に記載されています。 +.TP +/usr/local/lib/vim/doc/tags +ヘルプを検索するための tags ファイル。 +.TP +/usr/local/lib/vim/syntax/syntax.vim +システムの構文定義初期化ファイル。 +.TP +/usr/local/lib/vim/syntax/*.vim +いろいろな言語用の構文定義ファイル。 +.TP +/usr/local/lib/vim/vimrc +システムの +.B Vim +初期化ファイル。 +.TP +~/.vimrc +ユーザーの +.B Vim +初期化ファイル。 +.TP +/usr/local/lib/vim/gvimrc +システムの gvim 初期化ファイル。 +.TP +~/.gvimrc +ユーザーの gvim 初期化ファイル。 +.TP +/usr/local/lib/vim/optwin.vim +":options" コマンドで使われるファイル。オプションを表示したり設定したりでき +ます。 +.TP +/usr/local/lib/vim/menu.vim +システムのメニュー初期化ファイル。gvim で使います。 +.TP +/usr/local/lib/vim/bugreport.vim +バグレポートを生成するスクリプト。":help bugs" 参照。 +.TP +/usr/local/lib/vim/filetype.vim +ファイル名からファイルタイプを判定するスクリプト。":help 'filetype'" 参照。 +.TP +/usr/local/lib/vim/scripts.vim +ファイルの内容からファイルタイプを判定するスクリプト。":help 'filetype'" 参照。 +.TP +/usr/local/lib/vim/print/*.ps +PostScript 印刷に使われるファイル。 +.PP +最新の情報は VIM のホームページを参照してください: +.br + +.SH 関連項目 +vimtutor(1) +.SH 著者 +.B Vim +のほとんどの機能は Bram Moolenaar が開発し、多くの人が協力しました。 +":help credits" を参照してください。 +.br +.B Vim +は Stevie を基にしています。Stevie は Tim Thompson、Tony Andrews、 +G.R. (Fred) Walter によって開発されました。 +ただし、オリジナルのコードはもうほとんど残っていません。 +.SH バグ +既知のバグは ":help todo" に記載されています。 +.PP +Vi の動作を忠実に再現した結果、多くの人がバグだと思うような機能もいくつかあ +ります。 +"この動作は Vi と違う" からバグだと思った場合は、vi_diff.txtを確認してみてく +ださい (ファイルを開くか、Vim から ":help vi_diff.txt" と入力)。 +オプションの 'compatible' と 'cpoptions' も確認してください。 diff --git a/runtime/doc/vim.1 b/runtime/doc/vim.1 new file mode 100644 index 0000000..820caa2 --- /dev/null +++ b/runtime/doc/vim.1 @@ -0,0 +1,553 @@ +.TH VIM 1 "2006 Apr 11" +.SH NAME +vim \- Vi IMproved, a programmers text editor +.SH SYNOPSIS +.br +.B vim +[options] [file ..] +.br +.B vim +[options] \- +.br +.B vim +[options] \-t tag +.br +.B vim +[options] \-q [errorfile] +.PP +.br +.B ex +.br +.B view +.br +.B gvim +.B gview +.B evim +.B eview +.br +.B rvim +.B rview +.B rgvim +.B rgview +.SH DESCRIPTION +.B Vim +is a text editor that is upwards compatible to Vi. +It can be used to edit all kinds of plain text. +It is especially useful for editing programs. +.PP +There are a lot of enhancements above Vi: multi level undo, +multi windows and buffers, syntax highlighting, command line +editing, filename completion, on-line help, visual selection, etc.. +See ":help vi_diff.txt" for a summary of the differences between +.B Vim +and Vi. +.PP +While running +.B Vim +a lot of help can be obtained from the on-line help system, with the ":help" +command. +See the ON-LINE HELP section below. +.PP +Most often +.B Vim +is started to edit a single file with the command +.PP + vim file +.PP +More generally +.B Vim +is started with: +.PP + vim [options] [filelist] +.PP +If the filelist is missing, the editor will start with an empty buffer. +Otherwise exactly one out of the following four may be used to choose one or +more files to be edited. +.TP 12 +file .. +A list of filenames. +The first one will be the current file and read into the buffer. +The cursor will be positioned on the first line of the buffer. +You can get to the other files with the ":next" command. +To edit a file that starts with a dash, precede the filelist with "\-\-". +.TP +\- +The file to edit is read from stdin. Commands are read from stderr, which +should be a tty. +.TP +\-t {tag} +The file to edit and the initial cursor position depends on a "tag", a sort +of goto label. +{tag} is looked up in the tags file, the associated file becomes the current +file and the associated command is executed. +Mostly this is used for C programs, in which case {tag} could be a function +name. +The effect is that the file containing that function becomes the current file +and the cursor is positioned on the start of the function. +See ":help tag\-commands". +.TP +\-q [errorfile] +Start in quickFix mode. +The file [errorfile] is read and the first error is displayed. +If [errorfile] is omitted, the filename is obtained from the 'errorfile' +option (defaults to "AztecC.Err" for the Amiga, "errors.err" on other +systems). +Further errors can be jumped to with the ":cn" command. +See ":help quickfix". +.PP +.B Vim +behaves differently, depending on the name of the command (the executable may +still be the same file). +.TP 10 +vim +The "normal" way, everything is default. +.TP +ex +Start in Ex mode. +Go to Normal mode with the ":vi" command. +Can also be done with the "\-e" argument. +.TP +view +Start in read-only mode. You will be protected from writing the files. Can +also be done with the "\-R" argument. +.TP +gvim gview +The GUI version. +Starts a new window. +Can also be done with the "\-g" argument. +.TP +evim eview +The GUI version in easy mode. +Starts a new window. +Can also be done with the "\-y" argument. +.TP +rvim rview rgvim rgview +Like the above, but with restrictions. It will not be possible to start shell +commands, or suspend +.B Vim. +Can also be done with the "\-Z" argument. +.SH OPTIONS +The options may be given in any order, before or after filenames. +Options without an argument can be combined after a single dash. +.TP 12 ++[num] +For the first file the cursor will be positioned on line "num". +If "num" is missing, the cursor will be positioned on the last line. +.TP ++/{pat} +For the first file the cursor will be positioned on the +first occurrence of {pat}. +See ":help search\-pattern" for the available search patterns. +.TP ++{command} +.TP +\-c {command} +{command} will be executed after the +first file has been read. +{command} is interpreted as an Ex command. +If the {command} contains spaces it must be enclosed in double quotes (this +depends on the shell that is used). +Example: Vim "+set si" main.c +.br +Note: You can use up to 10 "+" or "\-c" commands. +.TP +\-S {file} +{file} will be sourced after the first file has been read. +This is equivalent to \-c "source {file}". +{file} cannot start with '\-'. +If {file} is omitted "Session.vim" is used (only works when \-S is the last +argument). +.TP +\-\-cmd {command} +Like using "\-c", but the command is executed just before +processing any vimrc file. +You can use up to 10 of these commands, independently from "\-c" commands. +.TP +\-A +If +.B Vim +has been compiled with ARABIC support for editing right-to-left +oriented files and Arabic keyboard mapping, this option starts +.B Vim +in Arabic mode, i.e. 'arabic' is set. Otherwise an error +message is given and +.B Vim +aborts. +.TP +\-b +Binary mode. +A few options will be set that makes it possible to edit a binary or +executable file. +.TP +\-C +Compatible. Set the 'compatible' option. +This will make +.B Vim +behave mostly like Vi, even though a .vimrc file exists. +.TP +\-d +Start in diff mode. +There should be two, three or four file name arguments. +.B Vim +will open all the files and show differences between them. +Works like vimdiff(1). +.TP +\-d {device} +Open {device} for use as a terminal. +Only on the Amiga. +Example: +"\-d con:20/30/600/150". +.TP +\-D +Debugging. Go to debugging mode when executing the first command from a +script. +.TP +\-e +Start +.B Vim +in Ex mode, just like the executable was called "ex". +.TP +\-E +Start +.B Vim +in improved Ex mode, just like the executable was called "exim". +.TP +\-f +Foreground. For the GUI version, +.B Vim +will not fork and detach from the shell it was started in. +On the Amiga, +.B Vim +is not restarted to open a new window. +This option should be used when +.B Vim +is executed by a program that will wait for the edit +session to finish (e.g. mail). +On the Amiga the ":sh" and ":!" commands will not work. +.TP +\-\-nofork +Foreground. For the GUI version, +.B Vim +will not fork and detach from the shell it was started in. +.TP +\-F +If +.B Vim +has been compiled with FKMAP support for editing right-to-left +oriented files and Farsi keyboard mapping, this option starts +.B Vim +in Farsi mode, i.e. 'fkmap' and 'rightleft' are set. +Otherwise an error message is given and +.B Vim +aborts. +.TP +\-g +If +.B Vim +has been compiled with GUI support, this option enables the GUI. +If no GUI support was compiled in, an error message is given and +.B Vim +aborts. +.TP +\-h +Give a bit of help about the command line arguments and options. +After this +.B Vim +exits. +.TP +\-H +If +.B Vim +has been compiled with RIGHTLEFT support for editing right-to-left +oriented files and Hebrew keyboard mapping, this option starts +.B Vim +in Hebrew mode, i.e. 'hkmap' and 'rightleft' are set. +Otherwise an error message is given and +.B Vim +aborts. +.TP +\-i {viminfo} +When using the viminfo file is enabled, this option sets the filename to use, +instead of the default "~/.viminfo". +This can also be used to skip the use of the .viminfo file, by giving the name +"NONE". +.TP +\-L +Same as \-r. +.TP +\-l +Lisp mode. +Sets the 'lisp' and 'showmatch' options on. +.TP +\-m +Modifying files is disabled. +Resets the 'write' option. +You can still modify the buffer, but writing a file is not possible. +.TP +\-M +Modifications not allowed. The 'modifiable' and 'write' options will be unset, +so that changes are not allowed and files can not be written. Note that these +options can be set to enable making modifications. +.TP +\-N +No-compatible mode. Reset the 'compatible' option. +This will make +.B Vim +behave a bit better, but less Vi compatible, even though a .vimrc file does +not exist. +.TP +\-n +No swap file will be used. +Recovery after a crash will be impossible. +Handy if you want to edit a file on a very slow medium (e.g. floppy). +Can also be done with ":set uc=0". +Can be undone with ":set uc=200". +.TP +\-nb +Become an editor server for NetBeans. See the docs for details. +.TP +\-o[N] +Open N windows stacked. +When N is omitted, open one window for each file. +.TP +\-O[N] +Open N windows side by side. +When N is omitted, open one window for each file. +.TP +\-p[N] +Open N tab pages. +When N is omitted, open one tab page for each file. +.TP +\-R +Read-only mode. +The 'readonly' option will be set. +You can still edit the buffer, but will be prevented from accidently +overwriting a file. +If you do want to overwrite a file, add an exclamation mark to the Ex command, +as in ":w!". +The \-R option also implies the \-n option (see below). +The 'readonly' option can be reset with ":set noro". +See ":help 'readonly'". +.TP +\-r +List swap files, with information about using them for recovery. +.TP +\-r {file} +Recovery mode. +The swap file is used to recover a crashed editing session. +The swap file is a file with the same filename as the text file with ".swp" +appended. +See ":help recovery". +.TP +\-s +Silent mode. Only when started as "Ex" or when the "\-e" option was given +before the "\-s" option. +.TP +\-s {scriptin} +The script file {scriptin} is read. +The characters in the file are interpreted as if you had typed them. +The same can be done with the command ":source! {scriptin}". +If the end of the file is reached before the editor exits, further characters +are read from the keyboard. +.TP +\-T {terminal} +Tells +.B Vim +the name of the terminal you are using. +Only required when the automatic way doesn't work. +Should be a terminal known +to +.B Vim +(builtin) or defined in the termcap or terminfo file. +.TP +\-u {vimrc} +Use the commands in the file {vimrc} for initializations. +All the other initializations are skipped. +Use this to edit a special kind of files. +It can also be used to skip all initializations by giving the name "NONE". +See ":help initialization" within vim for more details. +.TP +\-U {gvimrc} +Use the commands in the file {gvimrc} for GUI initializations. +All the other GUI initializations are skipped. +It can also be used to skip all GUI initializations by giving the name "NONE". +See ":help gui\-init" within vim for more details. +.TP +\-V[N] +Verbose. Give messages about which files are sourced and for reading and +writing a viminfo file. The optional number N is the value for 'verbose'. +Default is 10. +.TP +\-v +Start +.B Vim +in Vi mode, just like the executable was called "vi". This only has effect +when the executable is called "ex". +.TP +\-w {scriptout} +All the characters that you type are recorded in the file +{scriptout}, until you exit +.B Vim. +This is useful if you want to create a script file to be used with "vim \-s" or +":source!". +If the {scriptout} file exists, characters are appended. +.TP +\-W {scriptout} +Like \-w, but an existing file is overwritten. +.TP +\-x +Use encryption when writing files. Will prompt for a crypt key. +.TP +\-X +Don't connect to the X server. Shortens startup time in a terminal, but the +window title and clipboard will not be used. +.TP +\-y +Start +.B Vim +in easy mode, just like the executable was called "evim" or "eview". +Makes +.B Vim +behave like a click-and-type editor. +.TP +\-Z +Restricted mode. Works like the executable starts with "r". +.TP +\-\- +Denotes the end of the options. +Arguments after this will be handled as a file name. +This can be used to edit a filename that starts with a '\-'. +.TP +\-\-echo\-wid +GTK GUI only: Echo the Window ID on stdout. +.TP +\-\-help +Give a help message and exit, just like "\-h". +.TP +\-\-literal +Take file name arguments literally, do not expand wildcards. This has no +effect on Unix where the shell expands wildcards. +.TP +\-\-noplugin +Skip loading plugins. Implied by \-u NONE. +.TP +\-\-remote +Connect to a Vim server and make it edit the files given in the rest of the +arguments. If no server is found a warning is given and the files are edited +in the current Vim. +.TP +\-\-remote\-expr {expr} +Connect to a Vim server, evaluate {expr} in it and print the result on stdout. +.TP +\-\-remote\-send {keys} +Connect to a Vim server and send {keys} to it. +.TP +\-\-remote\-silent +As \-\-remote, but without the warning when no server is found. +.TP +\-\-remote\-wait +As \-\-remote, but Vim does not exit until the files have been edited. +.TP +\-\-remote\-wait\-silent +As \-\-remote\-wait, but without the warning when no server is found. +.TP +\-\-serverlist +List the names of all Vim servers that can be found. +.TP +\-\-servername {name} +Use {name} as the server name. Used for the current Vim, unless used with a +\-\-remote argument, then it's the name of the server to connect to. +.TP +\-\-socketid {id} +GTK GUI only: Use the GtkPlug mechanism to run gvim in another window. +.TP +\-\-version +Print version information and exit. +.SH ON-LINE HELP +Type ":help" in +.B Vim +to get started. +Type ":help subject" to get help on a specific subject. +For example: ":help ZZ" to get help for the "ZZ" command. +Use and CTRL-D to complete subjects (":help cmdline\-completion"). +Tags are present to jump from one place to another (sort of hypertext links, +see ":help"). +All documentation files can be viewed in this way, for example +":help syntax.txt". +.SH FILES +.TP 15 +/usr/local/lib/vim/doc/*.txt +The +.B Vim +documentation files. +Use ":help doc\-file\-list" to get the complete list. +.TP +/usr/local/lib/vim/doc/tags +The tags file used for finding information in the documentation files. +.TP +/usr/local/lib/vim/syntax/syntax.vim +System wide syntax initializations. +.TP +/usr/local/lib/vim/syntax/*.vim +Syntax files for various languages. +.TP +/usr/local/lib/vim/vimrc +System wide +.B Vim +initializations. +.TP +~/.vimrc +Your personal +.B Vim +initializations. +.TP +/usr/local/lib/vim/gvimrc +System wide gvim initializations. +.TP +~/.gvimrc +Your personal gvim initializations. +.TP +/usr/local/lib/vim/optwin.vim +Script used for the ":options" command, a nice way to view and set options. +.TP +/usr/local/lib/vim/menu.vim +System wide menu initializations for gvim. +.TP +/usr/local/lib/vim/bugreport.vim +Script to generate a bug report. See ":help bugs". +.TP +/usr/local/lib/vim/filetype.vim +Script to detect the type of a file by its name. See ":help 'filetype'". +.TP +/usr/local/lib/vim/scripts.vim +Script to detect the type of a file by its contents. See ":help 'filetype'". +.TP +/usr/local/lib/vim/print/*.ps +Files used for PostScript printing. +.PP +For recent info read the VIM home page: +.br + +.SH SEE ALSO +vimtutor(1) +.SH AUTHOR +Most of +.B Vim +was made by Bram Moolenaar, with a lot of help from others. +See ":help credits" in +.B Vim. +.br +.B Vim +is based on Stevie, worked on by: Tim Thompson, +Tony Andrews and G.R. (Fred) Walter. +Although hardly any of the original code remains. +.SH BUGS +Probably. +See ":help todo" for a list of known problems. +.PP +Note that a number of things that may be regarded as bugs by some, are in fact +caused by a too-faithful reproduction of Vi's behaviour. +And if you think other things are bugs "because Vi does it differently", +you should take a closer look at the vi_diff.txt file (or type :help +vi_diff.txt when in Vim). +Also have a look at the 'compatible' and 'cpoptions' options. diff --git a/runtime/doc/vimdiff-ja.UTF-8.1 b/runtime/doc/vimdiff-ja.UTF-8.1 new file mode 100644 index 0000000..56fadfe --- /dev/null +++ b/runtime/doc/vimdiff-ja.UTF-8.1 @@ -0,0 +1,44 @@ +.TH VIMDIFF 1 "2001 March 30" +.SH 名前 +vimdiff \- 二つか三つか四つのファイルを Vim で開いて、その差分を表示する +.SH 書式 +.br +.B vimdiff +[options] file1 file2 [file3 [file4]] +.PP +.B gvimdiff +.SH 説明 +.B Vimdiff +は、二つ (か三つか四つ) のファイルを +.B Vim +で開きます。 +ファイルは個別のウィンドウで開かれ、差分が強調表示されます。 +同じファイルの別のバージョン間で、変更を確認したり、変更を移動したりするのが +簡単になります。 +.PP +Vim についての詳細は vim(1) を参照してください。 +.PP +.B gvimdiff +という名前で起動された場合は GUI で起動します。 +.PP +差分を強調表示するために、 +それぞれのウィンドウの 'diff' オプションがオンに設定されます。 +.br +テキストを見やすくするために、オプションの 'wrap' と 'scrollbind' もオンに設 +定されます。 +.br + 'foldmethod' オプションは "diff" に設定され、変更されていない行は折り畳まれ +ます。 +折り畳みの確認と開閉が簡単にできるように、'foldcolumn' は 2 に設定されます。 +.SH オプション +行を並べて表示するために、"\-O" 引数を使ったときのように、ウィンドウは垂直分 +割されます。 +ウィンドウを水平分割したい場合は "\-o" 引数を使ってください。 +.PP +その他の引数については vim(1) を参照してください。 +.SH 関連項目 +vim(1) +.SH 著者 +.B Vim +のほとんどの機能は Bram Moolenaar が開発し、多くの人が協力しました。 +":help credits" を参照してください。 diff --git a/runtime/doc/vimdiff.1 b/runtime/doc/vimdiff.1 new file mode 100644 index 0000000..bed2b32 --- /dev/null +++ b/runtime/doc/vimdiff.1 @@ -0,0 +1,46 @@ +.TH VIMDIFF 1 "2001 March 30" +.SH NAME +vimdiff \- edit two, three or four versions of a file with Vim and show differences +.SH SYNOPSIS +.br +.B vimdiff +[options] file1 file2 [file3 [file4]] +.PP +.B gvimdiff +.SH DESCRIPTION +.B Vimdiff +starts +.B Vim +on two (or three or four) files. +Each file gets its own window. +The differences between the files are highlighted. +This is a nice way to inspect changes and to move changes from one version +to another version of the same file. +.PP +See vim(1) for details about Vim itself. +.PP +When started as +.B gvimdiff +the GUI will be started, if available. +.PP +In each window the 'diff' option will be set, which causes the differences +to be highlighted. +.br +The 'wrap' and 'scrollbind' options are set to make the text look good. +.br +The 'foldmethod' option is set to "diff", which puts ranges of lines without +changes in a fold. 'foldcolumn' is set to two to make it easy to spot the +folds and open or close them. +.SH OPTIONS +Vertical splits are used to align the lines, as if the "\-O" argument was used. +To use horizontal splits instead, use the "\-o" argument. +.PP +For all other arguments see vim(1). +.SH SEE ALSO +vim(1) +.SH AUTHOR +Most of +.B Vim +was made by Bram Moolenaar, with a lot of help from others. +See ":help credits" in +.B Vim. diff --git a/runtime/doc/vimtutor-ja.UTF-8.1 b/runtime/doc/vimtutor-ja.UTF-8.1 new file mode 100644 index 0000000..29b9b48 --- /dev/null +++ b/runtime/doc/vimtutor-ja.UTF-8.1 @@ -0,0 +1,45 @@ +.TH VIMTUTOR 1 "2001 April 2" +.SH 名前 +vimtutor \- Vim チュートリアル +.SH 書式 +.br +.B vimtutor [\-g] [language] +.SH 説明 +.B Vim +のチュートリアルを起動します。 +演習ファイルのコピーを使って実施するので、オリジナルの演習ファイルを壊してし +まう心配はありません。 +.PP +.B Vim +を初めて学ぶ人向けのチュートリアルです。 +.PP +引数に \-g を指定すると GUI 版の vim が利用可能であれば vim ではなく gvim を +使って vimtutor が開始します。gvim が見つからないときは Vim が使用されます。 +.PP +[language] 引数は "ja" や "es" などの二文字の言語名です。 +[language] 引数を省略した場合はロケールの言語が使われます。 +翻訳された演習ファイルがある場合は、そのファイルが使われます。 +ない場合は英語のファイルが使われます。 +.PP +.B Vim +は Vi 互換モードで起動されます。 +.SH ファイル +.TP 15 +/usr/local/lib/vim/tutor/tutor[.language] +.B Vimtutor +の演習ファイル。 +.TP 15 +/usr/local/lib/vim/tutor/tutor.vim +演習ファイルをコピーするための Vim スクリプト。 +.SH 著者 +.B Vimtutor +は、Colorado State University の Charles Smith のアイデアを基に、 +Colorado School of Mines の Michael C. Pierce と Robert K. Ware の両名 +によって Vi 向けに作成されたものを基にしています。 +E-mail: bware@mines.colorado.edu. +.br +.B Vim +に合わせて Bram Moolenaar が変更を加えました。 +翻訳者の名前は演習ファイルを参照してください。 +.SH 関連項目 +vim(1) diff --git a/runtime/doc/vimtutor.1 b/runtime/doc/vimtutor.1 new file mode 100644 index 0000000..0aa7e8d --- /dev/null +++ b/runtime/doc/vimtutor.1 @@ -0,0 +1,57 @@ +.TH VIMTUTOR 1 "2001 April 2" +.SH NAME +vimtutor \- the Vim tutor +.SH SYNOPSIS +.br +.B vimtutor [\-g] [language] +.SH DESCRIPTION +.B Vimtutor +starts the +.B Vim +tutor. +It copies the tutor file first, so that it can be modified without changing +the original file. +.PP +The +.B Vimtutor +is useful for people that want to learn their first +.B Vim +commands. +.PP +The optional argument \-g starts vimtutor with gvim rather than vim, if the +GUI version of vim is available, or falls back to Vim if gvim is not found. +.PP +The optional [language] argument is the two-letter name of a language, like +"it" or "es". +If the [language] argument is missing, the language of the current locale will +be used. +If a tutor in this language is available, it will be used. +Otherwise the English version will be used. +.PP +.B Vim +is always started in Vi compatible mode. +.SH FILES +.TP 15 +/usr/local/lib/vim/tutor/tutor[.language] +The +.B Vimtutor +text file(s). +.TP 15 +/usr/local/lib/vim/tutor/tutor.vim +The Vim script used to copy the +.B Vimtutor +text file. +.SH AUTHOR +The +.B Vimtutor +was originally written for Vi by Michael C. Pierce and Robert K. Ware, +Colorado School of Mines using ideas supplied by Charles Smith, +Colorado State University. +E-mail: bware@mines.colorado.edu. +.br +It was modified for +.B Vim +by Bram Moolenaar. +For the names of the translators see the tutor files. +.SH SEE ALSO +vim(1) diff --git a/runtime/doc/xxd-ja.UTF-8.1 b/runtime/doc/xxd-ja.UTF-8.1 new file mode 100644 index 0000000..8a8d54b --- /dev/null +++ b/runtime/doc/xxd-ja.UTF-8.1 @@ -0,0 +1,366 @@ +.TH XXD 1 "August 1996" "Manual page for xxd" +.\" +.\" 21st May 1996 +.\" Man page author: +.\" Tony Nugent +.\" Changes by Bram Moolenaar +.SH 名前 +.I xxd +\- 16 進ダンプを作成したり、元に戻したり。 +.SH 書式 +.B xxd +\-h[elp] +.br +.B xxd +[options] [infile [outfile]] +.br +.B xxd +\-r[evert] [options] [infile [outfile]] +.SH 説明 +ファイルや標準入力から 16 進ダンプを作成します。 +16 進ダンプから元のバイナリに戻すこともできます。 +.BR uuencode (1) +や +.BR uudecode (1) +のように、バイナリデータを、メールに貼り付け可能な ASCII 形式に変換できた +り、標準出力に出力することもできます。 +さらに、バイナリファイルにパッチを当てるという使い方もできます。 +.SH オプション +.I infile +を指定しなかった場合は、標準入力が読み込まれます。 +.I infile +に +.RB \` \- ' +を指定した場合も、標準入力から読み込まれます。 +.I outfile +を指定しなかった (または +.RB \` \- ' +を指定した) 場合は、標準出力に出力されます。 +.PP +引数の解釈処理は適当なので注意してください。パラメータを取らない引数は +最初の一文字だけチェックされます。 +引数の文字とパラメータの間のスペースは省略可能です。 +パラメータは 10 進数、16 進数、8 進数で指定できます。 +.BR \-c8 +、 +.BR "\-c 8" +、 +.B \-c 010 +、 +.B \-cols 8 +はすべて同じ意味です。 +.PP +.TP +.IR \-a " | " \-autoskip +オートスキップ: 連続した nul 行を一つの '*' で置き換える。 +.TP +.IR \-b " | " \-bits +ビット (2進数) ダンプ。 +1 オクテットが "1" と "0" の 8 文字で出力されます。 +各行の行頭には 16 進数の行番号が表示されます。 +行末には ascii (または ebcdic) で表した場合の文字が表示されます。 +このモードでは \-r、\-p、\-i は機能しません。 +.TP +.IR "\-c cols " | " \-cols cols" +一行 +.RI < cols > +オクテットで出力する。標準設定は 16 (\-i: 12, \-ps: 30, \-b: 6)。最大 256。 +.TP +.IR \-E " | " \-EBCDIC +右端に出力される文字のエンコーディングを ASCII から EBCDIC に変更する。 +16 進ダンプの出力形式は変更されません。 +\-r、\-p、\-i が同時に指定された場合は何の効果もありません。 +.TP +.IR "\-g bytes " | " \-groupsize bytes" +出力を +.RI < bytes > +バイト (2 文字の 16 進数、または 8 文字の 2 進数) ごとにスペースで区切りま +す。 +区切らずに出力するには +.I \-g 0 +を指定してください。 +.RI < Bytes > +の標準設定は \fI2\fP です。2 進ダンプの場合は \fI1\fP です。 +ポストスクリプト形式やインクルード形式で出力するときは、このオプションは使わ +れません。 +.TP +.IR \-h " | " \-help +コマンドの説明を出力して終了する。変換は実行されません。 +.TP +.IR \-i " | " \-include +C インクルードファイル形式で出力します。入力ファイルの名前が付けられた静的配 +列の定義が出力されます。標準入力の場合は定義の中身だけ出力されます。 +.TP +.IR "\-l len " | " \-len len" +.RI < len > +オクテットだけ出力する。 +.TP +.IR \-p " | " \-ps " | " \-postscript " | " \-plain +ポストスクリプト形式の 16 進ダンプを出力する。別名 プレーン 16 進ダンプ。 +.TP +.IR \-r " | " \-revert +元に戻す: 16 進ダンプからバイナリ形式に変換 (またはパッチ) します。 +ファイルへ出力する場合、出力先のファイルは切り詰めされません。 +行番号や特定の書式がないプレーン 16 進ダンプを読み込む場合は、 +.I \-r \-p +を指定してください。空白と改行は無視されます。 +.TP +.I \-seek offset +.IR \-r +の後で使われた場合: 16 進ダンプを出力するファイルの位置に +.RI < offset > +を加える。 +.TP +.I \-s [+][\-]seek +infile の +.RI < seek > +バイト目 (絶対位置、または相対位置) から開始する。 +\fI+ \fRは、現在の標準入力の位置から相対的な位置を示します +(標準入力から読み込むときのみ意味があります)。\fI\- \fRは、入力の終わりから +の文字数を示します (\fI+\fR と同時に指定した場合は、現在の標準入力の位置から +手前の位置を示します)。 +\-s 引数を指定しなかった場合は、現在のファイル位置から開始されます。 +.TP +.I \-u +16 進数の表記に大文字を使います。指定がない場合は小文字で出力されます。 +.TP +.IR \-v " | " \-version +バージョンを表示します。 +.SH 警告 +.PP +.I xxd \-r +では行番号の評価に関しての暗黙のルールがいくつかあります。 +出力ファイルがシーク可能なら、各行の行番号が順番通りに並んでなくても構いませ +ん。位置が飛んでいても重なっていても大丈夫です。その場合、次の位置に移動する +ために lseek(2) が使われます。 +出力ファイルがシーク不可なら、「隙間」だけが処理可能です。隙間は null バイト +で埋められます。 +.PP +.I xxd \-r +は不正な入力をエラーにしません。ゴミは静かに読み飛ばされます。 +.PP +16 進ダンプを編集するときは注意が必要です。 +.I xxd \-r +は必要な桁 (\-c 引数参照) だけ 16 進データを読み込んで、行の残りを無視しま +す。つまり、ascii (または ebcdic) を示している列への変更は無視されます。 +xxd \-r \-p でプレーン形式 (ポストスクリプト形式) の 16 進ダンプを元に戻す場 +合は、列の数は影響しません。 +2 桁の 16 進数と認識できるものはすべて変換されます。 +.PP +\fI% xxd \-i file\fR +.br +と +.br +\fI% xxd \-i < file\fR +.br +の結果は違います。注意してください。 +.PP +.I xxd \-s +seek +と +.IR "xxd \-s seek" , +の違いは、lseek(2) を使って入力を "巻き戻す" かどうかです。'+' が意味を持つ +のは、入力が標準入力で、xxd が起動されたときに標準入力のファイル位置がファイ +ルの先頭ではなかった場合です。 +以下の例が分かりやすいかもしれません (もっと混乱するかも!)... +.PP +`cat' が既に標準入力を終わりまで読んでいるので、読む前に標準入力を巻き戻す必 +要がある。 +.br +\fI% sh \-c "cat > plain_copy; xxd \-s 0 > hex_copy" < file\fR +.PP +ファイル位置 0x480 (=1024+128) 前方から 16 進ダンプする。 +`+' は 「現在地からの相対位置」を意味するので、dd が 1k 処理した後から、さら +に `128' 進めます。 +.br +\fI% sh \-c "dd of=plain_snippet bs=1k count=1; xxd \-s +128 > hex_snippet" < file\fR +.PP +ファイル位置 0x100 ( = 1024\-768) から 16 進ダンプする。 +.br +\fI% sh \-c "dd of=plain_snippet bs=1k count=1; xxd \-s +\-768 > hex_snippet" < file\fR +.PP +このような使い方はあまりしませんし、`+' を使うこともほとんどないでしょう。 +\-s を使うときはいつでも、strace(1) や truss(1) を使って、xxd の働きをチェッ +クすることをお勧めします。 +.SH 例 +.PP +.br +.BR ファイル +の最初の三行 (16 進数で 0x30 バイト) 以降を出力する。 +.br +\fI% xxd \-s 0x30 file\fR +.PP +.br +.BR ファイル +の最後から三行 (16 進数で 0x30 バイト) を出力する。 +.br +\fI% xxd \-s \-0x30 file\fR +.PP +.br +120 バイトを、平文 16 進ダンプ形式で一行に 20 オクテットずつ出力する。 +.br +\fI% xxd \-l 120 \-ps \-c 20 xxd.1\fR +.br +2e54482058584420312022417567757374203139 +.br +39362220224d616e75616c207061676520666f72 +.br +20787864220a2e5c220a2e5c222032317374204d +.br +617920313939360a2e5c22204d616e2070616765 +.br +20617574686f723a0a2e5c2220202020546f6e79 +.br +204e7567656e74203c746f6e79407363746e7567 +.br + +.br +この man ページの先頭から 120 バイトを一行に 12 オクテットずつ 16 進ダンプす +る。 +.br +\fI% xxd \-l 120 \-c 12 xxd.1\fR +.br +0000000: 2e54 4820 5858 4420 3120 2241 .TH XXD 1 "A +.br +000000c: 7567 7573 7420 3139 3936 2220 ugust 1996" +.br +0000018: 224d 616e 7561 6c20 7061 6765 "Manual page +.br +0000024: 2066 6f72 2078 7864 220a 2e5c for xxd"..\\ +.br +0000030: 220a 2e5c 2220 3231 7374 204d "..\\" 21st M +.br +000003c: 6179 2031 3939 360a 2e5c 2220 ay 1996..\\" +.br +0000048: 4d61 6e20 7061 6765 2061 7574 Man page aut +.br +0000054: 686f 723a 0a2e 5c22 2020 2020 hor:..\\" +.br +0000060: 546f 6e79 204e 7567 656e 7420 Tony Nugent +.br +000006c: 3c74 6f6e 7940 7363 746e 7567 output_file\fR +.br + +.br +xxd.1 の日付を修正する。 +.br +\fI% echo "0000037: 3574 68" | xxd \-r \- xxd.1\fR +.br +\fI% xxd \-s 0x36 \-l 13 \-c 13 xxd.1\fR +.br +0000036: 3235 7468 204d 6179 2031 3939 36 25th May 1996 +.PP +.br +中身がすべて 0x00 の 65537 バイトのファイルを作成する。 +ただし、最後のバイトだけは 'A' (hex 0x41)。 +.br +\fI% echo "010000: 41" | xxd \-r > file\fR +.PP +.br +作成したファイルをオートスキップを使って 16 進ダンプする。 +.br +\fI% xxd \-a \-c 12 file\fR +.br +0000000: 0000 0000 0000 0000 0000 0000 ............ +.br +* +.br +000fffc: 0000 0000 40 ....A +.PP +一文字の 'A' からなる 1 バイトのファイルを作成する。 + '\-r \-s' の後に指定した数値がファイル中の行番号に加算され、結果、余計なバ +イトが飛ばされる。 +.br +\fI% echo "010000: 41" | xxd \-r \-s \-0x10000 > file\fR +.PP +.B vim(1) +の中から xxd をフィルタとして実行し、 +マークされた `a' から `z' までの領域を 16 進ダンプする。 +.br +\fI:'a,'z!xxd\fR +.PP +.B vim(1) +の中から xxd をフィルタとして実行し、 +マークされた `a' から `z' までの領域をバイナリに戻す。 +.br +\fI:'a,'z!xxd \-r\fR +.PP +.B vim(1) +の中から xxd をフィルタとして実行し、 +16 進ダンプされた行を元に戻す。戻したい行にカーソルを移動して: +.br +\fI!!xxd \-r\fR +.PP +シリアル行から一文字読み込む +.br +\fI% xxd \-c1 < /dev/term/b &\fR +.br +\fI% stty < /dev/term/b \-echo \-opost \-isig \-icanon min 1\fR +.br +\fI% echo \-n foo > /dev/term/b\fR +.PP +.SH 返り値 +以下のエラー値が返ります: +.TP +0 +エラーなし。 +.TP +\-1 +操作がサポートされていない ( +.I xxd \-r \-i +はまだ不可です)。 +.TP +1 +引数の解釈に関するエラー。 +.TP +2 +入力ファイルに関する問題。 +.TP +3 +出力ファイルに関する問題。 +.TP +4,5 +指定された位置へシークできなかった。 +.SH 関連項目 +uuencode(1), uudecode(1), patch(1) +.br +.SH 警告 +この奇妙なツールは作者が使いやすいように作られています。 +自己責任で使ってください。ファイルをコピーし、それを調べ、ウィザードたれ。 +.br +.SH バージョン +このマニュアルは xxd バージョン 1.7 について説明しています。 +.SH 著者 +.br +(c) 1990-1997 by Juergen Weigert +.br + +.LP +私の功績として自由に配布してください。 +.br +儲かったら教えてください。 +.br +損しても知りません。 +.PP +マニュアルは Tony Nugent +.br + +.br +によって書かれ、 +Bram Moolenaar が少し変更を加え、 +Juergen Weigert が編集しました。 +.PP diff --git a/runtime/doc/xxd.1 b/runtime/doc/xxd.1 new file mode 100644 index 0000000..e8f7358 --- /dev/null +++ b/runtime/doc/xxd.1 @@ -0,0 +1,370 @@ +.TH XXD 1 "August 1996" "Manual page for xxd" +.\" +.\" 21st May 1996 +.\" Man page author: +.\" Tony Nugent +.\" Changes by Bram Moolenaar +.SH NAME +.I xxd +\- make a hexdump or do the reverse. +.SH SYNOPSIS +.B xxd +\-h[elp] +.br +.B xxd +[options] [infile [outfile]] +.br +.B xxd +\-r[evert] [options] [infile [outfile]] +.SH DESCRIPTION +.I xxd +creates a hex dump of a given file or standard input. +It can also convert a hex dump back to its original binary form. +Like +.BR uuencode (1) +and +.BR uudecode (1) +it allows the transmission of binary data in a `mail-safe' ASCII representation, +but has the advantage of decoding to standard output. +Moreover, it can be used to perform binary file patching. +.SH OPTIONS +If no +.I infile +is given, standard input is read. +If +.I infile +is specified as a +.RB \` \- ' +character, then input is taken from standard input. +If no +.I outfile +is given (or a +.RB \` \- ' +character is in its place), results are sent to standard output. +.PP +Note that a "lazy" parser is used which does not check for more than the first +option letter, unless the option is followed by a parameter. +Spaces between a single option letter and its parameter are optional. +Parameters to options can be specified in decimal, hexadecimal or octal +notation. +Thus +.BR \-c8 , +.BR "\-c 8" , +.B \-c 010 +and +.B \-cols 8 +are all equivalent. +.PP +.TP +.IR \-a " | " \-autoskip +toggle autoskip: A single '*' replaces nul-lines. Default off. +.TP +.IR \-b " | " \-bits +Switch to bits (binary digits) dump, rather than hexdump. +This option writes octets as eight digits "1"s and "0"s instead of a normal +hexadecimal dump. Each line is preceded by a line number in hexadecimal and +followed by an ascii (or ebcdic) representation. The command line switches +\-r, \-p, \-i do not work with this mode. +.TP +.IR "\-c cols " | " \-cols cols" +format +.RI < cols > +octets per line. Default 16 (\-i: 12, \-ps: 30, \-b: 6). Max 256. +.TP +.IR \-E " | " \-EBCDIC +Change the character encoding in the righthand column from ASCII to EBCDIC. +This does not change the hexadecimal representation. The option is +meaningless in combinations with \-r, \-p or \-i. +.TP +.IR "\-g bytes " | " \-groupsize bytes" +separate the output of every +.RI < bytes > +bytes (two hex characters or eight bit-digits each) by a whitespace. +Specify +.I \-g 0 +to suppress grouping. +.RI < Bytes "> defaults to " 2 +in normal mode and \fI1\fP in bits mode. +Grouping does not apply to postscript or include style. +.TP +.IR \-h " | " \-help +print a summary of available commands and exit. No hex dumping is performed. +.TP +.IR \-i " | " \-include +output in C include file style. A complete static array definition is written +(named after the input file), unless xxd reads from stdin. +.TP +.IR "\-l len " | " \-len len" +stop after writing +.RI < len > +octets. +.TP +.IR \-p " | " \-ps " | " \-postscript " | " \-plain +output in postscript continuous hexdump style. Also known as plain hexdump +style. +.TP +.IR \-r " | " \-revert +reverse operation: convert (or patch) hexdump into binary. +If not writing to stdout, xxd writes into its output file without truncating +it. Use the combination +.I \-r \-p +to read plain hexadecimal dumps without line number information and without a +particular column layout. Additional Whitespace and line-breaks are allowed +anywhere. +.TP +.I \-seek offset +When used after +.IR \-r : +revert with +.RI < offset > +added to file positions found in hexdump. +.TP +.I \-s [+][\-]seek +start at +.RI < seek > +bytes abs. (or rel.) infile offset. +\fI+ \fRindicates that the seek is relative to the current stdin file position +(meaningless when not reading from stdin). \fI\- \fRindicates that the seek +should be that many characters from the end of the input (or if combined with +\fI+\fR: before the current stdin file position). +Without \-s option, xxd starts at the current file position. +.TP +.I \-u +use upper case hex letters. Default is lower case. +.TP +.IR \-v " | " \-version +show version string. +.SH CAVEATS +.PP +.I xxd \-r +has some builtin magic while evaluating line number information. +If the output file is seekable, then the linenumbers at the start of each +hexdump line may be out of order, lines may be missing, or overlapping. In +these cases xxd will lseek(2) to the next position. If the output file is not +seekable, only gaps are allowed, which will be filled by null-bytes. +.PP +.I xxd \-r +never generates parse errors. Garbage is silently skipped. +.PP +When editing hexdumps, please note that +.I xxd \-r +skips everything on the input line after reading enough columns of hexadecimal +data (see option \-c). This also means, that changes to the printable ascii (or +ebcdic) columns are always ignored. Reverting a plain (or postscript) style +hexdump with xxd \-r \-p does not depend on the correct number of columns. Here anything that looks like a pair of hex-digits is interpreted. +.PP +Note the difference between +.br +\fI% xxd \-i file\fR +.br +and +.br +\fI% xxd \-i < file\fR +.PP +.I xxd \-s +seek +may be different from +.IR "xxd \-s seek" , +as lseek(2) is used to "rewind" input. A '+' +makes a difference if the input source is stdin, and if stdin's file position +is not at the start of the file by the time xxd is started and given its input. +The following examples may help to clarify (or further confuse!)... +.PP +Rewind stdin before reading; needed because the `cat' has already read to the +end of stdin. +.br +\fI% sh \-c "cat > plain_copy; xxd \-s 0 > hex_copy" < file\fR +.PP +Hexdump from file position 0x480 (=1024+128) onwards. +The `+' sign means "relative to the current position", thus the `128' adds to +the 1k where dd left off. +.br +\fI% sh \-c "dd of=plain_snippet bs=1k count=1; xxd \-s +128 > hex_snippet" < file\fR +.PP +Hexdump from file position 0x100 ( = 1024\-768) on. +.br +\fI% sh \-c "dd of=plain_snippet bs=1k count=1; xxd \-s +\-768 > hex_snippet" < file\fR +.PP +However, this is a rare situation and the use of `+' is rarely needed. +The author prefers to monitor the effect of xxd with strace(1) or truss(1), whenever \-s is used. +.SH EXAMPLES +.PP +.br +Print everything but the first three lines (hex 0x30 bytes) of +.BR file . +.br +\fI% xxd \-s 0x30 file\fR +.PP +.br +Print 3 lines (hex 0x30 bytes) from the end of +.BR file . +.br +\fI% xxd \-s \-0x30 file\fR +.PP +.br +Print 120 bytes as continuous hexdump with 20 octets per line. +.br +\fI% xxd \-l 120 \-ps \-c 20 xxd.1\fR +.br +2e54482058584420312022417567757374203139 +.br +39362220224d616e75616c207061676520666f72 +.br +20787864220a2e5c220a2e5c222032317374204d +.br +617920313939360a2e5c22204d616e2070616765 +.br +20617574686f723a0a2e5c2220202020546f6e79 +.br +204e7567656e74203c746f6e79407363746e7567 +.br + +.br +Hexdump the first 120 bytes of this man page with 12 octets per line. +.br +\fI% xxd \-l 120 \-c 12 xxd.1\fR +.br +0000000: 2e54 4820 5858 4420 3120 2241 .TH XXD 1 "A +.br +000000c: 7567 7573 7420 3139 3936 2220 ugust 1996" +.br +0000018: 224d 616e 7561 6c20 7061 6765 "Manual page +.br +0000024: 2066 6f72 2078 7864 220a 2e5c for xxd"..\\ +.br +0000030: 220a 2e5c 2220 3231 7374 204d "..\\" 21st M +.br +000003c: 6179 2031 3939 360a 2e5c 2220 ay 1996..\\" +.br +0000048: 4d61 6e20 7061 6765 2061 7574 Man page aut +.br +0000054: 686f 723a 0a2e 5c22 2020 2020 hor:..\\" +.br +0000060: 546f 6e79 204e 7567 656e 7420 Tony Nugent +.br +000006c: 3c74 6f6e 7940 7363 746e 7567 output_file\fR +.br + +.br +Patch the date in the file xxd.1 +.br +\fI% echo "0000037: 3574 68" | xxd \-r \- xxd.1\fR +.br +\fI% xxd \-s 0x36 \-l 13 \-c 13 xxd.1\fR +.br +0000036: 3235 7468 204d 6179 2031 3939 36 25th May 1996 +.PP +.br +Create a 65537 byte file with all bytes 0x00, +except for the last one which is 'A' (hex 0x41). +.br +\fI% echo "010000: 41" | xxd \-r > file\fR +.PP +.br +Hexdump this file with autoskip. +.br +\fI% xxd \-a \-c 12 file\fR +.br +0000000: 0000 0000 0000 0000 0000 0000 ............ +.br +* +.br +000fffc: 0000 0000 40 ....A +.PP +Create a 1 byte file containing a single 'A' character. +The number after '\-r \-s' adds to the linenumbers found in the file; +in effect, the leading bytes are suppressed. +.br +\fI% echo "010000: 41" | xxd \-r \-s \-0x10000 > file\fR +.PP +Use xxd as a filter within an editor such as +.B vim(1) +to hexdump a region marked between `a' and `z'. +.br +\fI:'a,'z!xxd\fR +.PP +Use xxd as a filter within an editor such as +.B vim(1) +to recover a binary hexdump marked between `a' and `z'. +.br +\fI:'a,'z!xxd \-r\fR +.PP +Use xxd as a filter within an editor such as +.B vim(1) +to recover one line of a hexdump. Move the cursor over the line and type: +.br +\fI!!xxd \-r\fR +.PP +Read single characters from a serial line +.br +\fI% xxd \-c1 < /dev/term/b &\fR +.br +\fI% stty < /dev/term/b \-echo \-opost \-isig \-icanon min 1\fR +.br +\fI% echo \-n foo > /dev/term/b\fR +.PP +.SH "RETURN VALUES" +The following error values are returned: +.TP +0 +no errors encountered. +.TP +\-1 +operation not supported ( +.I xxd \-r \-i +still impossible). +.TP +1 +error while parsing options. +.TP +2 +problems with input file. +.TP +3 +problems with output file. +.TP +4,5 +desired seek position is unreachable. +.SH "SEE ALSO" +uuencode(1), uudecode(1), patch(1) +.br +.SH WARNINGS +The tools weirdness matches its creators brain. +Use entirely at your own risk. Copy files. Trace it. Become a wizard. +.br +.SH VERSION +This manual page documents xxd version 1.7 +.SH AUTHOR +.br +(c) 1990-1997 by Juergen Weigert +.br + +.LP +Distribute freely and credit me, +.br +make money and share with me, +.br +lose money and don't ask me. +.PP +Manual page started by Tony Nugent +.br + +.br +Small changes by Bram Moolenaar. +Edited by Juergen Weigert. +.PP