クイックリファレンス

Nvim の:helpページ。生成元はソースで、tree-sitter-vimdocパーサーを使用しています。


クイックリファレンスガイド

目次
タグ 項目名 タグ 項目名
Q_ct ヘルプファイル一覧 Q_re コマンドの繰り返し Q_lr 移動: 左右 Q_km キーマッピング Q_ud 移動: 上下 Q_ab 略語 Q_tm 移動: テキストオブジェクト Q_op オプション Q_pa 移動: パターン検索 Q_ur 元に戻す/やり直すコマンド Q_ma 移動: マーク Q_et 外部コマンド Q_vm 移動: その他 Q_qf クイックフィックスコマンド Q_ta 移動: タグの使用 Q_vc その他のコマンド Q_sc スクロール Q_ce Ex: コマンドライン編集 Q_in insert: テキストの挿入 Q_ra Ex: 範囲 Q_ai insert: キー Q_ex Ex: 特殊文字 Q_ss insert: 特殊キー Q_st Vim の起動 Q_di insert: ディグラフ Q_ed ファイルの編集 Q_si insert: 特殊挿入 Q_fl 引数リストの使用 Q_de 変更: テキストの削除 Q_wq 書き込みと終了 Q_cm 変更: コピーと移動 Q_ac 自動コマンド Q_ch 変更: テキストの変更 Q_wi マルチウィンドウコマンド Q_co 変更: 複雑な変更 Q_bu バッファリストコマンド Q_vi Visual モード Q_sy シンタックスハイライト Q_to テキストオブジェクト Q_gu GUI コマンド Q_fo フォールディング

Q_lr 左右の移動

N は、コマンドの前に付けることができるオプションの回数です。
h N h 左へ (CTRL-H<BS>、または<Left>キーも使用可能) l N l 右へ (<Space>または<Right>キーも使用可能) 0 0 行の先頭文字へ (<Home>キーも使用可能) ^ ^ 行の先頭にある空白以外の文字へ $ N $ 次の行末 (EOL) へ (<End>キーも使用可能) g0 g0 画面行の先頭文字へ ("0" とは行が折り返された場合に異なる) g^ g^ 画面行の先頭にある空白以外の文字へ ("^" とは行が折り返された場合に異なる) g$ N g$ 画面行の最後の文字へ ("$" とは行が折り返された場合に異なる) gm gm 画面行の中央へ gM gM 行の中央へ bar N | N カラムへ (デフォルト: 1) f N f{char} 右方向の{char}の N 番目の出現位置へ F N F{char} 左方向の{char}の N 番目の出現位置へ t N t{char} 右方向の{char}の N 番目の出現位置の手前まで T N T{char} 左方向の{char}の N 番目の出現位置の手前まで ; N ; 最後の "f"、"F"、"t"、または "T" を N 回繰り返す , N , 最後の "f"、"F"、"t"、または "T" を逆方向に N 回繰り返す

Q_ud 上下の移動

k N k 上へ N 行 (CTRL-P<Up>も使用可能) j N j 下へ N 行 (CTRL-JCTRL-N<NL><Down>も使用可能) - N - 上へ N 行、先頭の空白以外の文字へ + N + 下へ N 行、先頭の空白以外の文字へ (CTRL-M<CR>も使用可能) _ N _ 下へ N-1 行、先頭の空白以外の文字へ G N G N 行目へ移動 (デフォルト: 最終行)、先頭の空白以外の文字へ gg N gg N 行目へ移動 (デフォルト: 最初の行)、先頭の空白以外の文字へ N% N % ファイルの N パーセントの位置の行へ移動;N は必須、そうでない場合は%コマンド gk N gk 上へ N 画面行 (行が折り返された場合 "k" と異なる) gj N gj 下へ N 画面行 (行が折り返された場合 "j" と異なる)

Q_tm テキストオブジェクトの移動

w N w N 語先へ W N W N 個の空白で区切られたWORD先へ e N e N 番目の語の末尾へ E N E N 番目の空白で区切られたWORDの末尾へ b N b N 語後ろへ B N B N 個の空白で区切られたWORD後ろへ ge N ge N 番目の語の末尾へ戻る gE N gE N 番目の空白で区切られたWORDの末尾へ戻る
) N ) N 文先へ ( N ( N 文後ろへ } N } N 段落先へ { N { N 段落後ろへ ]] N ]] N セクション先へ、セクションの先頭へ [[ N [[ N セクション後ろへ、セクションの先頭へ ][ N ][ N セクション先へ、セクションの末尾へ [] N [] N セクション後ろへ、セクションの末尾へ [( N [( 閉じられていない '(' まで N 回戻る [{ N [{ 閉じられていない '{' まで N 回戻る [m N [m メソッドの先頭まで N 回戻る (Java 用) [M N [M メソッドの末尾まで N 回戻る (Java 用) ]) N ]) 閉じられていない ')' まで N 回進む ]} N ]} 閉じられていない '}' まで N 回進む ]m N ]m メソッドの先頭まで N 回進む (Java 用) ]M N ]M メソッドの末尾まで N 回進む (Java 用) [# N [# 閉じられていない "#if" または "#else" まで N 回戻る ]# N ]# 閉じられていない "#else" または "#endif" まで N 回進む [star N [* コメント "/*" の先頭まで N 回戻る ]star N ]* コメント "*/" の末尾まで N 回進む

Q_pa パターン検索

/ N /{pattern}[/[offset]]<CR> {pattern} の N 番目の出現位置を前方検索 ? N ?{pattern}[?[offset]]<CR> {pattern} の N 番目の出現位置を後方検索 /<CR> N /<CR> 最後の検索を前方方向に繰り返す ?<CR> N ?<CR> 最後の検索を後方方向に繰り返す n N n 最後の検索を繰り返す N N N 最後の検索を逆方向に繰り返す star N * カーソル下の識別子を前方検索 # N # カーソル下の識別子を後方検索 gstar N g* "*" と同じだが、部分一致も見つける g# N g# "#" と同じだが、部分一致も見つける gd gd カーソル下の識別子のローカル宣言へ移動 gD gD カーソル下の識別子のグローバル宣言へ移動
pattern 検索パターンにおける特殊文字
意味 マジック ノーマジック
任意の単一文字と一致する . \. 行頭と一致する ^ ^ <EOL>と一致する $ $ 語頭と一致する \< \< 語尾と一致する \> \> 範囲 [a-z] の単一文字と一致する \[a-z] 範囲 [^a-z] にない単一文字と一致する \[^a-z] 識別子文字と一致する \i \i 数字を除く idem \I \I キーワード文字と一致する \k \k 数字を除く idem \K \K ファイル名文字と一致する \f \f 数字を除く idem \F \F 印刷可能文字と一致する \p \p 数字を除く idem \P \P 空白文字と一致する \s \s 空白以外の文字と一致する \S \S
<Esc>と一致する \e \e <Tab>と一致する \t \t <CR>と一致する \r \r <BS>と一致する \b \b
先行するアトムを 0 個以上一致させる * \* 先行するアトムを 1 個以上一致させる \+ \+ 先行するアトムを 0 個または 1 個一致させる \= \= 先行するアトムを 2 個から 5 個一致させる \{2,5} \{2,5} 2 つの選択肢を分ける \| \| パターンをアトムにグループ化する \(\) \(\)
search-offset 検索コマンドの後で使用できるオフセット
[num] [num] 行下、1 カラム目 +[num] [num] 行下、1 カラム目 -[num] [num] 行上、1 カラム目 e[+num] マッチの末尾から [num] 文字右 e[-num] マッチの末尾から [num] 文字左 s[+num] マッチの先頭から [num] 文字右 s[-num] マッチの先頭から [num] 文字左 b[+num] 上記 s[+num] と同じ (ニーモニック: begin) b[-num] 上記 s[-num] と同じ (ニーモニック: begin) ;{search-command} 次に{search-command}を実行する

Q_ma マークと移動

m m{a-zA-Z} マーク{a-zA-Z}で現在位置をマークする `a{a-z} 現在のファイル内のマーク {a-z} へ移動する `A{A-Z} 任意のファイル内のマーク {A-Z} へ移動する `0{0-9} Vim が最後に終了した位置へ移動する `` `` 最後のジャンプ前の位置へ移動する `quote" 最後にこのファイルを編集したときの位置へ移動する `[[ 前回操作または挿入したテキストの先頭へ移動する `]] 前回操作または挿入したテキストの末尾へ移動する `<< (前回) Visual エリアの先頭へ移動する `>> (前回) Visual エリアの末尾へ移動する `.. このファイルでの最後の変更位置へ移動する ' '{a-zA-Z0-9[]'"<>.} と同じだが、行の先頭の空白以外の文字へ :marks :marks アクティブなマークを出力する CTRL-O N CTRL-O ジャンプリストの N 番目の古い位置へ移動する CTRL-I N CTRL-I ジャンプリストの N 番目の新しい位置へ移動する :ju :ju[mps] ジャンプリストを出力する

Q_vm その他の移動

% % この行で次のブレース、ブラケット、コメント、または "#if"/"#else"/"#endif" を探し、対応する位置へ移動する H N H ウィンドウの N 行目へ移動する、先頭の空白以外の文字へ M M ウィンドウの中央の行へ移動する、先頭の空白以外の文字へ L N L 下から N 行目へ移動する、先頭の空白以外の文字へ
go N go バッファの N バイト目へ移動する :go :[range]go[to] [off] バッファの [off] バイト目へ移動する

Q_ta タグの使用

:ta :ta[g][!] {tag} タグ{tag}へジャンプする :ta :[count]ta[g][!] タグリストの [count] 番目の新しいタグへジャンプする CTRL-] CTRL-] カーソル下のタグへジャンプする、変更が加えられていない場合 :ts :ts[elect][!] [tag] 一致するタグをリスト表示し、ジャンプするタグを選択する :tjump :tj[ump][!] [tag] タグ [tag] へジャンプする、または一致するタグが複数ある場合はリストから選択する :ltag :lt[ag][!] [tag] タグ [tag] へジャンプし、一致するタグを位置リストに追加する
:tags :tags タグ一覧を表示 CTRL-T N CTRL-T N個前のタグにジャンプ :po :[count]po[p][!] タグ一覧から[count]個前のタグにジャンプ :tnext :[count]tn[ext][!] [count]個後の一致するタグにジャンプ :tp :[count]tp[revious][!] [count]個前の一致するタグにジャンプ :tr :[count]tr[ewind][!] [count]個目の一致するタグにジャンプ :tl :tl[ast][!] 最後の一致するタグにジャンプ
:ptag :pt[ag] {tag} タグ{tag}をプレビューウィンドウで表示 CTRL-W_} CTRL-W } CTRL-] と同様だが、タグをプレビューウィンドウに表示 :pts :pts[elect] ":tselect" と同様だが、タグをプレビューウィンドウに表示 :ptjump :ptj[ump] ":tjump" と同様だが、タグをプレビューウィンドウに表示 :pclose :pc[lose] タグプレビューウィンドウを閉じる CTRL-W_z CTRL-W z タグプレビューウィンドウを閉じる

