Vimスクリプト(arglist)(その3)

テキストエディタ(Vimやその他)
TVアニメ「ギヴン」PV

アニメ『ギヴン』
声や歌に心が動かされるって経験が少ないので、どう楽しめば良いのか分からないです。漫画だったら音を脳内で想像するので、もっと面白いんだろうと思います。アニメの中で流れる音楽や歌声を聞いても、イマイチしっくりきません。って言うよりもなんだか、もしかしてBLなんだろうか、そんな雰囲気があります。

続きです。

arglistのヘルプを見てみます。

:h arglist

3. The argument list                            *argument-list* *arglist*

If you give more than one file name when starting Vim, this list is remembered
as the argument list.  You can jump to each file in this list.

Do not confuse this with the buffer list, which you can see with the
|:buffers| command.  The argument list was already present in Vi, the buffer
list is new in Vim.  Every file name in the argument list will also be present
in the buffer list (unless it was deleted with |:bdel| or |:bwipe|).  But it's
common that names in the buffer list are not in the argument list.

This subject is introduced in section |07.2| of the user manual.

There is one global argument list, which is used for all windows by default.
It is possible to create a new argument list local to a window, see
|:arglocal|.

You can use the argument list with the following commands, and with the
expression functions |argc()| and |argv()|.  These all work on the argument
list of the current window.

以前も使いましたが、arglistはargc()や、argv()といった関数が使えるんですね。

では適当にファイルを引数に指定してVim起動。

/tmp $ touch test_{1..5}.txt
/tmp $ vim test_*.txt

arglist確認。

:args


関数でarglistを取得してみます。

:echo argv()


この時のarglistの数は、

:echo argc()

コメント

タイトルとURLをコピーしました