1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Vimを覚える【vimtutor Lesson 6】

Posted at

はじめに

前回の記事はこちらです。

Lesson 6.1

oで「下に一行追加しインサートモード」です。

大文字のOだと「上」に行を追加し、同じくインサートモードに入ります。

Lesson 6.2

aで「カーソルの後からインサートモード」ですね。(まだやってなかったのか・・・)

使い方はiに似ています。
iでは「カーソルの位置(あるいは前)からインサート」でした。

Lesson 6.3

Rで「上書きモード」です。

置き換え、上書き系を振り返ります。

例として、以下のテキスト行を考えましょう。

This is a test line.

カーソルがaの上にあると仮定し、各コマンドをxで適用します

コマンド 説明 実行前 実行後
s 現在の文字を削除し、指定した文字で置き換えて挿入モードに入る This is a test line. (カーソルがa上) This is x test line.
(挿入モードになる)
S 現在の行を削除し、指定した文字で置き換えて挿入モードに入る This is a test line. x (新しい行にxが挿入され、挿入モードになる)
r 現在の文字を指定した文字で置き換える This is a test line. (カーソルがa上) This is x test line.
(ノーマルモードのまま)
R 上書きモードに入り、以降の文字を指定した文字で置き換える This is a test line. (カーソルがa上) This is x (以降の文字を置き換えられる状態)
c 現在の文字から指示した箇所までを削除し、挿入モードに入る This is a test line. (カーソルがa上) This is x test line
(挿入モードになる)
(cwの場合)

Lesson 6.4

yでコピー!ですね。
Vimではコピーすることを「ヤンク(yank)」と呼び、その頭文字のyでコピーを表します。

また、pでペーストをします。
「ペースト(paste)」のpですね。

Lesson 6.5

:setでオプションを指定してみよう!の章ですね。

:set icで大文字・小文字を区別しなくなります

:set hlsで検索結果がハイライトされるようになります。

:set isで検索語を入力したときリアルタイムで検索結果が表示されるようになります

Lesson 6 修了!

おつかれまでした!!

おわりに

オプションで便利になっていくのがワクワクでした。

次がラストです!!

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?