Q_sc スクロール

CTRL-E N CTRL-E ウィンドウをN行下へスクロール (デフォルト: 1行) CTRL-D N CTRL-D ウィンドウをN行下へスクロール (デフォルト: ウィンドウの1/2) CTRL-F N CTRL-F ウィンドウをNページ分下へスクロール CTRL-Y N CTRL-Y ウィンドウをN行上へスクロール (デフォルト: 1行) CTRL-U N CTRL-U ウィンドウをN行上へスクロール (デフォルト: ウィンドウの1/2) CTRL-B N CTRL-B ウィンドウをNページ分上へスクロール z<CR> z<CR> または zt ウィンドウを再描画し、現在の行をウィンドウの上部に配置 z. z. または zz ウィンドウを再描画し、現在の行をウィンドウの中央に配置 z- z- または zb ウィンドウを再描画し、現在の行をウィンドウの下部に配置
以下のコマンドは、'wrap' オプションがオフの場合のみ有効です: zh N zh 画面を右にN文字スクロール zl N zl 画面を左にN文字スクロール zH N zH 画面を右に画面幅の半分スクロール zL N zL 画面を左に画面幅の半分スクロール

Q_in テキストの挿入

a N a カーソル位置の後にテキストを挿入 (N回繰り返す) A N A 行末にテキストを挿入 (N回繰り返す) i N i カーソル位置の前にテキストを挿入 (N回繰り返す) (<Insert>も同様) I N I 行の先頭の最初の空白でない文字の前にテキストを挿入 (N回繰り返す) gI N gI 1列目にテキストを挿入 (N回繰り返す) o N o 現在の行の下に新しい行を開き、テキストを挿入 (N回繰り返す) O N O 現在の行の上に新しい行を開き、テキストを挿入 (N回繰り返す) :startinsert :star[tinsert][!] インサートモードを開始、[!] を指定すると行末に追加 :startreplace :startr[eplace][!] 置換モードを開始、[!] を指定すると行末から開始
ビジュアルブロックモードの場合: v_b_I I 選択したすべての行の先頭に同じテキストを挿入 v_b_A A 選択したすべての行の末尾に同じテキストを追加

Q_ai インサートモードのキー

insert-index インサートモードコマンドのアルファベット順索引
インサートモードの終了: i_<Esc> <Esc> インサートモードを終了し、ノーマルモードに戻る i_CTRL-C CTRL-C <Esc> と同様だが、省略形を使用しない i_CTRL-O CTRL-O {command} {command} を実行し、インサートモードに戻る
カーソルの移動: i_<Up> カーソルキー カーソルを左右上下に移動 i_<S-Left> shift-left/right 一単語左/右に移動 i_<S-Up> shift-up/down 一画面分後ろ/前に移動 i_<End> <End> カーソルを行の最後の文字に移動 i_<Home> <Home> カーソルを行の先頭の文字に移動

Q_ss インサートモードの特殊キー

i_CTRL-V CTRL-V {char}.. 文字をそのまま挿入、または10進数のバイト値を入力 i_<NL> <NL> または <CR> または CTRL-M または CTRL-J 新しい行を開始 i_CTRL-E CTRL-E カーソル下の文字を挿入 i_CTRL-Y CTRL-Y カーソル上の文字を挿入
i_CTRL-A CTRL-A 前に挿入されたテキストを挿入 i_CTRL-@ CTRL-@ 前に挿入されたテキストを挿入し、インサートモードを終了 i_CTRL-R CTRL-R {register} レジスタの内容を挿入
i_CTRL-N CTRL-N カーソル位置の前に識別子の次のマッチを挿入 i_CTRL-P CTRL-P カーソル位置の前に識別子の前のマッチを挿入 i_CTRL-X CTRL-X ... カーソル位置の前にある単語を様々な方法で補完
i_<BS> <BS> または CTRL-H カーソル位置前の文字を削除 i_<Del> <Del> カーソル位置下の文字を削除 i_CTRL-W CTRL-W カーソル位置前の単語を削除 i_CTRL-U CTRL-U 現在の行に入力されたすべての文字を削除 i_CTRL-T CTRL-T 現在の行の先頭にインデントのシフト幅を1つ挿入 i_CTRL-D CTRL-D 現在の行の先頭のインデントのシフト幅を1つ削除 i_0_CTRL-D 0 CTRL-D 現在の行のすべてのインデントを削除 i_^_CTRL-D ^ CTRL-D 現在の行のすべてのインデントを削除し、次の行のインデントを復元

Q_di ディグラフ

:dig :dig[raphs] 現在のディグラフ一覧を表示 :dig :dig[raphs] {char1}{char2} {number} ... ディグラフを一覧に追加
インサートモードまたはコマンドラインモードの場合: i_CTRL-K CTRL-K {char1} {char2} ディグラフを入力 i_digraph {char1} <BS> {char2} 'digraph' オプションが設定されている場合、ディグラフを入力

Q_si 特殊挿入

:r :r [file] カーソル位置の下に[file]の内容を挿入 :r! :r! {command} カーソル位置の下に{command}の標準出力を挿入

Q_de テキストの削除

x N x カーソル位置下およびカーソル位置後のN文字を削除 <Del> N <Del> カーソル位置下およびカーソル位置後のN文字を削除 X N X カーソル位置前のN文字を削除 d N d{motion} {motion}で移動したテキストを削除 v_d {visual}d ハイライトされたテキストを削除 dd N dd N行を削除 D N D 行末までを削除 (さらにN-1行削除) J N J N-1行を結合 (<EOL>を削除) v_J {visual}J ハイライトされた行を結合 gJ N gJ "J"と同様だが、スペースを挿入しない v_gJ {visual}gJ "{visual}J"と同様だが、スペースを挿入しない :d :[range]d [x] [range]の行を削除 [レジスタxへ]

Q_cm テキストのコピーと移動

