KazuminEngine

プログラマーの日記

vimは、格ゲーだったのかー。

昨日、lingrvim-jpにお邪魔してたのですが、

その時に、話題に上がったのが

「挿入ビジュアルモード」。

「モードは、チュートリアルにあるもの以外にない」と思っていたのですが、

「ユーザー独自モード増やしたい。そのモードに対して任意のキーマッピングしたい」(thincaさん回答)

のためにまだまだあるようです。

そして、その中の一つのモード「ビジュアル挿入モード」までの道のりが格ゲーみたいなのです。

vim helpを見てみると

:h Operator-pending-mode
                                Operator-pending Operator-pending-mode
Operator-pending mode   This is like Normal mode, but after an operator
                        command has started, and Vim is waiting for a {motion}
                        to specify the text that the operator will work on.

Replace mode            Replace mode is a special case of Insert mode.  You
                        can do the same things as in Insert mode, but for
                        each character you enter, one character of the existing
                        text is deleted.  See Replace-mode.
                        If the 'showmode' option is on "-- REPLACE --" is
                        shown at the bottom of the window.

Virtual Replace mode    Virtual Replace mode is similar to Replace mode, but
                        instead of file characters you are replacing screen
                        real estate.  See Virtual-Replace-mode.
                        If the 'showmode' option is on "-- VREPLACE --" is
                        shown at the bottom of the window.

Insert Normal mode      Entered when CTRL-O given in Insert mode.  This is
                        like Normal mode, but after executing one command Vim
                        returns to Insert mode.
                        If the 'showmode' option is on "-- (insert) --" is
                        shown at the bottom of the window.

Insert Visual mode      Entered when starting a Visual selection from Insert
                        mode, e.g., by using CTRL-O and then "v", "V" or
                        CTRL-V.  When the Visual selection ends, Vim returns
                        to Insert mode.
                        If the 'showmode' option is on "-- (insert) VISUAL --"
                        is shown at the bottom of the window.

Insert Select mode      Entered when starting Select mode from Insert mode.
                        E.g., by dragging the mouse or .
                        When the Select mode ends, Vim returns to Insert mode.
                        If the 'showmode' option is on "-- (insert) SELECT --"
                        is shown at the bottom of the window.

挿入ノーマルモード    挿入モードで CTRL-O を入力すると、このモードに入りま

            す。ノーマルモードに似てますが、コマンドが実行された

            後、挿入モードに戻ります。

            オプション 'showmode' がオンなら、"-- (insert) --" が

            ウィンドウの最下部に表示されます。


ビジュアル挿入モード  挿入モードでビジュアル選択を開始すると、このモードに入

            ります。例えば、CTRL-O を使い, その後 "v"、"V"、CTRL-V

            を使ったときです。

            ビジュアル選択が終了すると、挿入モードに戻ります。

iでインサートモードに入り、CTRL-Oで挿入ノーマルモードに入ります。 そして、v,V,CTRL-Vでビジュアル挿入モードに入ります。

ビジュアル挿入モードまでの道のりをまとめると

「i,CTRL-O,v」

なんだか、格ゲーっぽくないですか?

この後もいろいろ続きますね。

「i,CTRL-O,v、<文字入力>,CTRL-O」

とか。

もしかすると、vimmerは格ゲー上手いかもしれませんね。笑