メインコンテンツへスキップ
kitlocal.dev

Vimチートシート

ローカルで実行

100% ブラウザ内で処理されます。入力や出力が端末の外に送信されることはありません。

わかりやすい言葉で解説するVimコマンド: モード、モーション、オペレーター、検索と置換、マクロ、各種設定。Vim 9.1で実行確認済みの実例付き。

動作の仕組み

Vim is modal: the same key does different things depending on the mode. Normal mode (the default) runs commands, Insert mode types text, Visual mode selects text and Command-line mode (the colon prompt) runs Ex commands. Most edits read like a sentence: an operator (d, c, y) plus a motion or text object (w, ip, i").

サバイバルキット

最初に覚えるべき最小限のコマンド。

80 件のコマンド

キーボードショートカット/検索にフォーカスJK選択を移動C選択項目をコピーF選択項目をブックマークEsc検索をクリア

Open, save & quit

If you ever feel lost, press Esc a couple of times: it always returns you to Normal mode, where the commands below work.

公式ドキュメント: Starting Vim
  • 基本

    Open a file in Vim.

    vim <file>

    コマンドを組み立てる

    vim <file>

    値は入力した通りにそのまま挿入されます。空白や特殊文字を含む場合は、必要に応じて引用符で囲んでください。

    使いどころ

    Starts editing an existing file, or a new one that is created the first time you save.

    コマンドの内訳

    vim
    the editor
    <file>
    path of the file to open (it need not exist yet)

    実例

    Opens notes.txt, or an empty buffer called notes.txt if the file does not exist.

    vim notes.txt

    注意点

    • Stuck? Press Esc, type :q! and press Enter to leave without saving.

    関連項目

Move around

Learn motions first: every delete, change and yank command takes a motion, so moving well is the same skill as editing well.

公式ドキュメント: Motion commands

Type & fix text

Small edits you will do all day: start typing in the right place, remove or replace a character, undo, and repeat.

公式ドキュメント: Inserting and changing text

Delete, copy & change (operators)

Vim edits are sentences: operator + (count) + motion or text object. d = delete, c = change, y = yank (copy). Learn the verbs once and combine them with every noun.

公式ドキュメント: Operators and text objects

Select first, then act

Visual mode shows what you will affect before you press the operator. It is slower than a good motion but friendlier while you learn.

公式ドキュメント: Visual mode

Searching is just another motion, so d/foo deletes up to the next foo. Search and substitute both use regular expressions.

公式ドキュメント: Patterns and search

Files, buffers, windows & tabs

A buffer is a file in memory, a window is a view of a buffer, and a tab page is a set of windows. You can have many buffers open without showing them all.

公式ドキュメント: Windows, buffers and tab pages

Macros & registers

Registers are named clipboards: yanks and deletes go into them, and macros are keystrokes recorded into them.

公式ドキュメント: Registers

Settings & your vimrc

Options are changed with :set and last until you quit. Put the ones you like in your vimrc so they apply every time.

公式ドキュメント: Options and vimrc

KitLocalツールで試す

用語集
Normal mode
The default mode, where keys are commands. Press Esc to return here.
Insert mode
The mode where typed characters become text.
Visual mode
Select text with v, V or Ctrl-v, then apply an operator to it.
Ex command
A command typed after a colon, such as :w or :%s/a/b/g.
Motion
A command that moves the cursor (w, $, gg). Operators act on the text it covers.
Operator
A command that acts on text: d (delete), c (change), y (yank = copy), > (indent).
Text object
A region such as a word, quoted string or paragraph, chosen with i (inner) or a (around).
Register
A named storage slot for yanked or deleted text, like a clipboard with many slots.
Buffer
A file loaded in memory. A window shows a buffer; a tab page holds windows.

2026/11/15 に検証済み · Vim 9.1 で検証済み

出典: Vim help index (vimhelp.org) · Vim user manual · Vim quick reference

山括弧内の内容は実際の値に置き換えてください。コマンドは公式ドキュメントに基づいており、実例は記載されたバージョンで実行確認されています。