quote "{char}" 次の削除、ヤンク、またはペーストにレジスタ{char}を使用 :reg :reg 全てのレジスタの内容を表示 :reg :reg {arg} {arg}で指定されたレジスタの内容を表示 y N y{motion} {motion}で移動したテキストをレジスタにヤンク v_y {visual}y ハイライトされたテキストをレジスタにヤンク yy N yy N行をレジスタにヤンク Y N Y N行をレジスタにヤンク 注記: デフォルトでは "y$" にマップされています。 default-mappings p N p レジスタをカーソル位置の後に挿入 (N回繰り返す) P N P レジスタをカーソル位置の前に挿入 (N回繰り返す) ]p N ]p pと同様だが、現在の行のインデントに合わせる [p N [p Pと同様だが、現在の行のインデントに合わせる gp N gp pと同様だが、カーソルを新しいテキストの後に残す gP N gP Pと同様だが、カーソルを新しいテキストの後に残す

Q_ch テキストの変更

r N r{char} N文字を{char}で置き換える gr N gr{char} レイアウトを変更せずにN文字を置き換える R N R 置換モードを開始 (入力されたテキストをN回繰り返す) gR N gR 仮想置換モードを開始: レイアウトを変更せずに置換モードと同様 v_b_r {visual}r{char} ビジュアルブロックモードの場合: 選択したテキストの各文字を{char}で置き換える
(変更 = テキストを削除してインサートモードに入る) c N c{motion} {motion}で移動したテキストを変更 v_c {visual}c ハイライトされたテキストを変更 cc N cc N行を変更 S N S N行を変更 C N C 行末までを変更 (さらにN-1行を変更) s N s N文字を変更 v_b_c {visual}c ビジュアルブロックモードの場合: 選択した各行を入力されたテキストで変更 v_b_C {visual}C ビジュアルブロックモードの場合: 選択した各行を行末まで入力されたテキストで変更
~ N ~ N文字のケースを変換し、カーソルを進める v_~ {visual}~ ハイライトされたテキストのケースを変換 v_u {visual}u ハイライトされたテキストを小文字にする v_U {visual}U ハイライトされたテキストを大文字にする g~ g~{motion} {motion}で移動したテキストのケースを変換 gu gu{motion} {motion}で移動したテキストを小文字にする gU gU{motion} {motion}で移動したテキストを大文字にする v_g? {visual}g? ハイライトされたテキストにrot13エンコードを実行 g? g?{motion} {motion}で移動したテキストにrot13エンコードを実行
CTRL-A N CTRL-A カーソル位置またはカーソル位置後の数値にNを加算 CTRL-X N CTRL-X カーソル位置またはカーソル位置後の数値からNを減算
< N <{motion} {motion}で移動した行をシフト幅1つ分左に移動 << N << N行をシフト幅1つ分左に移動 > N >{motion} {motion}で移動した行をシフト幅1つ分右に移動 >> N >> N行をシフト幅1つ分右に移動 gq N gq{motion} {motion}で移動した行を'textwidth'の長さに整形 :ce :[range]ce[nter] [width] [range]内の行を中央揃えにする([width]指定可能) :le :[range]le[ft] [indent] [range]内の行を左揃えにする([indent]でインデント可能) :ri :[range]ri[ght] [width] [range]内の行を右揃えにする([width]指定可能)

Q_co 複雑な変更

! N !{motion}{command}<CR> {motion}で移動した行を{command}でフィルタリングする !! N !!{command}<CR> N行を{command}でフィルタリングする v_! {visual}!{command}<CR> ハイライトされた行を{command}でフィルタリングする :range! :[range]! {command}<CR> [range]内の行を{command}でフィルタリングする = N ={motion} {motion}で移動した行を'equalprg'でフィルタリングする == N == N行を'equalprg'でフィルタリングする v_= {visual}= ハイライトされた行を'equalprg'でフィルタリングする :s :[range]s[ubstitute]/{pattern}/{string}/[g][c] [range]内の行で{pattern}{string}に置換する;[g]で全て置換;[c]で各置換を確認する :s :[range]s[ubstitute] [g][c] 前回の":s"を新しい範囲とオプションで繰り返す & & 前回の":s"を現在の行でオプションなしで繰り返す :ret :[range]ret[ab][!] [tabstop] 'tabstop'を新しい値に設定し、空白を調整する

Q_vi Visualモード

visual-index Visualモードコマンド一覧。
v v 文字列のハイライトを開始する } カーソルを移動してV V 行単位のハイライトを開始する } オペレータを使用してCTRL-V CTRL-V ブロック単位のハイライトを開始する } ハイライトされたテキストに影響を与える v_o o ハイライトの開始位置とカーソルの位置を入れ替える gv gv 前回のVisual範囲でハイライトを開始する v_v v 文字列のハイライトまたはハイライトの終了 v_V V 行単位のハイライトまたはハイライトの終了 v_CTRL-V CTRL-V ブロック単位のハイライトまたはハイライトの終了

Q_to テキストオブジェクト(Visualモードまたはオペレータの後のみ)

v_aw N aw "単語"を選択する v_iw N iw "単語の内側"を選択する v_aW N aW "WORD"を選択する v_iW N iW "WORDの内側"を選択する v_as N as "文"を選択する v_is N is "文の内側"を選択する v_ap N ap "段落"を選択する v_ip N ip "段落の内側"を選択する v_ab N ab "ブロック"を選択する("[("から"])"まで) v_ib N ib "ブロックの内側"を選択する("[("から"])"まで) v_aB N aB "ブロック"を選択する([{から]}まで) v_iB N iB "ブロックの内側"を選択する([{から]}まで) v_a> N a> "<>ブロック"を選択する v_i> N i> "<>ブロックの内側"を選択する v_at N at "タグブロック"を選択する(<aaa>から</aaa>まで) v_it N it "タグブロックの内側"を選択する(<aaa>から</aaa>まで) v_a' N a' "シングルクォートで囲まれた文字列"を選択する v_i' N i' "シングルクォートで囲まれた文字列の内側"を選択する v_aquote N a" "ダブルクォートで囲まれた文字列"を選択する v_iquote N i" "ダブルクォートで囲まれた文字列の内側"を選択する v_a` N a` "バッククォートで囲まれた文字列"を選択する v_i` N i` "バッククォートで囲まれた文字列の内側"を選択する

Q_re コマンドの繰り返し

. N . 最後の変更を繰り返す(カウントはNに置き換えられる) q q{a-z} 入力された文字をレジスタ{a-z}に記録する q q{A-Z} 入力された文字をレジスタ{a-z}に追加して記録する q q 記録を停止する Q Q 最後に記録されたマクロを再生する @ N @{a-z} レジスタ{a-z}の内容を実行する(N回) @@ N @@ 前回の@{a-z}を繰り返す(N回) :@ :@{a-z} レジスタ{a-z}の内容をExコマンドとして実行する :@@ :@@ 前回の:@{a-z}を繰り返す :g :[range]g[lobal]/{pattern}/[cmd] [range]内で{pattern}に一致する行に対してExコマンド[cmd](デフォルトは":p")を実行する :g :[range]g[lobal]!/{pattern}/[cmd] [range]内で{pattern}に一致しない行に対してExコマンド[cmd](デフォルトは":p")を実行する :so :so[urce] {file} {file}からExコマンドを読み込む :so :so[urce]! {file} {file}からVimコマンドを読み込む :sl :sl[eep] [sec] [sec]秒間何もしない gs N gs N秒間スリープする

Q_km キーマッピング

:map :ma[p] {lhs} {rhs} 通常モードとVisualモードで{lhs}{rhs}にマップする :map! :ma[p]! {lhs} {rhs} インサートモードとコマンドラインモードで{lhs}{rhs}にマップする :noremap :no[remap][!] {lhs} {rhs} ":map"と同じ、この{rhs}は再マッピングしない :unmap :unm[ap] {lhs} 通常モードとVisualモードでの{lhs}のマッピングを削除する :unmap! :unm[ap]! {lhs} インサートモードとコマンドラインモードでの{lhs}のマッピングを削除する :map_l :ma[p] [lhs] 通常モードとVisualモードでのマッピングを一覧表示する([lhs]から始まる) :map_l! :ma[p]! [lhs] インサートモードとコマンドラインモードでのマッピングを一覧表示する([lhs]から始まる) :cmap :cmap/:cunmap/:cnoremap ":map!"/":unmap!"/":noremap!"と同じだが、コマンドラインモードのみ :imap :imap/:iunmap/:inoremap ":map!"/":unmap!"/":noremap!"と同じだが、インサートモードのみ :nmap :nmap/:nunmap/:nnoremap ":map"/":unmap"/":noremap"と同じだが、ノーマルモードのみ :vmap :vmap/:vunmap/:vnoremap ":map"/":unmap"/":noremap"と同じだが、Visualモードのみ :omap :omap/:ounmap/:onoremap ":map"/":unmap"/":noremap"と同じだが、オペレータが保留中の場合のみ :mapc :mapc[lear] 通常モードとVisualモードのマッピングを削除する :mapc :mapc[lear]! インサートモードとコマンドラインモードのマッピングを削除する :imapc :imapc[lear] インサートモードのマッピングを削除する :vmapc :vmapc[lear] Visualモードのマッピングを削除する :omapc :omapc[lear] オペレータ保留モードのマッピングを削除する :nmapc :nmapc[lear] ノーマルモードのマッピングを削除する :cmapc :cmapc[lear] コマンドラインモードのマッピングを削除する :mkexrc :mk[exrc][!] [file] 現在のマッピング、省略形、設定を[file]に書き込む(デフォルトは".exrc";!で上書き) :mkvimrc :mkv[imrc][!] [file] :mkexrcと同じだが、デフォルトは".nvimrc" :mksession :mks[ession][!] [file] :mkvimrcと同じだが、現在のファイル、ウィンドウなども保存し、後でセッションを再開できるようにする

