0
1

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 5 years have passed since last update.

viの移動系コマンド

0
Last updated at Posted at 2020-02-15

vimの操作に慣れないので、逆引き用
<追記>少し古いけど便利そうなチートシートがあった。

ノーマルモード

文字単位

h
l
k
j
※数字との組み合わせ可能
9jなら9行分下へ、4lなら4文字分右

ワード単位

次の単語 w
前の単語 b
※数字との組み合わせ可能
3wなら3単語分次へ、4bなら4単語分前へ移動

行単位

行頭 0 または ^
行末 $
任意の行 :数字 ※:6ならファイルの6行目に移動

ページ単位

1ページ次 ctl + f
1ページ前 ctl + b
半ページ次 ctl + d
半ページ前 ctl + u

ファイル単位

ファイル先頭 gg
ファイル末尾 G

※ ちょっと編集についてのメモ
現在の行以降〜ファイル末尾までのインデントを一段深くする >G

ビジュアルモード

基本的にノーマルモードと同じ。コピー時にはノーマルモードと同じく(選択して)y

矩形選択 ctl + v

コマンド 結果
h 1文字左
l 1文字右
k 1文字上
j 1文字下
w 1単語次
b 1単語前
ctl + f 1ページ次
ctl + b 1ページ前
ctl + d 半ページ次
ctl + u 半ページ前
0 行頭
^
$ 行末
:数字 指定行へ
gg ファイル先頭
G ファイル末尾

参考
https://vim-jp.org/vimdoc-ja/index.html
https://vim.jp.net/bypurpose.html
https://vim.jp.net/setup_unix_setting.html

0
1
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
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?