diff --git a/Makefile b/Makefile index 541c38b..d51b5f1 100644 --- a/Makefile +++ b/Makefile @@ -23,7 +23,8 @@ import-en-files: "$(VIM_SRC_DIR)"/runtime/doc/vimtutor.1 \ "$(VIM_SRC_DIR)"/runtime/doc/xxd.1 \ runtime/doc/ - cp "$(VIM_SRC_DIR)"/runtime/tutor/tutor runtime/tutor/ + cp "$(VIM_SRC_DIR)"/runtime/tutor/tutor1 runtime/tutor/ + cp "$(VIM_SRC_DIR)"/runtime/tutor/tutor2 runtime/tutor/ cp "$(VIM_SRC_DIR)"/nsis/lang/english.nsi nsis/lang/ # Update Vim source directory. @@ -69,7 +70,7 @@ install: test cp src/po/ja.sjis.mo $(INSTALL_DIR)/lang/ja.sjis/LC_MESSAGES/vim.mo cp runtime/lang/menu_ja*.vim $(INSTALL_DIR)/lang cp runtime/doc/*.UTF-8.1 $(INSTALL_DIR)/doc - cp runtime/tutor/tutor.ja.* $(INSTALL_DIR)/tutor + cp runtime/tutor/tutor*.ja.* $(INSTALL_DIR)/tutor clean: rm -rf $(ARCHIVE_DIR) $(ARCHIVE_FILE) @@ -102,7 +103,7 @@ $(ARCHIVE_DIR): cp src/po/*.po $@/src/po cp runtime/lang/menu_ja*.vim $@/runtime/lang cp runtime/doc/*.UTF-8.1 $@/runtime/doc - cp runtime/tutor/tutor.ja.* $@/runtime/tutor + cp runtime/tutor/tutor*.ja.* $@/runtime/tutor cp nsis/lang/japanese.nsi $@/nsis/lang $(ARCHIVE).tar.gz: $(ARCHIVE_DIR) diff --git a/runtime/doc/vim-ja.UTF-8.1 b/runtime/doc/vim-ja.UTF-8.1 index 629b4a6..12cc030 100644 --- a/runtime/doc/vim-ja.UTF-8.1 +++ b/runtime/doc/vim-ja.UTF-8.1 @@ -229,16 +229,16 @@ Note: それらのオプションを設定すれば変更できるようにな ":set uc=0" と設定しても同じです。 戻すには ":set uc=200" と設定してください。 .TP -\-nb -NetBeans と接続し、エディタサーバーになります。 -詳しくはヘルプを参照してください。 -.TP \-N 非互換モード。'compatible' オプションがオフになります。 .vimrc ファイルの有無に関わらず、 .B Vim の改良された機能が有効になります。Vi との互換性が少し失われます。 .TP +\-nb +NetBeans と接続し、エディタサーバーになります。 +詳しくはヘルプを参照してください。 +.TP \-o[N] N 個のウィンドウを水平分割で開きます。 N を省略した場合は、引数のファイルを個別のウィンドウで開きます。 @@ -374,7 +374,7 @@ X サーバーと通信しません。端末での起動時間を短くできま \-\-echo\-wid GTK GUI のみ: Window ID を標準出力に出力します。 .TP -\-\-gui-dialog-file {name} +\-\-gui-\dialog\-file {name} GUI の使用時、ダイアログを表示する代わりとして、ファイル {name} へダイアログのタイトルとメッセージを書き込みます。 ファイルは作成されるか追記されます。 テストにみ有用で、見ることができないダイアログによってテストが中断されるのを防ぎます。 @@ -396,12 +396,14 @@ Unix のように、シェルがワイルドカードを展開する場合は機 を呼び出すのと同様な動作です。 .TP \-\-nofork -フォアグラウンド。GUI バージョンで、プロセスをフォークしなくなります。 +フォアグラウンド。GUI バージョンで、 +.B Vim +はプロセスをフォークしなくなり、開始したシェルからデタッチされます。 .TP \-\-noplugin プラグインをロードしません。\-u NONE はこの動作を含んでいます。 .TP -\-\-not-a-term +\-\-not\-a\-term 入力と出力(もしくはどちらか一方)が端末に接続されていないことを、ユーザーが把握しているということを .B Vim に伝えます。 diff --git a/runtime/doc/vimtutor-ja.UTF-8.1 b/runtime/doc/vimtutor-ja.UTF-8.1 index 9b4dd5a..7fbf6b7 100644 --- a/runtime/doc/vimtutor-ja.UTF-8.1 +++ b/runtime/doc/vimtutor-ja.UTF-8.1 @@ -1,48 +1,99 @@ -.TH VIMTUTOR 1 "2024 August 12" +.TH VIMTUTOR 1 "2024 December 03" .SH 名前 vimtutor \- Vim チュートリアル .SH 書式 .br -.B vimtutor [\-g] [language] +.B vimtutor [\-l | \-\-language ISO639] [\-c | \-\-chapter NUMBER] [\-g | \-\-gui] [ISO639] +.br +.B vimtutor [\-h | \-\-help] +.br +.B vimtutor [\-\-list] .SH 説明 .B Vim のチュートリアルを起動します。 -演習ファイルのコピーを使って実施するので、オリジナルの演習ファイルを壊してしまう心配はありません。 .PP .B Vim を初めて学ぶ人向けのチュートリアルです。 +省略可能な [ISO639] 引数は "ja" や "es" のような 2 または 3 文字の言語名です。 .PP -引数に \-g を指定すると GUI 版の Vim が利用可能であれば vim ではなく gvim -を使って vimtutor が開始します。gvim が見つからないときは vim が使用されます。 -.PP -[language] 引数は "ja" や "es" などの二文字の言語名です。 -[language] 引数を省略した場合はロケールの言語が使われます。 -翻訳された演習ファイルがある場合は、そのファイルが使われます。 -ない場合は英語のファイルが使われます。 +.B vimtutor +は演習ファイルの一時的なコピーを開くので、オリジナルの演習ファイルを上書きしてしまう心配はありません。 .PP .B Vim -は Vi 互換モードで起動されます。 +は常に +.B Vi +互換モードで起動されます。 +.SH オプション +.TP +.BR \-l ", " \-\-language\ \fIISO639\fR +2 または 3 文字の言語コードを設定します。 +例: 'ja', 'es', 'bar' +ロケールの言語が使用可能であればそれが使われ、なければ英語がデフォルトとして使われます。 +.TP +.BR \-c ", " \-\-chapter\ \fINUMBER\fR +章番号を設定します。 +デフォルトは第 1 章です。 +.TP +.BR \-g ", " \-\-gui +使用可能であれば +.B vimtutor +を GUI 版の vim を使って開始します。そうでなければコンソール版の vim を使用します。 +.TP +.BR \-h ", " \-\-help +使い方を表示します。 +.TP +.BR \-\-list +章と言語の一覧を表示します。 +.SH 例 +.B vimtutor +をドイツ語の第 1 章で開始するには: +.PP +.nf +.RS +vimtutor de +.RE +.fi +.PP +英語の第 2 章の場合は: +.PP +.nf +.RS +vimtutor -c2 +.RE +.fi +.PP +GUI でバイエルン語の第 1 章を開始する際の長い形式のコマンドは: +.PP +.nf +.RS +vimtutor --language bar --chapter 1 --gui +.RE +.fi .SH ファイル .TP 15 -/usr/local/share/vim/vim??/tutor/tutor[.language] +/usr/local/share/vim/vim??/tutor/tutor1[.language] .B Vimtutor -の演習ファイル。 -.I vim?? -は短いバージョン番号で -.B Vim 9.1 -では vim91 です。 +の第 1 章の演習ファイル。 +.TP 15 +/usr/local/share/vim/vim??/tutor/tutor2[.language] +.B Vimtutor +の第 2 章の演習ファイル。 .TP 15 /usr/local/share/vim/vim??/tutor/tutor.vim -演習ファイルをコピーするための Vim スクリプト。 -.SH 著者 .B Vimtutor -は、Colorado State University の Charles Smith のアイデアを基に、 +の演習ファイルをコピーするための +.B Vim +スクリプト。 +.SH 著者 +.B The Vi Tutorial +は、元々 Colorado State University の Charles Smith のアイデアを基に、 Colorado School of Mines の Michael C. Pierce と Robert K. Ware -の両名によって Vi 向けに作成されたものを基にしています。 -E-mail: bware@mines.colorado.edu (現在は無効). -.br +の両名によって Vi 向けに作成されました。 +.B E-mail: bware@mines.colorado.edu (現在は無効). +.PP .B Vim に合わせて Bram Moolenaar が変更を加えました。 +.PP 翻訳者の名前は演習ファイルを参照してください。 .SH 関連項目 vim(1) diff --git a/runtime/doc/vimtutor.1 b/runtime/doc/vimtutor.1 index a71bc02..0320b24 100644 --- a/runtime/doc/vimtutor.1 +++ b/runtime/doc/vimtutor.1 @@ -1,61 +1,108 @@ -.TH VIMTUTOR 1 "2024 August 12" +.TH VIMTUTOR 1 "2024 December 03" .SH NAME vimtutor \- the Vim tutor .SH SYNOPSIS .br -.B vimtutor [\-g] [language] +.B vimtutor [\-l | \-\-language ISO639] [\-c | \-\-chapter NUMBER] [\-g | \-\-gui] [ISO639] +.br +.B vimtutor [\-h | \-\-help] +.br +.B vimtutor [\-\-list] .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. +The optional [ISO639] argument is the two or three letter name of a language, +like "it" or "es". .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. +.B Vimtutor +only opens temporary copies of the original tutor files, there is no danger +of overwriting the lessons. .PP .B Vim -is always started in Vi compatible mode. +is always started in +.B Vi +compatible mode. +.SH OPTIONS +.TP +.BR \-l ", " \-\-language\ \fIISO639\fR +Set the two or three letter language code. E.g. 'it', 'es', 'bar'. +Defaults to language of locale if available, else to English. +.TP +.BR \-c ", " \-\-chapter\ \fINUMBER\fR +Set the chapter number. Defaults to chapter one. +.TP +.BR \-g ", " \-\-gui +Start +.B vimtutor +in the GUI version of vim if available, otherwise fallback to console vim. +.TP +.BR \-h ", " \-\-help +Display usage information. +.TP +.BR \-\-list +Display chapters and languages. +.SH EXAMPLES +To start +.B vimtutor +in German on chapter one: +.PP +.nf +.RS +vimtutor de +.RE +.fi +.PP +In English on chapter two: +.PP +.nf +.RS +vimtutor -c2 +.RE +.fi +.PP +Longform command for Bavarian in the GUI on chapter one: +.PP +.nf +.RS +vimtutor --language bar --chapter 1 --gui +.RE +.fi .SH FILES .TP 15 -/usr/local/share/vim/vim??/tutor/tutor[.language] +/usr/local/share/vim/vim??/tutor/tutor1[.language] The .B Vimtutor -text file(s). -.br -.I vim?? -is short version number, like vim91 for -.B Vim 9.1 +chapter one text file(s). +.TP 15 +/usr/local/share/vim/vim??/tutor/tutor2[.language] +The +.B Vimtutor +chapter two text file(s). .TP 15 /usr/local/share/vim/vim??/tutor/tutor.vim -The Vim script used to copy the +The +.B 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 (now invalid). -.br -It was modified for +.B The Vi Tutorial +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. +.B E-mail: bware@mines.colorado.edu (now invalid). +.PP +Modified for .B Vim by Bram Moolenaar. -For the names of the translators see the tutor files. +.PP +Translation contributors are listed in 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 index 2957a51..f05f7d7 100644 --- a/runtime/doc/xxd-ja.UTF-8.1 +++ b/runtime/doc/xxd-ja.UTF-8.1 @@ -58,7 +58,8 @@ 1 オクテットが "1" と "0" の 8 文字で出力されます。 各行の行頭には 16 進数の行番号が表示されます。 行末には ASCII (または EBCDIC) で表した場合の文字が表示されます。 -このモードでは \-p、\-i は機能しません。 +このモードでは \-p は機能しません。 +\-i と組み合わせることができます。 .TP .IR \-e リトルエンディアンの 16 進ダンプに切り替える。 @@ -106,6 +107,7 @@ C インクルードファイル形式で出力する。 入力ファイルの名前が付けられた静的配列の定義が出力されます。 標準入力の場合は定義の中身だけ出力されます。 +\-b と組み合わせることができます。 .TP .IR "\-l len " | " \-len len" .RI < len > diff --git a/runtime/doc/xxd.1 b/runtime/doc/xxd.1 index 2c00d53..2c6d5ad 100644 --- a/runtime/doc/xxd.1 +++ b/runtime/doc/xxd.1 @@ -63,8 +63,8 @@ Toggle autoskip: A single '*' replaces NUL-lines. Default off. Switch to bits (binary digits) dump, rather than hex dump. 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 -\-p, \-i do not work with this mode. +followed by an ASCII (or EBCDIC) representation. The command line switch +\-p does not work with this mode. Can be combined with \-i. .TP .IR "\-c cols " | " \-cols cols" Format @@ -109,7 +109,8 @@ 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. +(named after the input file), unless xxd reads from stdin. Can be combined +with \-b. .TP .IR "\-l len " | " \-len len" Stop after writing diff --git a/runtime/tutor/.gitignore b/runtime/tutor/.gitignore index d254640..e390432 100644 --- a/runtime/tutor/.gitignore +++ b/runtime/tutor/.gitignore @@ -1,2 +1,2 @@ -/tutor.ja.sjis -/tutor.ja.euc +/tutor?.ja.sjis +/tutor?.ja.euc diff --git a/runtime/tutor/Makefile b/runtime/tutor/Makefile index d0ddca7..8976f4f 100644 --- a/runtime/tutor/Makefile +++ b/runtime/tutor/Makefile @@ -1,20 +1,32 @@ -MASTER_TUTOR = tutor.ja.utf-8 +MASTER_TUTOR1 = tutor1.ja.utf-8 +MASTER_TUTOR2 = tutor2.ja.utf-8 +MASTER_ALL = $(MASTER_TUTOR1) $(MASTER_TUTOR2) test: update -update: tutor.ja.sjis tutor.ja.euc +update: tutor1.ja.sjis tutor1.ja.euc \ + tutor2.ja.sjis tutor2.ja.euc -tutor.ja.sjis: $(MASTER_TUTOR) +# tutor1 +tutor1.ja.sjis: $(MASTER_TUTOR1) iconv -f utf-8 -t cp932 < $< > $@ -tutor.ja.euc: $(MASTER_TUTOR) +tutor1.ja.euc: $(MASTER_TUTOR1) + iconv -f utf-8 -t euc-jp < $< > $@ + +# tutor2 +tutor2.ja.sjis: $(MASTER_TUTOR2) + iconv -f utf-8 -t cp932 < $< > $@ + +tutor2.ja.euc: $(MASTER_TUTOR2) iconv -f utf-8 -t euc-jp < $< > $@ force: touch @$(MAKE) update -touch: $(MASTER_TUTOR) - touch $< +touch: $(MASTER_ALL) + touch $(MASTER_ALL) clean: - rm -f tutor.ja.sjis tutor.ja.euc + rm -f tutor1.ja.sjis tutor1.ja.euc + rm -f tutor2.ja.sjis tutor2.ja.euc diff --git a/runtime/tutor/tutor b/runtime/tutor/tutor1 similarity index 92% rename from runtime/tutor/tutor rename to runtime/tutor/tutor1 index 3df15f1..04b490f 100644 --- a/runtime/tutor/tutor +++ b/runtime/tutor/tutor1 @@ -1,12 +1,13 @@ =============================================================================== = W e l c o m e t o t h e V I M T u t o r - Version 1.7 = +=============================================================================== += C H A P T E R ONE = =============================================================================== Vim is a very powerful editor that has many commands, too many to explain in a tutor such as this. This tutor is designed to describe enough of the commands that you will be able to easily use Vim as an all-purpose editor. - The approximate time required to complete the tutor is 30 minutes, depending upon how much time is spent with experimentation. @@ -17,12 +18,11 @@ It is important to remember that this tutor is set up to teach by use. That means that you need to execute the commands to learn them properly. If you only read the text, you will forget the commands! - Now, make sure that your Caps-Lock key is NOT depressed and press - the j key enough times to move the cursor so that lesson 1.1 + the j key enough times to move the cursor so that lesson 1.1.1 completely fills the screen. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.1: MOVING THE CURSOR + Lesson 1.1.1: MOVING THE CURSOR ** To move the cursor, press the h,j,k,l keys as indicated. ** @@ -36,7 +36,7 @@ 2. Hold down the down key (j) until it repeats. Now you know how to move to the next lesson. - 3. Using the down key, move to lesson 1.2. + 3. Using the down key, move to lesson 1.1.2. NOTE: If you are ever unsure about something you typed, press to place you in Normal mode. Then retype the command you wanted. @@ -45,7 +45,7 @@ NOTE: The cursor keys should also work. But using hjkl you will be able to move around much faster, once you get used to it. Really! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.2: EXITING VIM + Lesson 1.1.2: EXITING VIM !! NOTE: Before executing any of the steps below, read this entire lesson!! @@ -64,11 +64,11 @@ NOTE: The cursor keys should also work. But using hjkl you will be able to NOTE: :q! discards any changes you made. In a few lessons you will learn how to save the changes to a file. - 5. Move the cursor down to lesson 1.3. + 5. Move the cursor down to lesson 1.1.3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.3: TEXT EDITING - DELETION + Lesson 1.1.3: TEXT EDITING - DELETION ** Press x to delete the character under the cursor. ** @@ -84,14 +84,14 @@ NOTE: :q! discards any changes you made. In a few lessons you ---> The ccow jumpedd ovverr thhe mooon. - 5. Now that the line is correct, go on to lesson 1.4. + 5. Now that the line is correct, go on to lesson 1.1.4. NOTE: As you go through this tutor, do not try to memorize, learn by usage. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.4: TEXT EDITING - INSERTION + Lesson 1.1.4: TEXT EDITING - INSERTION ** Press i to insert text. ** @@ -109,12 +109,12 @@ NOTE: As you go through this tutor, do not try to memorize, learn by usage. ---> There is text misng this . ---> There is some text missing from this line. - 5. When you are comfortable inserting text move to lesson 1.5. + 5. When you are comfortable inserting text move to lesson 1.1.5. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.5: TEXT EDITING - APPENDING + Lesson 1.1.5: TEXT EDITING - APPENDING ** Press A to append text. ** @@ -134,17 +134,17 @@ NOTE: As you go through this tutor, do not try to memorize, learn by usage. ---> There is also some text miss There is also some text missing here. - 5. When you are comfortable appending text move to lesson 1.6. + 5. When you are comfortable appending text move to lesson 1.1.6. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.6: EDITING A FILE + Lesson 1.1.6: EDITING A FILE ** Use :wq to save a file and exit. ** !! NOTE: Before executing any of the steps below, read this entire lesson!! 1. If you have access to another terminal, do the following there. - Otherwise, exit this tutor as you did in lesson 1.2: :q! + Otherwise, exit this tutor as you did in lesson 1.1.2: :q! 2. At the shell prompt type this command: vim file.txt 'vim' is the command to start the Vim editor, 'file.txt' is the name of @@ -160,7 +160,7 @@ NOTE: As you go through this tutor, do not try to memorize, learn by usage. 6. After reading the above steps and understanding them: do it. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1 SUMMARY + Lesson 1.1 SUMMARY 1. The cursor is moved using either the arrow keys or the hjkl keys. @@ -180,10 +180,10 @@ NOTE: As you go through this tutor, do not try to memorize, learn by usage. NOTE: Pressing will place you in Normal mode or will cancel an unwanted and partially completed command. -Now continue with lesson 2. +Now continue with lesson 1.2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 2.1: DELETION COMMANDS + Lesson 1.2.1: DELETION COMMANDS ** Type dw to delete a word. ** @@ -202,11 +202,11 @@ Now continue with lesson 2. ---> There are a some words fun that don't belong paper in this sentence. - 5. Repeat steps 3 and 4 until the sentence is correct and go to lesson 2.2. + 5. Repeat steps 3 and 4 until the sentence is correct and go to lesson 1.2.2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 2.2: MORE DELETION COMMANDS + Lesson 1.2.2: MORE DELETION COMMANDS ** Type d$ to delete to the end of the line. ** @@ -222,14 +222,14 @@ Now continue with lesson 2. ---> Somebody typed the end of this line twice. end of this line twice. - 5. Move on to lesson 2.3 to understand what is happening. + 5. Move on to lesson 1.2.3 to understand what is happening. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 2.3: ON OPERATORS AND MOTIONS + Lesson 1.2.3: ON OPERATORS AND MOTIONS Many commands that change text are made from an operator and a motion. @@ -252,7 +252,7 @@ NOTE: Pressing just the motion while in Normal mode without an operator will move the cursor as specified. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 2.4: USING A COUNT FOR A MOTION + Lesson 1.2.4: USING A COUNT FOR A MOTION ** Typing a number before a motion repeats it that many times. ** @@ -269,13 +269,13 @@ NOTE: Pressing just the motion while in Normal mode without an operator will ---> This is just a line with words you can move around in. - 6. Move on to lesson 2.5. + 6. Move on to lesson 1.2.5. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 2.5: USING A COUNT TO DELETE MORE + Lesson 1.2.5: USING A COUNT TO DELETE MORE ** Typing a number with an operator repeats it that many times. ** @@ -298,7 +298,7 @@ NOTE: Pressing just the motion while in Normal mode without an operator will ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 2.6: OPERATING ON LINES + Lesson 1.2.6: OPERATING ON LINES ** Type dd to delete a whole line. ** @@ -320,9 +320,8 @@ NOTE: Pressing just the motion while in Normal mode without an operator will ---> 7) And so are you. Doubling to operate on a line also works for operators mentioned below. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 2.7: THE UNDO COMMAND + Lesson 1.2.7: THE UNDO COMMAND ** Press u to undo the last commands, U to fix a whole line. ** @@ -339,13 +338,13 @@ Doubling to operate on a line also works for operators mentioned below. ---> Fiix the errors oon thhis line and reeplace them witth undo. - 8. These are very useful commands. Now move on to the lesson 2 Summary. + 8. These are very useful commands. Now move on to the lesson 1.2 Summary. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 2 SUMMARY + Lesson 1.2 SUMMARY 1. To delete from the cursor up to the next word type: dw 2. To delete from the cursor up to the end of the word type: de @@ -368,7 +367,7 @@ Doubling to operate on a line also works for operators mentioned below. To undo the undos, type: CTRL-R ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 3.1: THE PUT COMMAND + Lesson 1.3.1: THE PUT COMMAND ** Type p to put previously deleted text after the cursor. ** @@ -391,7 +390,7 @@ Doubling to operate on a line also works for operators mentioned below. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 3.2: THE REPLACE COMMAND + Lesson 1.3.2: THE REPLACE COMMAND ** Type rx to replace the character at the cursor with x . ** @@ -407,14 +406,14 @@ Doubling to operate on a line also works for operators mentioned below. ---> Whan this lime was tuoed in, someone presswd some wrojg keys! ---> When this line was typed in, someone pressed some wrong keys! - 5. Now move on to lesson 3.3. + 5. Now move on to lesson 1.3.3. NOTE: Remember that you should be learning by doing, not memorization. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 3.3: THE CHANGE OPERATOR + Lesson 1.3.3: THE CHANGE OPERATOR ** To change until the end of a word, type ce . ** @@ -437,7 +436,7 @@ Notice that ce deletes the word and places you in Insert mode. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 3.4: MORE CHANGES USING c + Lesson 1.3.4: MORE CHANGES USING c ** The change operator is used with the same motions as delete. ** @@ -460,7 +459,7 @@ Notice that ce deletes the word and places you in Insert mode. NOTE: You can use the Backspace key to correct mistakes while typing. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 3 SUMMARY + Lesson 1.3 SUMMARY 1. To put back text that has just been deleted, type p . This puts the @@ -483,7 +482,7 @@ Now go on to the next lesson. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 4.1: CURSOR LOCATION AND FILE STATUS + Lesson 1.4.1: CURSOR LOCATION AND FILE STATUS ** Type CTRL-G to show your location in the file and the file status. Type G to move to a line in the file. ** @@ -506,7 +505,7 @@ NOTE: You may see the cursor position in the lower right corner of the screen 4. If you feel confident to do this, execute steps 1 through 3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 4.2: THE SEARCH COMMAND + Lesson 1.4.2: THE SEARCH COMMAND ** Type / followed by a phrase to search for the phrase. ** @@ -529,7 +528,7 @@ NOTE: When the search reaches the end of the file it will continue at the start, unless the 'wrapscan' option has been reset. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 4.3: MATCHING PARENTHESES SEARCH + Lesson 1.4.3: MATCHING PARENTHESES SEARCH ** Type % to find a matching ),], or } . ** @@ -552,7 +551,7 @@ NOTE: This is very useful in debugging a program with unmatched parentheses! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 4.4: THE SUBSTITUTE COMMAND + Lesson 1.4.4: THE SUBSTITUTE COMMAND ** Type :s/old/new/g to substitute 'new' for 'old'. ** @@ -575,7 +574,7 @@ NOTE: This is very useful in debugging a program with unmatched parentheses! with a prompt whether to substitute or not. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 4 SUMMARY + Lesson 1.4 SUMMARY 1. CTRL-G displays your location in the file and the file status. @@ -598,7 +597,7 @@ NOTE: This is very useful in debugging a program with unmatched parentheses! To ask for confirmation each time add 'c' :%s/old/new/gc ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 5.1: HOW TO EXECUTE AN EXTERNAL COMMAND + Lesson 1.5.1: HOW TO EXECUTE AN EXTERNAL COMMAND ** Type :! followed by an external command to execute that command. ** @@ -621,7 +620,7 @@ NOTE: All : commands must be finished by hitting ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 5.2: MORE ON WRITING FILES + Lesson 1.5.2: MORE ON WRITING FILES ** To save the changes made to the text, type :w FILENAME ** @@ -644,7 +643,7 @@ NOTE: If you were to exit Vim and start it again with vim TEST , the file ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 5.3: SELECTING TEXT TO WRITE + Lesson 1.5.3: SELECTING TEXT TO WRITE ** To save part of the file, type v motion :w FILENAME ** @@ -667,14 +666,14 @@ NOTE: Pressing v starts Visual selection. You can move the cursor around to do something with the text. For example, d deletes the text. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 5.4: RETRIEVING AND MERGING FILES + Lesson 1.5.4: RETRIEVING AND MERGING FILES ** To insert the contents of a file, type :r FILENAME ** 1. Place the cursor just above this line. -NOTE: After executing Step 2 you will see text from lesson 5.3. Then move +NOTE: After executing Step 2 you will see text from lesson 1.5.3. Then move DOWN to see this lesson again. 2. Now retrieve your TEST file using the command :r TEST where TEST is @@ -682,7 +681,7 @@ NOTE: After executing Step 2 you will see text from lesson 5.3. Then move The file you retrieve is placed below the cursor line. 3. To verify that a file was retrieved, cursor back and notice that there - are now two copies of lesson 5.3, the original and the file version. + are now two copies of lesson 1.5.3, the original and the file version. NOTE: You can also read the output of an external command. For example, :r !ls reads the output of the ls command and puts it below the @@ -690,7 +689,7 @@ NOTE: You can also read the output of an external command. For example, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 5 SUMMARY + Lesson 1.5 SUMMARY 1. :!command executes an external command. @@ -713,7 +712,7 @@ NOTE: You can also read the output of an external command. For example, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 6.1: THE OPEN COMMAND + Lesson 1.6.1: THE OPEN COMMAND ** Type o to open a line below the cursor and place you in Insert mode. ** @@ -736,7 +735,7 @@ NOTE: You can also read the output of an external command. For example, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 6.2: THE APPEND COMMAND + Lesson 1.6.2: THE APPEND COMMAND ** Type a to insert text AFTER the cursor. ** @@ -759,7 +758,7 @@ NOTE: a, i and A all go to the same Insert mode, the only difference is where the characters are inserted. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 6.3: ANOTHER WAY TO REPLACE + Lesson 1.6.3: ANOTHER WAY TO REPLACE ** Type a capital R to replace more than one character. ** @@ -782,8 +781,7 @@ NOTE: Replace mode is like Insert mode, but every typed character deletes an existing character. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 6.4: COPY AND PASTE TEXT - + Lesson 1.6.4: COPY AND PASTE TEXT ** Use the y operator to copy text and p to paste it ** @@ -806,7 +804,7 @@ NOTE: Replace mode is like Insert mode, but every typed character deletes an NOTE: You can also use y as an operator: yw yanks one word, yy yanks the whole line, then p puts that line. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 6.5: SET OPTION + Lesson 1.6.5: SET OPTION ** Set an option so a search or substitute ignores case ** @@ -829,7 +827,7 @@ NOTE: To remove the highlighting of matches enter: :nohlsearch NOTE: If you want to ignore case for just one search command, use \c in the phrase: /ignore\c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 6 SUMMARY + Lesson 1.6 SUMMARY 1. Type o to open a line BELOW the cursor and start Insert mode. Type O to open a line ABOVE the cursor. @@ -852,7 +850,7 @@ NOTE: If you want to ignore case for just one search command, use \c 7. Prepend "no" to switch an option off: :set noic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 7.1: GETTING HELP + Lesson 1.7.1: GETTING HELP ** Use the on-line help system ** @@ -875,7 +873,7 @@ NOTE: If you want to ignore case for just one search command, use \c :help insert-index :help user-manual ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 7.2: CREATE A STARTUP SCRIPT + Lesson 1.7.2: CREATE A STARTUP SCRIPT ** Enable Vim features ** @@ -898,7 +896,7 @@ NOTE: If you want to ignore case for just one search command, use \c For more information type :help vimrc-intro ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 7.3: COMPLETION + Lesson 1.7.3: COMPLETION ** Command line completion with CTRL-D and ** @@ -921,7 +919,7 @@ NOTE: Completion works for many commands. Just try pressing CTRL-D and . It is especially useful for :help . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 7 SUMMARY + Lesson 1.7 SUMMARY 1. Type :help or press or to open a help window. @@ -945,10 +943,14 @@ NOTE: Completion works for many commands. Just try pressing CTRL-D and ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - This concludes the Vim Tutor. It was intended to give a brief overview of - the Vim editor, just enough to allow you to use the editor fairly easily. - It is far from complete as Vim has many many more commands. Read the user - manual next: ":help user-manual". + This concludes Chapter 1 of the Vim Tutor. Consider continuing with + Chapter 2. + + It was intended to give a brief overview of the Vim editor, just enough to + allow you to use the editor fairly easily. It is far from complete as Vim + has many many more commands. + + Read the user manual next: ":help user-manual". For further reading and studying, this book is recommended: Vim - Vi Improved - by Steve Oualline diff --git a/runtime/tutor/tutor.ja.utf-8 b/runtime/tutor/tutor1.ja.utf-8 similarity index 91% rename from runtime/tutor/tutor.ja.utf-8 rename to runtime/tutor/tutor1.ja.utf-8 index 8eaa72c..171b04b 100644 --- a/runtime/tutor/tutor.ja.utf-8 +++ b/runtime/tutor/tutor1.ja.utf-8 @@ -1,12 +1,13 @@ =============================================================================== = V I M 教 本 (チュートリアル) へ よ う こ そ - Version 1.7 = +=============================================================================== += 第 1 章 = =============================================================================== Vim は、このチュートリアルで説明するには多すぎる程のコマンドを備えた非常 に強力なエディターです。このチュートリアルは、あなたが Vim を万能エディ ターとして使いこなせるようになるのに十分なコマンドについて説明をするよう になっています。 - チュートリアルを完了するのに必要な時間は、覚えたコマンドを試すのにどれだ け時間を使うのかにもよりますが、およそ30分です。 @@ -17,11 +18,11 @@ このチュートリアルが、使うことで覚えられる仕組みになっていることを、心し ておかなければなりません。正しく学習するにはコマンドを実際に試さなければ ならないのです。文章を読んだだけならば、きっと忘れてしまいます! + さぁ、Capsロックキーが押されていないことを確認した後、画面にレッスン + 1.1.1 が全部表示されるところまで、j キーを押してカーソルを移動しましょう。 - さぁ、Capsロックキーが押されていないことを確認した後、画面にレッスン1.1 - が全部表示されるところまで、j キーを押してカーソルを移動しましょう。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - レッスン 1.1: カーソルの移動 + レッスン 1.1.1: カーソルの移動 ** カーソルを移動するには、示される様に h,j,k,l を押します。 ** @@ -35,7 +36,7 @@ 2. 下へのキー(j)を押しつづけると、連続して移動できます。 これで次のレッスンに移動する方法がわかりましたね。 - 3. 下へのキーを使って、レッスン1.2 に移動しましょう。 + 3. 下へのキーを使って、レッスン 1.1.2 に移動しましょう。 NOTE: 何をタイプしているか判らなくなったら、を押してノーマルモードにし ます。それから入力しようとしていたコマンドを再入力しましょう。 @@ -44,7 +45,7 @@ NOTE: カーソルキーでも移動できます。しかし hjkl に一度慣 に速く移動することができるでしょう。いやマジで! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - レッスン 1.2: VIM の起動と終了 + レッスン 1.1.2: VIM の起動と終了 !! NOTE: 以下のあらゆるステップを行う前に、このレッスンを読みましょう!! @@ -63,11 +64,11 @@ NOTE: カーソルキーでも移動できます。しかし hjkl に一度慣 NOTE: :q! は全ての変更を破棄します。レッスンにて変更をファイルに保 存する方法についても勉強していきましょう。 - 5. 1.3までカーソルを移動させましょう。 + 5. レッスン 1.1.3 までカーソルを移動させましょう。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - レッスン 1.3: テキスト編集 - 削除 + レッスン 1.1.3: テキスト編集 - 削除 ** ノーマルモードにてカーソルの下の文字を削除するには x を押します。 ** @@ -82,14 +83,15 @@ NOTE: :q! は全ての変更を破棄します。レッスンにて変 ---> その ううさぎ は つつきき を こええてて とびはねたた - 5. 行が正しくなったら、レッスン 1.4 へ進みましょう。 + 5. 行が正しくなったら、レッスン 1.1.4 へ進みましょう。 NOTE: 全てのレッスンを通じて、覚えようとするのではなく実際にやってみましょう。 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - レッスン 1.4: テキスト編集 - 挿入 + レッスン 1.1.4: テキスト編集 - 挿入 ** ノーマルモードにてテキストを挿入するには i を押します。 ** @@ -107,12 +109,12 @@ NOTE: 全てのレッスンを通じて、覚えようとするのではなく ---> この には 足りない テキスト ある。 ---> この 行 には 幾つか 足りない テキスト が ある。 - 5. 挿入の方法がわかったらレッスン 1.5 へ進みましょう。 + 5. 挿入の方法がわかったらレッスン 1.1.5 へ進みましょう。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - レッスン 1.5: テキスト編集 - 追加 + レッスン 1.1.5: テキスト編集 - 追加 ** テキストを追加するには A を押しましょう。 ** @@ -132,17 +134,17 @@ NOTE: 全てのレッスンを通じて、覚えようとするのではなく ---> ここにも間違ったテキス ここにも間違ったテキストがあります。 - 5. テキストの追加が軽快になってきたらレッスン 1.6 へ進みましょう。 + 5. テキストの追加が軽快になってきたらレッスン 1.1.6 へ進みましょう。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - レッスン 1.6: ファイルの編集 + レッスン 1.1.6: ファイルの編集 ** ファイルを保存して終了するには :wq とタイプします。 ** !! NOTE: 以下のステップを実行する前に、まず全体を読んでください!! 1. 別の端末がある場合はそこで以下の内容を行ってください。そうでなければ、 - レッスン 1.2 でやったように :q! をタイプして、このチュートリアルを終了 + レッスン 1.1.2 でやったように :q! をタイプして、このチュートリアルを終了 します。 2. シェルプロンプトでこのコマンドをタイプします: vim file.txt @@ -157,9 +159,8 @@ NOTE: 全てのレッスンを通じて、覚えようとするのではなく 要約へ進みましょう。 6. 以上のステップを読んで理解した上でこれを実行しましょう。 - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - レッスン 1 要約 + レッスン 1.1 要約 1. カーソルは矢印キーもしくは hjkl キーで移動します。 @@ -179,10 +180,10 @@ NOTE: 全てのレッスンを通じて、覚えようとするのではなく NOTE: キーを押すとノーマルモードに移行します。その際、間違ったり入力途 中のコマンドを取り消すことができます。 -さて、続けてレッスン 2 を始めましょう。 +さて、続けてレッスン 1.2 を始めましょう。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - レッスン 2.1: 削除コマンド + レッスン 1.2.1: 削除コマンド ** 単語の末尾までを削除するには dw とタイプしましょう。 ** @@ -201,11 +202,11 @@ NOTE: キーを押すとノーマルモードに移行します。その ---> この 文 紙 には いくつかの たのしい 必要のない 単語 が 含まれて います。 - 5. 3 から 4 までを文が正しくなるまで繰り返し、レッスン 2.2 へ進みましょう。 + 5. 3 から 4 までを文が正しくなるまで繰り返し、レッスン 1.2.2 へ進みましょう。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - レッスン 2.2: その他の削除コマンド + レッスン 1.2.2: その他の削除コマンド ** 行の末尾までを削除するには d$ とタイプしましょう。 ** @@ -221,14 +222,14 @@ NOTE: キーを押すとノーマルモードに移行します。その ---> 誰かがこの行の最後を2度タイプしました。 2度タイプしました。 - 5. どういうことか理解するために、レッスン 2.3 へ進みましょう。 + 5. どういうことか理解するために、レッスン 1.2.3 へ進みましょう。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - レッスン 2.3: オペレータとモーション + レッスン 1.2.3: オペレータとモーション テキストに変更を加える多くのコマンドはオペレータとモーションからなります。 @@ -251,7 +252,7 @@ NOTE: 冒険したい人は、ノーマルモードにてオペレータなし みましょう。カーソルが目的語一覧で示される位置に移動するはずです。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - レッスン 2.4: モーションにカウントを使用する + レッスン 1.2.4: モーションにカウントを使用する ** 何回も行いたい繰り返しのモーションの前に数値をタイプします。 ** @@ -268,13 +269,13 @@ NOTE: 冒険したい人は、ノーマルモードにてオペレータなし ---> This is just a line with words you can move around in. - 6. レッスン 2.5 に進みましょう。 + 6. レッスン 1.2.5 に進みましょう。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - レッスン 2.5: より多くを削除するためにカウントを使用する + レッスン 1.2.5: より多くを削除するためにカウントを使用する ** オペレータとカウントをタイプすると、その操作が複数回繰り返されます。 ** @@ -297,7 +298,7 @@ NOTE: 冒険したい人は、ノーマルモードにてオペレータなし ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - レッスン 2.6: 行の操作 + レッスン 1.2.6: 行の操作 ** 行全体を削除するには dd とタイプします。 ** @@ -319,9 +320,8 @@ NOTE: 冒険したい人は、ノーマルモードにてオペレータなし ---> 7) オマエモナー 2回タイプで1行に対して作用させる方法は以下で述べるオペレータでも動作します。 - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - レッスン 2.7: やり直しコマンド + レッスン 1.2.7: やり直しコマンド ** 最後のコマンドを取り消すには u を押します。U は行全体の取り消しです。 ** @@ -338,13 +338,13 @@ NOTE: 冒険したい人は、ノーマルモードにてオペレータなし ---> このの行のの間違いを修正々し、後でそれらの修正をを取り消しまますす。 - 8. これはとても便利なコマンドです。さぁレッスン 2 要約へ進みましょう。 + 8. これはとても便利なコマンドです。さぁレッスン 1.2 要約へ進みましょう。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - レッスン 2 要約 + レッスン 1.2 要約 1. カーソル位置から次の単語までを削除するには dw とタイプします。 @@ -366,9 +366,8 @@ NOTE: 冒険したい人は、ノーマルモードにてオペレータなし 8. 前回の動作を取り消す: u (小文字 u) 行全体の変更を取り消す: U (大文字 U) 取り消しの取り消し: CTRL-R - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - レッスン 3.1: 貼り付けコマンド + レッスン 1.3.1: 貼り付けコマンド ** 最後に削除された行をカーソルの後に貼り付けるには p をタイプします。 ** @@ -390,9 +389,8 @@ NOTE: 冒険したい人は、ノーマルモードにてオペレータなし ---> a) バラは赤い、 - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - レッスン 3.2: 置き換えコマンド + レッスン 1.3.2: 置き換えコマンド ** カーソルの下の文字を x に置き換えるには rx をタイプします。 ** @@ -408,14 +406,14 @@ NOTE: 冒険したい人は、ノーマルモードにてオペレータなし ---> この合を人力した時ね、その人は幾つか問違ったキーを押しもした! ---> この行を入力した時に、その人は幾つか間違ったキーを押しました! - 5. さぁ、レッスン 3.3 へ進みましょう。 + 5. さぁ、レッスン 1.3.3 へ進みましょう。 NOTE: 実際に試しましょう。決して覚えるだけにはしないこと。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - レッスン 3.3: 変更コマンド + レッスン 1.3.3: 変更コマンド ** 単語の末尾までを変更するには ce とタイプします。 ** @@ -438,7 +436,7 @@ cc は同じことを行全体に対して行います。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - レッスン 3.4: c を使用したその他の変更 + レッスン 1.3.4: c を使用したその他の変更 ** 変更オペレータは、削除と同じ様にモーションを使用します。 ** @@ -461,7 +459,7 @@ cc は同じことを行全体に対して行います。 NOTE: タイプ中の間違いはバックスペースキーを使って直すこともできます。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - レッスン 3 要約 + レッスン 1.3 要約 1. 既に削除されたテキストを再配置するには、p をタイプします。これは削除さ @@ -484,7 +482,7 @@ NOTE: タイプ中の間違いはバックスペースキーを使って直す ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - レッスン 4.1: 位置とファイルの情報 + レッスン 1.4.1: 位置とファイルの情報 ** ファイル内での位置とファイルの状態を表示するには CTRL-G をタイプします。 ファイル内のある行に移動するには G をタイプします。 ** @@ -507,7 +505,7 @@ NOTE: 画面の右下隅にカーソルの位置が表示されているかも 4. 自信が持てたらステップ 1 から 3 を実行しましょう。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - レッスン 4.2: 検索コマンド + レッスン 1.4.2: 検索コマンド ** 語句を検索するには / と、前方検索する語句をタイプします。 ** @@ -530,7 +528,7 @@ NOTE: 検索がファイルの終わりに達すると、オプション 'wrapsc 場合は、ファイルの先頭から検索を続行します。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - レッスン 4.3: 対応する括弧を検索 + レッスン 1.4.3: 対応する括弧を検索 ** 対応する ),] や } を検索するには % をタイプします。 ** @@ -553,7 +551,7 @@ NOTE: この機能は括弧が一致していないプログラムをデバッ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - レッスン 4.4: 間違いを変更する方法 + レッスン 1.4.4: 間違いを変更する方法 ** 'old' を 'new' に置換するには :s/old/new/g とタイプします。 ** @@ -576,7 +574,7 @@ NOTE: この機能は括弧が一致していないプログラムをデバッ がら変更する。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - レッスン 4 要約 + レッスン 1.4 要約 1. CTRL-G はファイルでの位置とファイルの詳細を表示します。 @@ -599,7 +597,7 @@ NOTE: この機能は括弧が一致していないプログラムをデバッ 'c' を加えると置換の度に確認を求める。 :%s/old/new/gc ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - レッスン 5.1: 外部コマンドを実行する方法 + レッスン 1.5.1: 外部コマンドを実行する方法 ** :! の後に実行する外部コマンドをタイプします。 ** @@ -622,7 +620,7 @@ NOTE: 全ての : コマンドは を押して終了しなければな ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - レッスン 5.2: その他のファイルへ書き込み + レッスン 1.5.2: その他のファイルへ書き込み ** ファイルへ変更を保存するには :w ファイル名 とタイプします。 ** @@ -645,7 +643,7 @@ NOTE: ここで Vim を終了し、ファイル名 TEST と共に起動すると ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - レッスン 5.3: 選択した書き込み + レッスン 1.5.3: 選択した書き込み ** ファイルの一部を保存するには、v モーションと :w FILENAME をタイプします。 ** @@ -667,31 +665,31 @@ NOTE: ここで Vim を終了し、ファイル名 TEST と共に起動すると NOTE: v を押すと、Visual 選択が始まります。カーソルを動かすことで、選択範囲を 大きくも小さくもできます。さらに、その選択範囲に対してオペレータを適用 できます。例えば d はテキストを削除します。 - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - レッスン 5.4: ファイルの取込と合併 + レッスン 1.5.4: ファイルの取込と合併 ** ファイルの中身を挿入するには :r ファイル名 とタイプします。 ** 1. カーソルをこの行のすぐ上に合わせます。 -NOTE: ステップ 2 の実行後、レッスン 5.3 のテキストが現れます。下に下がってこ - のレッスンに移動しましょう。 +NOTE: ステップ 2 の実行後、レッスン 1.5.3 のテキストが現れます。下に下がって + このレッスンに移動しましょう。 2. では TEST というファイルを :r TEST というコマンドで読み込みましょう。 ここでいう TEST は使うファイルの名前のことです。 読み込まれたファイルは、カーソル行の下にあります。 - 3. 取り込んだファイルを確認してみましょう。カーソルを戻すと、レッスン5.3 の - オリジナルとファイルによるものの2つがあることがわかります。 + 3. 取り込んだファイルを確認してみましょう。カーソルを戻すと、レッスン 1.5.3 + のオリジナルとファイルによるものの2つがあることがわかります。 NOTE: 外部コマンドの出力を読み込むこともできます。例えば、 :r !ls は ls コマンドの出力をカーソル以下に読み込みます。 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - レッスン 5 要約 + レッスン 1.5 要約 1. :!command によって 外部コマンドを実行する。 @@ -714,7 +712,7 @@ NOTE: 外部コマンドの出力を読み込むこともできます。例え ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - レッスン 6.1: オープンコマンド + レッスン 1.6.1: オープンコマンド ** o をタイプすると、カーソルの下の行が開き、挿入モードに入ります。 ** @@ -737,7 +735,7 @@ NOTE: 外部コマンドの出力を読み込むこともできます。例え ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - レッスン 6.2: 追加コマンド + レッスン 1.6.2: 追加コマンド ** カーソルの次の位置からテキストを追加するには a とタイプします。 ** @@ -760,7 +758,7 @@ NOTE: a, i と A は同じ挿入モードへ移りますが、文字が挿入さ ます。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - レッスン 6.3: その他の置換方法 + レッスン 1.6.3: その他の置換方法 ** 1文字以上を置き換えるには大文字の R とタイプしましょう。 ** @@ -781,9 +779,9 @@ NOTE: a, i と A は同じ挿入モードへ移りますが、文字が挿入さ NOTE: 置換モードは挿入モードに似ていますが、全てのタイプされた文字は既存の文字 を削除します。 -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - レッスン 6.4: テキストのコピーとペースト +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + レッスン 1.6.4: テキストのコピーとペースト ** テキストのコピーにはオペレータ y を、ペーストには p を使います。 ** @@ -806,7 +804,7 @@ NOTE: 置換モードは挿入モードに似ていますが、全てのタイ NOTE: y をオペレータとして使うこともできます。yw は単語を1つ yank します。 yy は行を1つ yank し、p でその行を put します。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - レッスン 6.5: オプションの設定 + レッスン 1.6.5: オプションの設定 ** 検索や置換の際に大文字/小文字を無視するには、オプションを設定します。 ** @@ -829,7 +827,7 @@ NOTE: マッチの強調表示をやめるには次の様に入力します: :n NOTE: 1つの検索コマンドだけ大文字小文字の区別をやめたいならば、語句内で \c を使用します: /ignore\c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - レッスン 6 要約 + レッスン 1.6 要約 1. o をタイプするとカーソルの下の行を開けて、そこで挿入モードになる。 O (大文字) をタイプするとカーソルの上の行で挿入モードになる。 @@ -852,7 +850,7 @@ NOTE: 1つの検索コマンドだけ大文字小文字の区別をやめたい 7. オプションを無効にするには "no" を付与する: :set noic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - レッスン 7.1: オンラインヘルプコマンド + レッスン 1.7.1: オンラインヘルプコマンド ** オンラインヘルプを使用しましょう ** @@ -875,7 +873,7 @@ NOTE: 1つの検索コマンドだけ大文字小文字の区別をやめたい :help insert-index :help user-manual ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - レッスン 7.2: 起動スクリプトの作成 + レッスン 1.7.2: 起動スクリプトの作成 ** Vim の特徴を発揮する ** @@ -898,7 +896,7 @@ NOTE: 1つの検索コマンドだけ大文字小文字の区別をやめたい より多くの情報を得るには :help vimrc-intro とタイプします。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - レッスン 7.3: 補完 + レッスン 1.7.3: 補完 ** CTRL-D と でコマンドラインを補完する ** @@ -921,7 +919,7 @@ NOTE: 補完は多くのコマンドで動作します。そして CTRL-D と もしくは を押す。 @@ -945,9 +943,13 @@ NOTE: 補完は多くのコマンドで動作します。そして CTRL-D と and try again. + + The approximate time required to complete this chapter is 8-10 minutes, + depending upon how much time is spent with experimentation. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Lesson 2.1.1: THE NAMED REGISTERS + + + ** Store two yanked words concurrently and then paste them ** + + 1. Move the cursor to the line below marked ---> + + 2. Navigate to any point on the word 'Edward' and type "ayiw + +MNEMONIC: into register(") named (a) (y)ank (i)nner (w)ord + + 3. Navigate forward to the word 'cookie' (fk or 2fc or $2b or /co) + and type "byiw + + 4. Navigate to any point on the word 'Vince' and type ciwa + +MNEMONIC: (c)hange (i)nner (w)ord with named (a) + + 5. Navigate to any point on the word 'cake' and type ciwb + +---> a) Edward will henceforth be in charge of the cookie rations + b) In this capacity, Vince will have sole cake discretionary powers + +NOTE: Delete also works into registers, i.e. "sdiw will delete the word under + the cursor into register s. + +REFERENCE: Registers :h registers + Named Registers :h quotea + Motion :h motion.txt /inner + CTRL-R :h insert /CTRL-R + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + Lesson 2.1.2: THE EXPRESSION REGISTER + + + ** Insert the results of calculations on the fly ** + + 1. Move the cursor to the line below marked ---> + + 2. Navigate to any point on the supplied number + + 3. Type ciw=60*60*24 + + 4. On the next line, enter insert mode and add today's date with + =system('date') + +NOTE: All calls to system are OS dependent, e.g. on Windows use + system('date /t') or :r!date /t + +---> I have forgotten the exact number of seconds in a day, is it 84600? + Today's date is: + +NOTE: the same can be achieved with :pu=system('date') + or, with fewer keystrokes :r!date + +REFERENCE: Expression Register :h quote= + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + Lesson 2.1.3: THE NUMBERED REGISTERS + + + ** Press yy and dd to witness their effect on the registers ** + + 1. Move the cursor to the line below marked ---> + + 2. yank the zeroth line, then inspect registers with :reg + + 3. delete line 0. with "cdd, then inspect registers + (Where do you expect line 0 to be?) + + 4. continue deleting each successive line, inspecting :reg as you go + +NOTE: You should notice that old full-line deletions move down the list + as new full-line deletions are added + + 5. Now (p)aste the following registers in order; c, 7, 4, 8, 2. i.e. "7p + +---> 0. This + 9. wobble + 8. secret + 7. is + 6. on + 5. axis + 4. a + 3. war + 2. message + 1. tribute + +NOTE: Whole line deletions (dd) are much longer lived in the numbered registers + than whole line yanks, or deletions involving smaller movements + +REFERENCE: Numbered Registers :h quote0 + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + Lesson 2.1.4: THE BEAUTY OF MARKS + + + ** Code monkey arithmetic avoidance ** + +NOTE: a common conundrum when coding is moving around large chunks of code. + The following technique helps avoid number line calculations associated + with operations like "a147d or :945,1091d a or even worse using + i=1091-945 first + + 1. Move the cursor to the line below marked ---> + + 2. Go to the first line of the function and mark it with ma + +NOTE: exact position on line is NOT important! + + 3. Navigate to the end of the line and then the end of the code block + with $% + + 4. Delete the block into register a with "ad'a + +MNEMONIC: into register(") named (a) put the (d)eletion from the cursor to the + LINE containing mark(') (a) + + 5. Paste the block between BBB and CCC "ap + +NOTE: practice this operation multiple times to become fluent ma$%"ad'a + +---> AAA + function itGotRealBigRealFast() { + if ( somethingIsTrue ) { + doIt() + } + // the taxonomy of our function has changed and it + // no longer makes alphabetical sense in its current position + + // imagine hundreds of lines of code + + // naively you could navigate to the start and end and record or + // remember each line number + } + BBB + CCC + +NOTE: marks and registers do not share a namespace, therefore register a is + completely independent of mark a. This is not true of registers and + macros. + +REFERENCE: Marks :h marks + Mark Motions :h mark-motions (difference between ' and `) + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + Lesson 2.1 SUMMARY + + + 1. To store (yank, delete) text into, and retrieve (paste) from, a total of + 26 registers (a-z) + 2. Yank a whole word from anywhere within a word: yiw + 3. Change a whole word from anywhere within a word: ciw + 4. Insert text directly from registers in insert mode: (C-r)a + + 5. Insert the results of simple arithmetic operations: (C-r)=60*60 + in insert mode + 6. Insert the results of system calls: (C-r)=system('ls -1') + in insert mode + + 7. Inspect registers with :reg + 8. Learn the final destination of whole line deletions: dd in the numbered + registers, i.e. descending from register 1 - 9. Appreciate that whole + line deletions are preserved in the numbered registers longer than any + other operation + 9. Learn the final destination of all yanks in the numbered registers and + how ephemeral they are + + 10. Place marks from command mode m[a-zA-Z0-9] + 11. Move line-wise to a mark with ' + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + This concludes chapter two of the Vim Tutor. It is a work in progress. + + This chapter was written by Paul D. Parker. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/runtime/tutor/tutor2.ja.utf-8 b/runtime/tutor/tutor2.ja.utf-8 new file mode 100644 index 0000000..04635f1 --- /dev/null +++ b/runtime/tutor/tutor2.ja.utf-8 @@ -0,0 +1,198 @@ +=============================================================================== += V I M 教 本 (チュートリアル) へ よ う こ そ - Version 1.7 = +=============================================================================== += 第 2 章 = +=============================================================================== + + Hic Sunt Dracones (危険な領域): もしこれがあなたにとって vim に初めて + 触れる機会であり、入門の章を利用したいのであれば、どうか :q を + タイプして再挑戦してください。 + + この章を完了するのに必要な時間は、覚えたコマンドを試すのにどれだけ時間を + 使うのかにもよりますが、およそ 8-10 分です。 + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Lesson 2.1.1: 名前付きレジスタ + + + ** ヤンク(コピー)した 2 つの単語を同時に保存し、それらをペーストします ** + + 1. 以下の ---> と示された行にカーソルを移動しましょう。 + + 2. 単語 'Edward' 内のどこかに移動し "ayiw とタイプしましょう。 + +覚え方: into register(") named (a) (y)ank (i)nner (w)ord + {訳: レジスタ(")へ (a)という名前の (y)ヤンク (i)内部 (w)単語} + + 3. 単語 'cookie' に進んで (fk や 2fc や $2b や /co)、 "byiw + とタイプしましょう。 + + 4. 単語 'Vince' 内のどこかに移動し ciwa とタイプしましょう。 + +覚え方: (c)hange (i)nner (w)ord with named (a) + {訳: (c)変更する (i)内部 (w)単語 <(r)レジスタの内容>で (a)という名前の} + + 5. 単語 'cake' 内のどこかに移動し ciwb とタイプしましょう。 + +---> a) Edward will henceforth be in charge of the cookie rations + b) In this capacity, Vince will have sole cake discretionary powers + +NOTE: レジスタへの削除も動作します。すなわち "sdiw はカーソル位置の単語を削除 + し、レジスタ s に格納します。 + +REFERENCE: レジスタ :h registers + 名前付きレジスタ :h quotea + カーソル移動 :h motion.txt /inner + CTRL-R :h insert /CTRL-R + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + Lesson 2.1.2: EXPRESSION レジスタ + + + ** 計算の結果をその場で挿入します ** + + 1. 以下の ---> と示された行にカーソルを移動しましょう。 + + 2. 行内の数字のどこかにカーソルを移動しましょう。 + + 3. 次のようにタイプしましょう。 ciw=60*60*24 + + 4. 次の行で挿入モードに入り、次の操作で今日の日付を挿入しましょう。 + =system('date') + +NOTE: すべてのシステムへの呼び出しは OS 依存です。例えば Windows では + system('date /t') または :r!date /t を使います。 + +---> 1 日の正確な秒数を忘れてしまいました。 84600 でしょうか? + 今日の日付は: + +NOTE: 同じことは :pu=system('date') あるいは、より少ないキーストロークで + :r!date でも達成できます。 + +REFERENCE: Expression レジスタ :h quote= + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + Lesson 2.1.3: 番号付きレジスタ + + + ** yy と dd を押してレジスタに対する効果を目撃します ** + + 1. 以下の ---> と示された行にカーソルを移動しましょう。 + + 2. 0 番目の行をヤンクし、それから :reg でレジスタを検査しましょう。 + + 3. "cdd で行 0 を削除し、それからレジスタを検査しましょう。 + (行 0 はどこにあると思いますか?) + + 4. 残りの行もそれぞれ続けて削除して、都度 :reg で検査しましょう。 + +NOTE: 新しい行全体削除が追加されると、古い行全体削除はリストの下に移動すること + に気づいたでしょう。 + + 5. 次に以下のレジスタを順にペースト(p)しましょう: c, 7, 4, 8, 2。例 "7p + +---> 0. This + 9. wobble + 8. secret + 7. is + 6. on + 5. axis + 4. a + 3. war + 2. message + 1. tribute + +NOTE: 行全体削除(dd)は、行全体ヤンクや小さな移動による削除に比べると長い期間 + 番号付きレジスタに残ります。 + +REFERENCE: 番号付きレジスタ :h quote0 + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + Lesson 2.1.4: マークの美しさ + + + ** コードモンキーの算術の回避 ** + +NOTE: コーディングの際の共通の難問は大きなコードの塊を動かすことです。 + 以下の技術は、操作に関連付けられた行数の計算、例えば "a147d や + :945,1091d a や、さらに悪いことにまず i=1091-945 を + 使うようなことを避けることを助けます。 + + 1. 以下の ---> と示された行にカーソルを移動しましょう。 + + 2. 関数の最初の行に移動し ma でマークしましょう。 + +NOTE: 行内の正確な位置は重要ではありません! + + 3. 行の最後に移動しそれからコードブロックの末尾に移動しましょう。 $% + + 4. ブロックをレジスタ a に削除しましょう。 "ad'a + +覚え方: into register(") named (a) put the (d)eletion from the cursor to the + LINE containing mark(') (a) + {訳: レジスタ(")へ格納 (a)という名前の (d)削除を カーソルからマーク(')(a) + を含む行まで} + + 5. ブロックを BBB と CCC の間にペーストしましょう。 "ap + +NOTE: 慣れるまで何度もこの操作を練習しましょう。 ma$%"ad'a + +---> AAA + function itGotRealBigRealFast() { + if ( somethingIsTrue ) { + doIt() + } + // 私たちの関数の分類法が変更され、現在の位置では + // アルファベットの意味がなくなりました + + // 何百行ものコードを想像してください + + // 素朴に、最初と最後に移動して、各行番号を記録または記憶する + // こともできます + } + BBB + CCC + +NOTE: マークとレジスタは名前空間を共有しません。そのため、レジスタ a は完全に + マーク a とは独立しています。これはレジスタとマクロについては当てはまり + ません。 + +REFERENCE: マーク :h marks + マークによる移動 :h mark-motions (' と ` の違いについて) + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + Lesson 2.1 要約 + + + 1. テキストを格納 (ヤンク、削除) したり、取得 (ペースト) するレジスタが + 全部で 26 個 (a-z) あります。 + 2. 単語全体をヤンクするには単語内のどこかで: yiw + 3. 単語全体を変更するには単語内のどこかで: ciw + 4. 挿入モードで直接レジスタからテキストを挿入するには: (C-r)a + + 5. 単純な算術演算の結果を挿入するには: 挿入モードで (C-r)=60*60 + 6. システムコールの結果を挿入するには: 挿入モードで (C-r)=system('ls -1') + + 7. レジスタを検査するには :reg + 8. 行全体削除の最終宛先を学びました。dd は番号付きレジスタへ、すなわち + レジスタ 1 - 9 に降順になります。行全体削除は他の操作より長く番号付き + レジスタに保持されることを理解しました + 9. 番号付きレジスタにおけるすべてのヤンクの最終宛先と、それらはどれほど儚い + ものなのかを学びました + + 10. コマンドモードでマークを設定するには m[a-zA-Z0-9] + 11. マークへ行単位で移動するには ' + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + これにて Vim のチュートリアルの第 2 章を終わります。これは作業中です。 + + この章は Paul D. Parker によって書かれました。 + + 日本語訳 vim-jpチーム +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/src/po/ja.po b/src/po/ja.po index 5bcf8e1..529c69e 100644 --- a/src/po/ja.po +++ b/src/po/ja.po @@ -14,7 +14,7 @@ msgid "" msgstr "" "Project-Id-Version: Vim 9.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-07-23 10:59+0900\n" +"POT-Creation-Date: 2024-12-17 21:03+0900\n" "PO-Revision-Date: 2024-08-15 12:54+0900\n" "Last-Translator: MURAOKA Taro \n" "Language-Team: Japanese \n" @@ -266,7 +266,7 @@ msgid "tagname" msgstr "タグ名" msgid " kind file\n" -msgstr " ファイル種類\n" +msgstr " 種別 ファイル\n" msgid "'history' option is zero" msgstr "オプション 'history' がゼロです" @@ -2255,6 +2255,12 @@ msgstr "-- 継続 --" msgid " SPACE/d/j: screen/page/line down, b/u/k: up, q: quit " msgstr " SPACE/d/j: 画面/ページ/行 下, b/u/k: 上, q: 終了 " +msgid "W23: Clipboard register not available, using register 0" +msgstr "W23: クリップボードレジスタが使えません、レジスタ 0 を使用します" + +msgid "W24: Clipboard register not available. See :h W24" +msgstr "W24: クリップボードレジスタが使えません、:h W24 を参照してください" + msgid "Question" msgstr "質問" @@ -8775,6 +8781,9 @@ msgstr "E1512: フィールド \"%s\" の文字幅が間違っています" msgid "E1513: Cannot switch buffer. 'winfixbuf' is enabled" msgstr "E1513: バッファを切り替えられません。'winfixbuf' が有効化されています" +msgid "E1514: 'findfunc' did not return a List type" +msgstr "E1514: 'findfunc' が List 型を返しませんでした" + msgid "--No lines in buffer--" msgstr "--バッファに行がありません--" @@ -9771,6 +9780,9 @@ msgstr "'s' フラグを 'shortmess' に追加 (検索メッセージを表示 msgid "list of flags to make messages shorter" msgstr "メッセージを短くするためのフラグのリスト" +msgid "options for outputting messages" +msgstr "メッセージを出力するためのオプション" + msgid "show (partial) command keys in location given by 'showcmdloc'" msgstr "コマンド (の一部) を 'showcmdloc' で指定された場所に表示" @@ -9889,6 +9901,9 @@ msgstr "挿入モード補完が CTRL-N と CTRL-P でどう動作するかを msgid "whether to use a popup menu for Insert mode completion" msgstr "挿入モード補完でポップアップメニューを使うかどうか" +msgid "popup menu item align order" +msgstr "ポップアップメニューの整列順序" + msgid "options for the Insert mode completion info popup" msgstr "挿入モード補完の情報ポップアップ用のオプション"