Q_ab 省略形

:abbreviate :ab[breviate] {lhs} {rhs} {lhs}{rhs}に省略形を追加する :abbreviate :ab[breviate] {lhs} {lhs}から始まる省略形を表示する :abbreviate :ab[breviate] 全ての省略形を表示する :unabbreviate :una[bbreviate] {lhs} {lhs}の省略形を削除する :noreabbrev :norea[bbrev] [lhs] [rhs] ":ab"と同じだが、[rhs]は再マッピングしない :iabbrev :iab/:iunab/:inoreab ":ab"と同じだが、インサートモードのみ :cabbrev :cab/:cunab/:cnoreab ":ab"と同じだが、コマンドラインモードのみ :abclear :abc[lear] 全ての省略形を削除する :cabclear :cabc[lear] コマンドラインモードの省略形を全て削除する :iabclear :iabc[lear] インサートモードの省略形を全て削除する

Q_op オプション

:set :se[t] 変更されたオプションを全て表示する :set :se[t] all 全てのオプションを表示する :set :se[t] {option} ブールオプションを設定する(オンにする)、文字列または数値オプションを表示する :set :se[t] no{option} ブールオプションをリセットする(オフにする) :set :se[t] inv{option} ブールオプションを反転する :set :se[t] {option}={value} 文字列/数値オプションを{value}に設定する :set :se[t] {option}+={value} 文字列オプションに{value}を追加する、数値オプションに{value}を加算する :set :se[t] {option}-={value} 文字列オプションから{value}を削除する、数値オプションから{value}を減算する :set :se[t] {option} {option}の値を表示する :set :se[t] {option}& {option}をデフォルト値にリセットする
:setlocal :setl[ocal] ":set"と同じだが、ローカル値を持つオプションに対してローカル値を設定する :setglobal :setg[lobal] ":set"と同じだが、ローカルオプションのグローバル値を設定する
:options :opt[ions] 新しいウィンドウを開いて、機能別にグループ化されたオプションを表示および設定する。一行の説明とヘルプへのリンクがある。
各オプションの簡単な説明: option-list
'allowrevins' 'ari' allow CTRL-_ in Insert mode 'ambiwidth' 'ambw' what to do with Unicode chars of ambiguous width 'arabic' 'arab' for Arabic as a default second language 'arabicshape' 'arshape' do shaping for Arabic characters 'autochdir' 'acd' change directory to the file in the current window 'autoindent' 'ai' take indent for new line from previous line 'autoread' 'ar' autom. read file when changed outside of Vim 'autowrite' 'aw' automatically write file if changed 'autowriteall' 'awa' as 'autowrite', but works with more commands 'background' 'bg' "dark" or "light", used for highlight colors 'backspace' 'bs' how backspace works at start of line 'backup' 'bk' keep backup file after overwriting a file 'backupcopy' 'bkc' make backup as a copy, don't rename the file 'backupdir' 'bdir' list of directories for the backup file 'backupext' 'bex' extension used for the backup file 'backupskip' 'bsk' no backup for files that match these patterns 'belloff' 'bo' do not ring the bell for these reasons 'binary' 'bin' read/write/edit file in binary mode 'bomb' prepend a Byte Order Mark to the file 'breakat' 'brk' characters that may cause a line break 'breakindent' 'bri' wrapped line repeats indent 'breakindentopt' 'briopt' settings for 'breakindent' 'browsedir' 'bsdir' which directory to start browsing in 'bufhidden' 'bh' what to do when buffer is no longer in window 'buflisted' 'bl' whether the buffer shows up in the buffer list 'buftype' 'bt' special type of buffer 'casemap' 'cmp' specifies how case of letters is changed 'cdhome' 'cdh' change directory to the home directory by ":cd" 'cdpath' 'cd' list of directories searched with ":cd" 'cedit' key used to open the command-line window 'charconvert' 'ccv' expression for character encoding conversion 'cindent' 'cin' do C program indenting 'cinkeys' 'cink' keys that trigger indent when 'cindent' is set 'cinoptions' 'cino' how to do indenting when 'cindent' is set 'cinscopedecls' 'cinsd' words that are recognized by 'cino-g' 'cinwords' 'cinw' words where 'si' and 'cin' add an indent 'clipboard' 'cb' use the clipboard as the unnamed register 'cmdheight' 'ch' number of lines to use for the command-line 'cmdwinheight' 'cwh' height of the command-line window 'colorcolumn' 'cc' columns to highlight 'columns' 'co' number of columns in the display 'comments' 'com' patterns that can start a comment line 'commentstring' 'cms' template for comments; used for fold marker 'complete' 'cpt' specify how Insert mode completion works 'completefunc' 'cfu' function to be used for Insert mode completion 'completeopt' 'cot' options for Insert mode completion 'completeslash' 'csl' like 'shellslash' for completion 'concealcursor' 'cocu' whether concealable text is hidden in cursor line 'conceallevel' 'cole' whether concealable text is shown or hidden 'confirm' 'cf' ask what to do about unsaved/read-only files 'copyindent' 'ci' make 'autoindent' use existing indent structure 'cpoptions' 'cpo' flags for Vi-compatible behavior 'cursorbind' 'crb' move cursor in window as it moves in other windows 'cursorcolumn' 'cuc' highlight the screen column of the cursor 'cursorline' 'cul' highlight the screen line of the cursor 'cursorlineopt' 'culopt' settings for 'cursorline' 'debug' set to "msg" to see all error messages 'define' 'def' pattern to be used to find a macro definition 'delcombine' 'deco' delete combining characters on their own 'dictionary' 'dict' list of file names used for keyword completion 'diff' use diff mode for the current window 'diffexpr' 'dex' expression used to obtain a diff file 'diffopt' 'dip' options for using diff mode 'digraph' 'dg' enable the entering of digraphs in Insert mode 'directory' 'dir' list of directory names for the swap file 'display' 'dy' list of flags for how to display text 'eadirection' 'ead' in which direction 'equalalways' works 'encoding' 'enc' encoding used internally 'endoffile' 'eof' write CTRL-Z at end of the file 'endofline' 'eol' write <EOL> for last line in file 'equalalways' 'ea' windows are automatically made the same size 'equalprg' 'ep' external program to use for "=" command 'errorbells' 'eb' ring the bell for error messages 'errorfile' 'ef' name of the errorfile for the QuickFix mode 'errorformat' 'efm' description of the lines in the error file 'eventignore' 'ei' autocommand events that are ignored 'expandtab' 'et' use spaces when <Tab> is inserted 'exrc' 'ex' read init files in the current directory 'fileencoding' 'fenc' file encoding for multibyte text 'fileencodings' 'fencs' automatically detected character encodings 'fileformat' 'ff' file format used for file I/O 'fileformats' 'ffs' automatically detected values for 'fileformat' 'fileignorecase' 'fic' ignore case when using file names 'filetype' 'ft' type of file, used for autocommands 'fillchars' 'fcs' characters to use for displaying special items 'findfunc' 'ffu' function to be called for the :find command 'fixendofline' 'fixeol' make sure last line in file has <EOL> 'foldclose' 'fcl' close a fold when the cursor leaves it 'foldcolumn' 'fdc' width of the column used to indicate folds 'foldenable' 'fen' set to display all folds open 'foldexpr' 'fde' expression used when 'foldmethod' is "expr" 'foldignore' 'fdi' ignore lines when 'foldmethod' is "indent" 'foldlevel' 'fdl' close folds with a level higher than this 'foldlevelstart' 'fdls' 'foldlevel' when starting to edit a file 'foldmarker' 'fmr' markers used when 'foldmethod' is "marker" 'foldmethod' 'fdm' folding type 'foldminlines' 'fml' minimum number of lines for a fold to be closed 'foldnestmax' 'fdn' maximum fold depth 'foldopen' 'fdo' for which commands a fold will be opened 'foldtext' 'fdt' expression used to display for a closed fold 'formatexpr' 'fex' expression used with "gq" command 'formatlistpat' 'flp' pattern used to recognize a list header 'formatoptions' 'fo' how automatic formatting is to be done 'formatprg' 'fp' name of external program used with "gq" command 'fsync' 'fs' whether to invoke fsync() after file write 'gdefault' 'gd' the ":substitute" flag 'g' is default on 'grepformat' 'gfm' format of 'grepprg' output 'grepprg' 'gp' program to use for ":grep" 'guicursor' 'gcr' GUI: settings for cursor shape and blinking 'guifont' 'gfn' GUI: Name(s) of font(s) to be used 'guifontwide' 'gfw' list of font names for double-wide characters 'guioptions' 'go' GUI: Which components and options are used 'guitablabel' 'gtl' GUI: custom label for a tab page 'guitabtooltip' 'gtt' GUI: custom tooltip for a tab page 'helpfile' 'hf' full path name of the main help file 'helpheight' 'hh' minimum height of a new help window 'helplang' 'hlg' preferred help languages 'hidden' 'hid' don't unload buffer when it is abandoned 'history' 'hi' number of command-lines that are remembered 'hlsearch' 'hls' highlight matches with last search pattern 'icon' let Vim set the text of the window icon 'iconstring' string to use for the Vim icon text 'ignorecase' 'ic' ignore case in search patterns 'imcmdline' 'imc' use IM when starting to edit a command line 'imdisable' 'imd' do not use the IM in any mode 'iminsert' 'imi' use :lmap or IM in Insert mode 'imsearch' 'ims' use :lmap or IM when typing a search pattern 'include' 'inc' pattern to be used to find an include file 'includeexpr' 'inex' expression used to process an include line 'incsearch' 'is' highlight match while typing search pattern 'indentexpr' 'inde' expression used to obtain the indent of a line 'indentkeys' 'indk' keys that trigger indenting with 'indentexpr' 'infercase' 'inf' adjust case of match for keyword completion 'isfname' 'isf' characters included in file names and pathnames 'isident' 'isi' characters included in identifiers 'iskeyword' 'isk' characters included in keywords 'isprint' 'isp' printable characters 'joinspaces' 'js' two spaces after a period with a join command 'jumpoptions' 'jop' specifies how jumping is done 'keymap' 'kmp' name of a keyboard mapping 'keymodel' 'km' enable starting/stopping selection with keys 'keywordprg' 'kp' program to use for the "K" command 'langmap' 'lmap' alphabetic characters for other language mode 'langmenu' 'lm' language to be used for the menus 'langremap' 'lrm' do apply 'langmap' to mapped characters 'laststatus' 'ls' tells when last window has status lines 'lazyredraw' 'lz' don't redraw while executing macros 'linebreak' 'lbr' wrap long lines at a blank 'lines' number of lines in the display 'linespace' 'lsp' number of pixel lines to use between characters 'lisp' automatic indenting for Lisp 'lispoptions' 'lop' changes how Lisp indenting is done 'lispwords' 'lw' words that change how lisp indenting works 'list' show <Tab> and <EOL> 'listchars' 'lcs' characters for displaying in list mode 'loadplugins' 'lpl' load plugin scripts when starting up 'magic' changes special characters in search patterns 'makeef' 'mef' name of the errorfile for ":make" 'makeencoding' 'menc' encoding of external make/grep commands 'makeprg' 'mp' program to use for the ":make" command 'matchpairs' 'mps' pairs of characters that "%" can match 'matchtime' 'mat' tenths of a second to show matching paren 'maxcombine' 'mco' maximum nr of combining characters displayed 'maxfuncdepth' 'mfd' maximum recursive depth for user functions 'maxmapdepth' 'mmd' maximum recursive depth for mapping 'maxmempattern' 'mmp' maximum memory (in Kbyte) used for pattern search 'menuitems' 'mis' maximum number of items in a menu 'mkspellmem' 'msm' memory used before :mkspell compresses the tree 'modeline' 'ml' recognize modelines at start or end of file 'modelineexpr' 'mle' allow setting expression options from a modeline 'modelines' 'mls' number of lines checked for modelines 'modifiable' 'ma' changes to the text are not possible 'modified' 'mod' buffer has been modified 'more' pause listings when the whole screen is filled 'mouse' enable the use of mouse clicks 'mousefocus' 'mousef' keyboard focus follows the mouse 'mousehide' 'mh' hide mouse pointer while typing 'mousemodel' 'mousem' changes meaning of mouse buttons 'mousemoveevent' 'mousemev' report mouse moves with <MouseMove> 'mousescroll' amount to scroll by when scrolling with a mouse 'mouseshape' 'mouses' shape of the mouse pointer in different modes 'mousetime' 'mouset' max time between mouse double-click 'nrformats' 'nf' number formats recognized for CTRL-A command 'number' 'nu' print the line number in front of each line 'numberwidth' 'nuw' number of columns used for the line number 'omnifunc' 'ofu' function for filetype-specific completion 'opendevice' 'odev' allow reading/writing devices on MS-Windows 'operatorfunc' 'opfunc' function to be called for g@ operator 'packpath' 'pp' list of directories used for packages 'paragraphs' 'para' nroff macros that separate paragraphs 'patchexpr' 'pex' expression used to patch a file 'patchmode' 'pm' keep the oldest version of a file 'path' 'pa' list of directories searched with "gf" et.al. 'preserveindent' 'pi' preserve the indent structure when reindenting 'previewheight' 'pvh' height of the preview window 'previewwindow' 'pvw' identifies the preview window 'pumheight' 'ph' maximum number of items to show in the popup menu 'pumwidth' 'pw' minimum width of the popup menu 'pyxversion' 'pyx' Python version used for pyx* commands 'quoteescape' 'qe' escape characters used in a string 'readonly' 'ro' disallow writing the buffer 'redrawtime' 'rdt' timeout for 'hlsearch' and :match highlighting 'regexpengine' 're' default regexp engine to use 'relativenumber' 'rnu' show relative line number in front of each line 'report' threshold for reporting nr. of lines changed 'revins' 'ri' inserting characters will work backwards 'rightleft' 'rl' window is right-to-left oriented 'rightleftcmd' 'rlc' commands for which editing works right-to-left 'ruler' 'ru' show cursor line and column in the status line 'rulerformat' 'ruf' custom format for the ruler 'runtimepath' 'rtp' list of directories used for runtime files 'scroll' 'scr' lines to scroll with CTRL-U and CTRL-D 'scrollbind' 'scb' scroll in window as other windows scroll 'scrolljump' 'sj' minimum number of lines to scroll 'scrolloff' 'so' minimum nr. of lines above and below cursor 'scrollopt' 'sbo' how 'scrollbind' should behave 'sections' 'sect' nroff macros that separate sections 'secure' secure mode for reading .vimrc in current dir 'selection' 'sel' what type of selection to use 'selectmode' 'slm' when to use Select mode instead of Visual mode 'sessionoptions' 'ssop' options for :mksession 'shada' 'sd' use .shada file upon startup and exiting 'shell' 'sh' name of shell to use for external commands 'shellcmdflag' 'shcf' flag to shell to execute one command 'shellpipe' 'sp' string to put output of ":make" in error file 'shellquote' 'shq' quote character(s) for around shell command 'shellredir' 'srr' string to put output of filter in a temp file 'shellslash' 'ssl' use forward slash for shell file names 'shelltemp' 'stmp' whether to use a temp file for shell commands 'shellxescape' 'sxe' characters to escape when 'shellxquote' is ( 'shellxquote' 'sxq' like 'shellquote', but include redirection 'shiftround' 'sr' round indent to multiple of shiftwidth 'shiftwidth' 'sw' number of spaces to use for (auto)indent step 'shortmess' 'shm' list of flags, reduce length of messages 'showbreak' 'sbr' string to use at the start of wrapped lines 'showcmd' 'sc' show (partial) command somewhere 'showcmdloc' 'sloc' where to show (partial) command 'showfulltag' 'sft' show full tag pattern when completing tag 'showmatch' 'sm' briefly jump to matching bracket if insert one 'showmode' 'smd' message on status line to show current mode 'showtabline' 'stal' tells when the tab pages line is displayed 'sidescroll' 'ss' minimum number of columns to scroll horizontal 'sidescrolloff' 'siso' min. nr. of columns to left and right of cursor 'signcolumn' 'scl' when and how to display the sign column 'smartcase' 'scs' no ignore case when pattern has uppercase 'smartindent' 'si' smart autoindenting for C programs 'smarttab' 'sta' use 'shiftwidth' when inserting <Tab> 'smoothscroll' 'sms' scroll by screen lines when 'wrap' is set 'softtabstop' 'sts' number of spaces that <Tab> uses while editing 'spell' enable spell checking 'spellcapcheck' 'spc' pattern to locate end of a sentence 'spellfile' 'spf' files where zg and zw store words 'spelllang' 'spl' language(s) to do spell checking for 'spelloptions' 'spo' options for spell checking 'spellsuggest' 'sps' method(s) used to suggest spelling corrections 'splitbelow' 'sb' new window from split is below the current one 'splitkeep' 'spk' determines scroll behavior for split windows 'splitright' 'spr' new window is put right of the current one 'startofline' 'sol' commands move cursor to first non-blank in line 'statuscolumn' 'stc' custom format for the status column 'statusline' 'stl' custom format for the status line 'suffixes' 'su' suffixes that are ignored with multiple match 'suffixesadd' 'sua' suffixes added when searching for a file 'swapfile' 'swf' whether to use a swapfile for a buffer 'switchbuf' 'swb' sets behavior when switching to another buffer 'synmaxcol' 'smc' maximum column to find syntax items 'syntax' 'syn' syntax to be loaded for current buffer 'tabclose' 'tcl' which tab page to focus when closing a tab 'tabline' 'tal' custom format for the console tab pages line 'tabpagemax' 'tpm' maximum number of tab pages for -p and "tab all" 'tabstop' 'ts' number of spaces that <Tab> in file uses 'tagbsearch' 'tbs' use binary searching in tags files 'tagcase' 'tc' how to handle case when searching in tags files 'tagfunc' 'tfu' function to get list of tag matches 'taglength' 'tl' number of significant characters for a tag 'tagrelative' 'tr' file names in tag file are relative 'tags' 'tag' list of file names used by the tag command 'tagstack' 'tgst' push tags onto the tag stack 'term' name of the terminal 'termbidi' 'tbidi' terminal takes care of bi-directionality 'termguicolors' 'tgc' enable 24-bit RGB color in the TUI 'textwidth' 'tw' maximum width of text that is being inserted 'thesaurus' 'tsr' list of thesaurus files for keyword completion 'thesaurusfunc' 'tsrfu' function to be used for thesaurus completion 'tildeop' 'top' tilde command "~" behaves like an operator 'timeout' 'to' time out on mappings and key codes 'timeoutlen' 'tm' time out time in milliseconds 'title' let Vim set the title of the window 'titlelen' percentage of 'columns' used for window title 'titleold' old title, restored when exiting 'titlestring' string to use for the Vim window title 'ttimeout' time out on mappings 'ttimeoutlen' 'ttm' time out time for key codes in milliseconds 'ttytype' 'tty' alias for 'term' 'undodir' 'udir' where to store undo files 'undofile' 'udf' save undo information in a file 'undolevels' 'ul' maximum number of changes that can be undone 'undoreload' 'ur' max nr of lines to save for undo on a buffer reload 'updatecount' 'uc' after this many characters flush swap file 'updatetime' 'ut' after this many milliseconds flush swap file 'varsofttabstop' 'vsts' a list of number of spaces when typing <Tab> 'vartabstop' 'vts' a list of number of spaces for <Tab>s 'verbose' 'vbs' give informative messages 'verbosefile' 'vfile' file to write messages in 'viewdir' 'vdir' directory where to store files with :mkview 'viewoptions' 'vop' specifies what to save for :mkview 'virtualedit' 've' when to use virtual editing 'visualbell' 'vb' use visual bell instead of beeping 'warn' warn for shell command when buffer was changed 'whichwrap' 'ww' allow specified keys to cross line boundaries 'wildchar' 'wc' command-line character for wildcard expansion 'wildcharm' 'wcm' like 'wildchar' but also works when mapped 'wildignore' 'wig' files matching these patterns are not completed 'wildignorecase' 'wic' ignore case when completing file names 'wildmenu' 'wmnu' use menu for command line completion 'wildmode' 'wim' mode for 'wildchar' command-line expansion 'wildoptions' 'wop' specifies how command line completion is done 'winaltkeys' 'wak' when the windows system handles ALT keys 'window' 'wi' nr of lines to scroll for CTRL-F and CTRL-B 'winfixbuf' 'wfb' keep window focused on a single buffer 'winfixheight' 'wfh' keep window height when opening/closing windows 'winfixwidth' 'wfw' keep window width when opening/closing windows 'winheight' 'wh' minimum number of lines for the current window 'winhighlight' 'winhl' window-local highlighting 'winminheight' 'wmh' minimum number of lines for any window 'winminwidth' 'wmw' minimal number of columns for any window 'winwidth' 'wiw' minimal number of columns for current window 'wrap' long lines wrap and continue on the next line 'wrapmargin' 'wm' chars from the right where wrapping starts 'wrapscan' 'ws' searches wrap around the end of the file 'write' writing to a file is allowed 'writeany' 'wa' write to file with no need for "!" override 'writebackup' 'wb' make a backup before overwriting a file 'writedelay' 'wd' delay this many msec for each char (for debug)

