• 検索結果がありません。

文字の置換

ドキュメント内 さあはじめよう,UNIX (ページ 60-64)

2. 所有者に対するパーミッションの状態 3. グループに対するパーミッションの状態

6.1 vi エディタ

6.1.6 文字の置換

ある文字を他の文字あるいは文字列に置換したいときは、\s"(S ubstituteの略)コマンド を 使います。

2行目の\A"\As soon a"に変更する

1. カーソルを変更文字\A"へ移動します。

Vi is a display oriented text editor based on ex.

As you add text,

the lines with tilde characters

2. 置換コマンド \ s "を入力します(\A"が置換文字\$"で表示されます)

Vi is a display oriented text editor based on ex.

$s you add text,

the lines with tilde characters

3. 置換したい文字列を入力します。

Vi is a display oriented text editor based on ex.

As soon as you add text,

the lines with tilde characters

4. Escキーを押し、コマンド モード に戻ります(カーソルが左側に1 つ移動します)

Vi is a display oriented text editor based on ex.

As soon as you add text,

the lines with tilde characters

6.1.7

文字

(

)

の変更

文字()の変更には、\cw "(Change Wordの略)コマンド を使います。

2行目の\soon"を\slowly"に変更する

1. カーソルを変更するワード \soon"1文字目\s"へ移動します。

Vi is a display oriented text editor based on ex.

As soon as add text,

2. 変更コマンド \ cw " を入力します(変更ワード の最終文字が置換文字 \$"で表示され ます)

Vi is a display oriented text editor based on ex.

As soo$ as add text,

the lines with tilde characters

3. 変更したい文字列を入力します。

Vi is a display oriented text editor based on ex.

As slowly as add text,

the lines with tilde characters

4. Escキーを押し、コマンド モード に戻ります(カーソルが左側に1 つ移動します)

Vi is a display oriented text editor based on ex.

As slowl y as add text,

the lines with tilde characters

6.1.8

行全体の変更

カーソルのある行全体の文字列を、他の文字列へ変更したい時に使います。行全体の変更に は、\ cc" (Change toChangeの略)コマンド を使います。

3行目全体を\the subsequent text"と変更する

1. カーソルを3行目の先頭文字に移動します。

Vi is a display oriented text editor based on ex.

As you add text,

the lines with tilde characters

will scroll down toward

the bottom of the screen.

2. 変更コマンド \ cc" を入力します(3行目の文字列が消えます)

Vi is a display oriented text editor based on ex.

As you add text,

will scroll down toward

the bottom of the screen.

3. 置換したい文字列を入力します。

Vi is a display oriented text editor based on ex.

As you add text,

the subsequent text

will scroll down toward

the bottom of the screen.

4. Escキーを押し、コマンド モード に戻ります(カーソルが左側に1 つ移動します)

Vi is a display oriented text editor based on ex.

As you add text,

the subsequent text

will scroll down toward

the bottom of the screen.

6.1.9

テキスト の挿入

カーソルのある位置から新しく文字あるいは文字列を挿入したい時に使います。文字列の挿 入には\ i "(Insertの略)コマンド を使います。

4行目の\down"と\toward"の間に\quickly"と挿入する場合

1. 文字の挿入箇所へカーソルを移動します。

Vi is a display oriented text editor based on ex.

As you add text,

the subsequent text

will scroll down toward

the bottom of the screen.

2. 文字挿入コマンド \i " を入力します(画面には変化はありません)

Vi is a display oriented text editor based on ex.

As you add text,

the subsequent text

will scroll down toward

the bottom of the screen.

3. 入力したい文字列(\quickly")を入力します。

Vi is a display oriented text editor based on ex.

As you add text,

the subsequent text

will scroll down quickly toward

the bottom of the screen.

4. Escキーを押し、コマンド モード に戻ります(カーソルが左側に1 つ移動します)

Vi is a display oriented text editor based on ex.

As you add text,

the subsequent text

will scroll down quickly toward

the bottom of the screen.

6.1.10

文字の削除

カーソル位置にある1文字を削除したい時には、\x "コマンド を使います。

4行目、\toward"という単語の\ward"という文字列を削除する場合

1. 削除する文字へカーソルを移動します。

Vi is a display oriented text editor based on ex.

As you add text,

the subsequent text

will scroll down quickly toward

the bottom of the screen.

2. \x "を4回入力すると4文字、文字が削除されます(\ 4x" と入力してもよい)

Vi is a display oriented text editor based on ex.

As you add text,

the subsequent text

will scroll down quickly to

the bottom of the screen.

ドキュメント内 さあはじめよう,UNIX (ページ 60-64)