下記の文章を例にカーソル移動を説明します。
ちなみにこの文章はviのmanページの頭の部分です。
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.
- 上下左右移動
- h 左
j 下
k 上
l 右
viの派生であるVimエディタでは、入力モード時も十字キー移動できますが、コアなviユーザにとっては「それは邪道だ」そうです。
- 行の先頭,末尾に移動
$ 末尾
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.
0 先頭
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.
- 単語単位(スペースや句読点区切り)で移動
w 1単語進む
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.
3w 3単語進む
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.
b 1単語戻る
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.
適切なスペースが入ったプログラムを編集する際にこの操作が輝きます。
- 関連記事
-
-
vim インデントを任意の数のスペースに設定 2014/07/02
-
vim 行番号を表示/非表示 2014/06/29
-
vi エディタの使い方 カーソル移動 2014/06/28
-
viエディタの使い方 基本編 2014/06/27
-
vim エンコードと改行コードの確認と設定 2014/06/01
-