Q_ur Undo/Redoコマンド

u N u 最後のN個の変更を元に戻す CTRL-R N CTRL-R 最後に元に戻したN個の変更をやり直す U U 最後に変更した行を復元する

Q_et 外部コマンド

:! :!{command} シェルで{command}を実行する K カーソル下のキーワードを'keywordprg'プログラム(デフォルト:"man")で検索する

Q_qf クイックフィックスコマンド

:cc :cc [nr] エラー[nr]を表示する(デフォルトは同じエラーを再度表示) :cnext :cn 次のエラーを表示する :cprevious :cp 前のエラーを表示する :clist :cl 全てのエラーをリスト表示する :cfile :cf ファイル'errorfile'からエラーを読み込む :cgetbuffer :cgetb :cbufferと同様だが、最初のエラーにジャンプしない :cgetfile :cg :cfileと同様だが、最初のエラーにジャンプしない :cgetexpr :cgete :cexprと同様だが、最初のエラーにジャンプしない :caddfile :caddf エラーファイルから現在のクイックフィックスリストにエラーを追加する :caddexpr :cad 式から現在のクイックフィックスリストにエラーを追加する :cbuffer :cb バッファ内のテキストからエラーを読み込む :cexpr :cex 式からエラーを読み込む :cquit :cq 書き込みせずに終了し、エラーコードを(コンパイラに)返す :make :make [args] makeを実行し、エラーを読み込み、最初のエラーにジャンプする :grep :gr[ep] [args] 'grepprg'を実行して一致する部分を検索し、最初の箇所にジャンプする

