diff --git a/doc/usr_03.jax b/doc/usr_03.jax index d6c2e5f86..379c29c07 100644 --- a/doc/usr_03.jax +++ b/doc/usr_03.jax @@ -1,4 +1,4 @@ -*usr_03.txt* For Vim バージョン 8.1. Last change: 2017 Jul 21 +*usr_03.txt* For Vim バージョン 8.2. Last change: 2019 Nov 21 VIM USER MANUAL - by Bram Moolenaar @@ -213,7 +213,8 @@ CやC++のプログラマであれば、次のようなパターンのエラー L --> | text sample text | +---------------------------+ -("H" はHome、"M" はMiddle、"L" はLastの意味です) +("H" はHome、"M" はMiddle、"L" はLastの意味です。あるいは、"H" をHigh, "M" を +Middle, "L" をLowともみなせます) ============================================================================== *03.6* 現在の場所を表示 @@ -293,13 +294,13 @@ CTRL-Dコマンドは窓を半分だけ下げます。つまりテキストが 行を表示したい場合は "zz" コマンドを使います。 +------------------+ +------------------+ - | some text | | some text | - | some text | | some text | - | some text | | some text | - | some text | zz --> | line with cursor | - | some text | | some text | - | some text | | some text | - | line with cursor | | some text | + | earlier text | | earlier text | + | earlier text | | earlier text | + | earlier text | | earlier text | + | earlier text | zz --> | line with cursor | + | earlier text | | later text | + | earlier text | | later text | + | line with cursor | | later text | +------------------+ +------------------+ "zt" コマンドでカーソル行を画面の 1 行目として表示できます。"zb" コマンドなら @@ -475,7 +476,7 @@ CTRL-Dコマンドは窓を半分だけ下げます。つまりテキストが "G" でファイルの末尾まで移動し、"o" で新しい行を挿入して ":set" コマンドを書く ための空行を作っています。挿入モードの終了はです。そして、ファイルを保存 -しましょう。 > +して閉じましょう。 > ZZ @@ -517,9 +518,9 @@ Vimでは、検索に正規表現(regular expressions)を使います。 the solder holding one of the chips melted and the ~ xxx -"/^the$" という指定もできます。この指定だと、"the" という単語だけの行にヒット -します。なお空白文字も意味を持ちます。ですから、"the " のように行末に空白文 -字を含んでいた場合は、"/the$" のパターンではヒットしません。 +"/^the$" という指定もできます。この指定だと、完全に "the" という単語だけででき +ている行にのみヒットします。なお空白文字も意味を持ちます。ですから、"the " の +ように行末に空白文字を含んでいた場合は、"/the$" のパターンではヒットしません。 任意の 1 文字 @@ -554,8 +555,8 @@ Vimでは、検索に正規表現(regular expressions)を使います。 この ` は backtick とか open single-quote と呼ばれる(日本では「バッククォート」 が多いでしょうか)ものです。 -このコマンドを 2 回実行すると、元の場所に戻ります。これは ` コマンドもジャンプ -コマンドなので、実行前の場所が記録されるためです。 +このコマンドを 2 回実行すると、元の場所に戻ります。これは "`" コマンドもジャン +プコマンドなので、実行前の場所が記録されるためです。 通常、現在行以外にカーソルが動くようなコマンドを実行した場合、それをジャンプ と呼びます。"/" や "n" もジャンプの一種です(ジャンプ先がどれだけ離れているかは @@ -564,9 +565,10 @@ Vimでは、検索に正規表現(regular expressions)を使います。 "j" や "k" はカウンタを指定すればカーソルをはるか彼方に移動できますが、これも ジャンプ扱いではありません。 -``コマンドは 2 個所の間を交互にジャンプします。CTRL-Oコマンドはより古いマーク -(O は Older の意味です)にジャンプします。CTRL-Iはより新しいマーク("I" キーは -"O" キーのすぐ左隣りです)にジャンプします。次のコマンドを例にしましょう。 > +"``" コマンドは 2 個所の間を交互にジャンプします。CTRL-Oコマンドはより古いマー +ク(O は Older の意味です)にジャンプします。CTRL-Iはより新しいマーク(たいていの +キーボード配列では "I" キーは "O" キーのすぐ左隣りです)にジャンプします。次の +コマンドを例にしましょう。 > 33G /^The @@ -604,8 +606,9 @@ CTRL-Iを使うと33行目にジャンプし、さらにCTRL-Iを使うと行頭 > `a < -'{mark}(アポストロフィ + マーク名)コマンドで{mark}を設定してある行の行頭に移動 -できます。`{mark}の場合は{mark}を設定した桁位置に移動します。 +"'{mark}" (アポストロフィ + マーク名)コマンドで{mark}を設定してある行の行頭に +移動できます。"`{mark}" コマンドの場合は更に、{mark}を設定した桁位置に移動し +ます。 マーク機能はファイル中の関連している 2 箇所で作業をする場合に便利です。例えば、 ファイルの最後の方を編集している時に、ファイルの最初の方の内容を確認する必要が diff --git a/en/usr_03.txt b/en/usr_03.txt index 5c204f03f..c0250887e 100644 --- a/en/usr_03.txt +++ b/en/usr_03.txt @@ -1,4 +1,4 @@ -*usr_03.txt* For Vim version 8.1. Last change: 2017 Jul 21 +*usr_03.txt* For Vim version 8.2. Last change: 2019 Nov 21 VIM USER MANUAL - by Bram Moolenaar @@ -81,8 +81,8 @@ The "$" command moves the cursor to the end of a line. If your keyboard has an key it will do the same thing. The "^" command moves to the first non-blank character of the line. The "0" -command (zero) moves to the very first character of the line. The key -does the same thing. In a picture: +command (zero) moves to the very first character of the line, and the +key does the same thing. In a picture: ^ <------------ @@ -221,7 +221,8 @@ you can see? This figure shows the three commands you can use: L --> | text sample text | +---------------------------+ -Hints: "H" stands for Home, "M" for Middle and "L" for Last. +Hints: "H" stands for Home, "M" for Middle and "L" for Last. Alternatively, +"H" for high, "M" for Middle and "L" for low. ============================================================================== *03.6* Telling where you are @@ -298,22 +299,22 @@ To scroll one line at a time use CTRL-E (scroll up) and CTRL-Y (scroll down). Think of CTRL-E to give you one line Extra. (If you use MS-Windows compatible key mappings CTRL-Y will redo a change instead of scroll.) -To scroll forward by a whole screen (except for two lines) use CTRL-F. The -other way is backward, CTRL-B is the command to use. Fortunately CTRL-F is -Forward and CTRL-B is Backward, that's easy to remember. +To scroll forward by a whole screen (except for two lines) use CTRL-F. To +scroll backwards, use CTRL-B. These should be easy to remember: F for +Forwards and B for Backwards. A common issue is that after moving down many lines with "j" your cursor is at the bottom of the screen. You would like to see the context of the line with the cursor. That's done with the "zz" command. +------------------+ +------------------+ - | some text | | some text | - | some text | | some text | - | some text | | some text | - | some text | zz --> | line with cursor | - | some text | | some text | - | some text | | some text | - | line with cursor | | some text | + | earlier text | | earlier text | + | earlier text | | earlier text | + | earlier text | | earlier text | + | earlier text | zz --> | line with cursor | + | earlier text | | later text | + | earlier text | | later text | + | line with cursor | | later text | +------------------+ +------------------+ The "zt" command puts the cursor line at the top, "zb" at the bottom. There @@ -353,7 +354,7 @@ The "?" command works like "/" but searches backwards: > The "N" command repeats the last search the opposite direction. Thus using "N" after a "/" command searches backwards, using "N" after "?" searches -forward. +forwards. IGNORING CASE @@ -462,8 +463,8 @@ really jump to that location. Or type more to change the search string. :set nowrapscan This stops the search at the end of the file. Or, when you are searching -backwards, at the start of the file. The 'wrapscan' option is on by default, -thus searching wraps around the end of the file. +backwards, it stops the search at the start of the file. The 'wrapscan' +option is on by default, thus searching wraps around the end of the file. INTERMEZZO @@ -485,7 +486,8 @@ Vim. Example: > Go:set hlsearch "G" moves to the end of the file. "o" starts a new line, where you type the -":set" command. You end insert mode with . Then write the file: > +":set" command. You end insert mode with . Then write and close the +file: > ZZ @@ -499,8 +501,8 @@ Regular expressions are an extremely powerful and compact way to specify a search pattern. Unfortunately, this power comes at a price, because regular expressions are a bit tricky to specify. In this section we mention only a few essential ones. More about search -patterns and commands in chapter 27 |usr_27.txt|. You can find the full -explanation here: |pattern|. +patterns and commands can be found in chapter 27 |usr_27.txt|. You can find +the full explanation here: |pattern|. BEGINNING AND END OF A LINE @@ -526,9 +528,9 @@ And with "/^the" we find this one: the solder holding one of the chips melted and the ~ xxx -You can try searching with "/^the$", it will only match a single line -consisting of "the". White space does matter here, thus if a line contains a -space after the word, like "the ", the pattern will not match. +You can try searching with "/^the$"; it will only match a single line +consisting entirely of "the". White space does matter here, thus if a line +contains a space after the word, like "the ", the pattern will not match. MATCHING ANY SINGLE CHARACTER @@ -563,20 +565,20 @@ where you came from, use this command: > This ` is a backtick or open single-quote character. If you use the same command a second time you will jump back again. That's -because the ` command is a jump itself, and the position from before this jump -is remembered. +because the "`" command is a jump itself, and the position from before this +jump is remembered. Generally, every time you do a command that can move the cursor further than within the same line, this is called a jump. This includes the search commands "/" and "n" (it doesn't matter how far away the match is). But not the character searches with "fx" and "tx" or the word movements "w" and "e". - Also, "j" and "k" are not considered to be a jump. Even when you use a + Also, "j" and "k" are not considered to be a jump, even when you use a count to make them move the cursor quite a long way away. -The `` command jumps back and forth, between two points. The CTRL-O command +The "``" command jumps back and forth, between two points. The CTRL-O command jumps to older positions (Hint: O for older). CTRL-I then jumps back to newer -positions (Hint: I is just next to O on the keyboard). Consider this sequence -of commands: > +positions (Hint: for many common keyboard layouts, I is just next to O). +Consider this sequence of commands: > 33G /^The @@ -614,9 +616,9 @@ Thus to move to the a mark: > `a -The command 'mark (single quotation mark, or apostrophe) moves you to the -beginning of the line containing the mark. This differs from the `mark -command, which moves you to marked column. +The command "'mark" (single quotation mark, or apostrophe) moves you to the +beginning of the line containing the mark. This differs from the "`mark" +command, which also moves you to the marked column. The marks can be very useful when working on two related parts in a file. Suppose you have some text near the start of the file you need to look at,