Q_vc 各種コマンド

CTRL-L CTRL-L 画面をクリアして再描画する CTRL-G CTRL-G 現在のファイル名(パス付き)とカーソル位置を表示する ga ga カーソル下の文字のASCII値を10進数、16進数、8進数で表示する g8 g8 UTF-8エンコーディングの場合:カーソル下の文字のバイト列を16進数で表示する g_CTRL-G g CTRL-G カーソルの列、行、文字の位置を表示する CTRL-C CTRL-C 検索中:検索を中断する <Del> <Del> カウントを入力中:最後の文字を削除する :version :ve[rsion] バージョン情報を表示する :normal :norm[al][!] {commands} 通常モードコマンドを実行する gQ gQ "Ex"モードに切り替える
:redir :redir >{file} メッセージを{file}にリダイレクトする :silent :silent[!] {command} {command}をサイレントに実行する :confirm :confirm {command} 未保存の変更や読み取り専用ファイルについて確認して終了、書き込みなどを行う :browse :browse {command} ファイル選択ダイアログを使用してファイルを開く/読み込む/書き込む

Q_ce コマンドライン編集

c_<Esc> <Esc> コマンドラインを放棄する('wildchar'<Esc>の場合、2回入力する)
c_CTRL-V CTRL-V {char} {char}を文字通り挿入する c_CTRL-V CTRL-V {number} 文字の10進数値を入力する(最大3桁) c_CTRL-K CTRL-K {char1} {char2} ダイグラフを入力する(Q_diを参照) c_CTRL-R CTRL-R {register} レジスタの内容を挿入する
c_<Left> <Left>/<Right> カーソルを左/右に移動する c_<S-Left> <S-Left>/<S-Right> カーソルを1単語左/右に移動する c_CTRL-B CTRL-B/CTRL-E カーソルをコマンドラインの先頭/末尾に移動する
c_<BS> <BS> カーソルの前の文字を削除する c_<Del> <Del> カーソル下の文字を削除する c_CTRL-W CTRL-W カーソルの前の単語を削除する c_CTRL-U CTRL-U 全ての文字を削除する
c_<Up> <Up>/<Down> 現在のコマンドで始まる古い/新しいコマンドラインを呼び出す c_<S-Up> <S-Up>/<S-Down> ヒストリーから古い/新しいコマンドラインを呼び出す c_CTRL-G CTRL-G 'incsearch'が有効な場合、次のマッチに移動する c_CTRL-T CTRL-T 'incsearch'が有効な場合、前のマッチに移動する :history :his[tory] 古いコマンドラインを表示する
コマンドラインでのコンテキスト依存補完
c_wildchar 'wildchar'(デフォルト:<Tab>) カーソルの前のパターンで補完を実行する。複数のマッチがある場合、ビープ音を鳴らし、最初のものを表示する。'wildchar'をさらに押すと、次のマッチが表示される c_CTRL-D CTRL-D カーソルの前のパターンにマッチする全ての名前をリスト表示する c_CTRL-A CTRL-A カーソルの前のパターンにマッチする全ての名前を挿入する c_CTRL-L CTRL-L パターンにマッチする名前の最長の共通部分を挿入する c_CTRL-N CTRL-N 'wildchar'の後で複数のマッチがある場合:次のマッチに移動する c_CTRL-P CTRL-P 'wildchar'の後で複数のマッチがある場合:前のマッチに移動する

Q_ra Ex範囲

:range , 2つの行番号を区切る :range ; 同様、2番目の行番号を解釈する前にカーソルを最初の行番号に設定する
:range {number} 絶対行番号 :range . 現在の行 :range $ ファイルの最後の行 :range % 1,$と等しい(ファイル全体) :range * '<,'>と等しい(ビジュアル領域) :range 't マークtの位置 :range /{pattern}[/] {pattern}にマッチする次の行 :range ?{pattern}[?] {pattern}にマッチする前の行
:range +[num] 前の行番号に[num]を追加する(デフォルト:1) :range -[num] 前の行番号から[num]を減算する(デフォルト:1)

Q_ex 特殊なEx文字

:bar | 2つのコマンドを区切る(":global"と":!"には使用しない) :quote " コメントを開始する
:_% % 現在のファイル名(ファイル名が期待される場所のみ) :_# #[num] 代替ファイル名[num](ファイル名が期待される場所のみ) 注意:次の7つは文字通り入力する。これらは特別なキーではない! :<abuf> <abuf> バッファ番号、autocommandで使用(ファイル名が期待される場所のみ) :<afile> <afile> ファイル名、autocommandで使用(ファイル名が期待される場所のみ) :<amatch> <amatch> パターンにマッチした内容、autocommandで使用(ファイル名が期待される場所のみ) :<cword> <cword> カーソル下の単語(ファイル名が期待される場所のみ) :<cWORD> <cWORD> カーソル下のWORD(ファイル名が期待される場所のみ)(WORDを参照) :<cfile> <cfile> カーソル下のファイル名(ファイル名が期待される場所のみ) :<sfile> <sfile> ":source"されたファイルのファイル名、そのファイル内(ファイル名が期待される場所のみ)
"%"、"#"、"<cfile>"、"<sfile>"、または"<afile>"の後 ::p :p 完全パス ::h :h 先頭(ファイル名を除去) ::t :t 末尾(ファイル名のみ) ::r :r ルート(拡張子を除去) ::e :e 拡張子 ::s :s/{pat}/{repl}/ {pat}{repl}に置換する

Q_st Vimの起動

-file vim [options] {file} .. 1つ以上のファイルの編集を開始する -- vim [options] - 標準入力からファイルを読み込む -tag vim [options] -t {tag} {tag}に関連付けられたファイルの編集を開始する -qf vim [options] -q [fname] クイックフィックスモードで編集を開始し、最初のエラーを表示する
最も有用なVim引数(完全なリストについてはstartup-optionsを参照)
-+ +[num] カーソルを行[num]に置く(デフォルト:最後の行) -+c +{command} ファイルの読み込み後に{command}を実行する -+/ +/{pat} {file} .. カーソルを{pat}の最初の出現箇所に置く -e -e Exモード、VimをExモードで起動する -R -R 読み取り専用モード、-nを意味する -m -m 変更を許可しない('write'オプションをリセットする) -d -d diff-mode -b -b バイナリモード -l -l Lispモード -A -A アラビアモード('arabic'が設定される) -H -H ヘブライモード(ヘブライキーマップと'rightleft'が設定される) -V -V 詳細、情報メッセージを表示する -r -r スワップファイルのリストを表示する -r -r {file} .. 中断された編集セッションを復元する -n -n スワップファイルを作成しない -o -o [num] [num]個のウィンドウを開く(デフォルト:ファイルごとに1つ) -s -s {scriptin} まず、ファイル{scriptin}からコマンドを読み込む -w -w {scriptout} 入力した文字をファイル{scriptout}に書き込む(追加) -W -W {scriptout} 入力した文字をファイル{scriptout}に書き込む(上書き) -u -u {vimrc} その他のinitの代わりに{vimrc}からinitを読み込む -i -i {shada} その他のファイルの代わりに{shada}から情報を読み込む --- -- オプションの終了、他の引数はファイル名 --help --help 引数のリストを表示して終了する --version --version バージョン情報を表示して終了する -- - 標準入力からファイルを読み込む

Q_ed ファイルの編集

!: なし: 現在のバッファに変更があった場合、失敗します。!: あり: 現在のバッファへの変更を破棄します。 :edit_f :e[dit][!] {file} {file} を編集 :edit :e[dit][!] 現在のファイルをリロード :enew :ene[w][!] 新しい名前のないバッファを編集 :find :fin[d][!] {file} 'path' 内で {file} を検索して編集
CTRL-^ N CTRL-^ 別のファイル N を編集(":e #N" と同等) gf gf または ]f カーソル下のファイル名を編集 :pwd :pwd 現在のディレクトリ名を出力 :cd :cd [path] 現在のディレクトリを [path] に変更 :cd- :cd - 前の現在のディレクトリに戻る :file :f[ile] 現在のファイル名とカーソルの位置を出力 :file :f[ile] {name} 現在のファイル名を {name} に設定 :files :files 別のファイル名を表示

Q_fl 引数リストの使用 argument-list

:args :ar[gs] 引数リストを出力し、現在のファイルは "[]" で囲む :all :all または :sall 引数リスト内のすべてのファイルに対してウィンドウを開く :wn :wn[ext][!] ファイルを書き込み、次のファイルを編集 :wn :wn[ext][!] {file} {file} に書き込み、次のファイルを編集します。{file} が存在する場合は編集しません。!: あり: 既存のファイルを上書きします。 :wN :wN[ext][!] [file] ファイルを書き込み、前のファイルを編集
現在のウィンドウで 新しいウィンドウで
:argument :argu[ment] N :sar[gument] N ファイル N を編集 :next :n[ext] :sn[ext] 次のファイルを編集 :next_f :n[ext] {arglist} :sn[ext] {arglist} 新しい引数リストを定義し、最初のファイルを編集 :Next :N[ext] :sN[ext] 前のファイルを編集 :first :fir[st] :sfir[st] 最初のファイルを編集 :last :la[st] :sla[st] 最後のファイルを編集

Q_wq 書き込みと終了

:w :[range]w[rite][!] 現在のファイルに書き込む :w_f :[range]w[rite] {file} {file} に書き込みます。既に存在する場合は書き込みません。 :w_f :[range]w[rite]! {file} {file} に書き込みます。既存のファイルを上書きします。 :w_a :[range]w[rite][!] >> 現在のファイルに追加 :w_a :[range]w[rite][!] >> {file} {file} に追加 :w_c :[range]w[rite] !{cmd} [range] 行を標準入力として {cmd} を実行 :up :[range]up[date][!] 変更があった場合、現在のファイルに書き込む :wall :wa[ll][!] 変更されたすべてのバッファを書き込む
:q :q[uit] 変更がない場合、現在のバッファを終了します。他の非ヘルプバッファがない場合はVimを終了します。 :q :q[uit]! 常に現在のバッファを終了し、変更を破棄します。他の非ヘルプバッファがない場合はVimを終了します。 :qa :qa[ll] 変更がない場合、Vimを終了します。 :qa :qa[ll]! 常にVimを終了し、変更を破棄します。 :cq :cq 書き込みを行わずに終了し、エラーコードを返します。
:wq :wq[!] 現在のファイルを書き込み、終了します。 :wq :wq[!] {file} {file} に書き込み、終了します。 :xit :x[it][!] [file] ":wq" と同様ですが、変更があった場合のみ書き込みます。 ZZ ZZ ":x" と同じ ZQ ZQ ":q!" と同じ :xall :xa[ll][!] または :wqall[!] 変更されたすべてのバッファを書き込み、終了します。
:stop :st[op][!] Vimを中断するか、新しいシェルを起動します。'aw' オプションが設定されていて、[!] が指定されていない場合、バッファを書き込みます。 CTRL-Z CTRL-Z ":stop" と同じ

Q_ac 自動コマンド

shada-file 起動時にレジスタ、マーク、履歴を読み込み、終了時に保存します。
:rshada :rsh[ada] [file] ShaDaファイル[file]から情報を読み込む :rshada :rsh[ada]! [file] 同上、既存の情報を上書き :wshada :wsh[ada] [file] ShaDaファイル[file]に情報を追加 :wshada :wsh[ada]! [file] ShaDaファイル[file]に情報を書き込む
modeline ファイルを編集するときの自動オプション設定
modeline vim:{set-arg}: .. ファイルの先頭行と最終行に('ml' オプションを参照)、{set-arg} が ":set" の引数として指定されます。
autocommand 特定のイベントでコマンドを自動的に実行します。
:autocmd :au すべてのautoコマンドを表示 :autocmd :au {event} {event} のすべてのautoコマンドを表示 :autocmd :au {event} {pat} {pat} を含む {event} のすべてのautoコマンドを表示 :autocmd :au {event} {pat} {cmd} {pat} を含む {event} の新しいautoコマンドを入力 :autocmd :au! すべてのautoコマンドを削除 :autocmd :au! {event} {event} のすべてのautoコマンドを削除 :autocmd :au! * {pat} {pat} のすべてのautoコマンドを削除 :autocmd :au! {event} {pat} {pat} を含む {event} のすべてのautoコマンドを削除 :autocmd :au! {event} {pat} {cmd} {pat} を含む {event} のすべてのautoコマンドを削除し、新しいコマンドを入力

Q_wi マルチウィンドウコマンド

CTRL-W_s CTRL-W s または :split ウィンドウを2つに分割 :split_f :split {file} ウィンドウを分割し、一方に {file} を編集 :vsplit :vsplit {file} 同上、ただし垂直に分割 :vertical :vertical {cmd} {cmd} を垂直に分割する
:sfind :sf[ind] {file} ウィンドウを分割し、'path' 内で {file} を検索して編集 :terminal :terminal {cmd} ターミナルウィンドウを開く CTRL-W_] CTRL-W ] ウィンドウを分割し、カーソル下のタグに移動 CTRL-W_f CTRL-W f ウィンドウを分割し、カーソル下のファイル名を編集 CTRL-W_^ CTRL-W ^ ウィンドウを分割し、別のファイルを編集 CTRL-W_n CTRL-W n または :new 新しい空のウィンドウを作成 CTRL-W_q CTRL-W q または :q[uit] 編集を終了し、ウィンドウを閉じる CTRL-W_c CTRL-W c または :clo[se] バッファを非表示にし、ウィンドウを閉じる CTRL-W_o CTRL-W o または :on[ly] 現在のウィンドウを画面上の唯一のウィンドウにする
CTRL-W_j CTRL-W j カーソルを下のウィンドウに移動 CTRL-W_k CTRL-W k カーソルを上のウィンドウに移動 CTRL-W_CTRL-W CTRL-W CTRL-W カーソルを下のウィンドウに移動(折り返し) CTRL-W_W CTRL-W W カーソルを上のウィンドウに移動(折り返し) CTRL-W_t CTRL-W t カーソルを一番上のウィンドウに移動 CTRL-W_b CTRL-W b カーソルを一番下のウィンドウに移動 CTRL-W_p CTRL-W p カーソルを前にアクティブだったウィンドウに移動
CTRL-W_r CTRL-W r ウィンドウを下方向に回転 CTRL-W_R CTRL-W R ウィンドウを上方向に回転 CTRL-W_x CTRL-W x 現在のウィンドウと次のウィンドウを交換
CTRL-W_= CTRL-W = すべてのウィンドウの高さと幅を同じにする CTRL-W_- CTRL-W - 現在のウィンドウの高さを小さくする CTRL-W_+ CTRL-W + 現在のウィンドウの高さを大きくする CTRL-W__ CTRL-W _ 現在のウィンドウの高さを設定(デフォルト:非常に高い)
CTRL-W_< CTRL-W < 現在のウィンドウの幅を小さくする CTRL-W_> CTRL-W > 現在のウィンドウの幅を大きくする CTRL-W_bar CTRL-W | 現在のウィンドウの幅を設定(デフォルト:可能な限り広い)

Q_bu バッファリストコマンド

:buffers :buffers または :files すべての既知のバッファとファイル名を表示
:ball :ball または :sball すべての引数/バッファを編集 :unhide :unhide または :sunhide ロード済みのすべてのバッファを編集
:badd :badd {fname} ファイル名 {fname} をリストに追加 :bunload :bunload[!] [N] バッファ[N]をメモリからアンロード :bdelete :bdelete[!] [N] バッファ[N]をアンロードし、バッファリストから削除
現在のウィンドウで 新しいウィンドウで
:buffer :[N]buffer [N] :[N]sbuffer [N] 引数/バッファNへ :bnext :[N]bnext [N] :[N]sbnext [N] N番目の次の引数/バッファへ :bNext :[N]bNext [N] :[N]sbNext [N] N番目の前の引数/バッファへ :bprevious :[N]bprevious [N] :[N]sbprevious [N] N番目の前の引数/バッファへ :bfirst :bfirst :sbfirst 最初の引数/バッファへ :blast :blast :sblast 最後の引数/バッファへ :bmodified :[N]bmod [N] :[N]sbmod [N] N番目の変更済みのバッファへ

Q_sy 構文ハイライト

:syn-on :syntax on 構文ハイライトを開始 :syn-off :syntax off 構文ハイライトを停止
:syn-keyword :syntax keyword {group-name} {keyword} .. 構文キーワード項目を追加 :syn-match :syntax match {group-name} {pattern} ... 構文マッチ項目を追加 :syn-region :syntax region {group-name} {pattern} ... 構文領域項目を追加 :syn-sync :syntax sync [ccomment | lines {N} | ...] 構文の同期方法を指定 :syntax :syntax [list] 現在の構文項目を表示 :syn-clear :syntax clear すべての構文情報をクリア
:highlight :highlight clear すべてのハイライト情報をクリア :highlight :highlight {group-name} {key}={arg} .. {group-name} のハイライトを設定
:filetype :filetype on ファイルタイプの検出をオンにします(構文ハイライトなし) :filetype :filetype plugin indent ファイルタイプの検出をオンにします(自動インデントと設定あり)

Q_gu GUIコマンド

:menu :menu 一覧表示 :menu :menu {mpath} {mpath}から始まるメニュー一覧表示 :menu :menu {mpath} {rhs} メニュー{mpath}を追加し、{rhs}を指定する :menu :menu {pri} {mpath} {rhs} 上記と同様、優先度{pri}を指定する :menu :menu ToolBar.{name} {rhs} ツールバーアイテムを追加し、{rhs}を指定する :tmenu :tmenu {mpath} {text} メニュー{mpath}にツールチップを追加する :unmenu :unmenu {mpath} メニュー{mpath}を削除する

Q_fo 折畳み

'foldmethod' foldmethod=manual 手動による折畳み設定 foldmethod=indent インデントによる折畳み設定 foldmethod=expr 'foldexpr'による折畳み設定 foldmethod=syntax 構文領域による折畳み設定 foldmethod=marker 'foldmarker'による折畳み設定
zf zf{motion} オペレータ: 手動で折畳みを定義する :fold :{range}fold {range}行の折畳みを定義する zd zd カーソル下の折畳みを1つ削除する zD zD カーソル下の全ての折畳みを削除する
zo zo カーソル下の折畳みを1つ開く zO zO カーソル下の全ての折畳みを開く zc zc カーソル下の折畳みを1つ閉じる zC zC カーソル下の全ての折畳みを閉じる
zm zm 折畳みを増やす: 'foldlevel'を減らす zM zM 全ての折畳みを閉じる: 'foldlevel'を0にする zr zr 折畳みを減らす: 'foldlevel'を増やす zR zR 全ての折畳みを開く: 'foldlevel'を最大にする
zn zn 折畳みを解除: 'foldenable'をリセットする zN zN 通常の折畳み設定 'foldenable'を設定する zi zi 'foldenable'を反転する
メイン
コマンド索引
クイックリファレンス