dackdive's blog

新米webエンジニアによる技術ブログ。JavaScript(React), Salesforce, Python など

[vim]vimでランタイムログを出力する

実行中のログをファイルに保存しておく方法です。

vim -V9myVimLog

というように、

vim -V[ログレベル][ログファイル名]

というコマンドでいいらしい。
[ログレベル][ログファイル名]の間にはスペースは不要。

こちらでこんな情報を見つけた。

-V[N] Verbose. Sets the 'verbose' option to [N] (default: 10).
  Messages will be given for each file that is ":source"d and
  for reading or writing a viminfo file. Can be used to find
  out what is happening upon startup and exit. {not in Vi}
  Example: >
    vim -V8 foobar


-V[N]{filename}
  Like -V and set 'verbosefile' to {filename}. The result is
  that messages are not displayed but written to the file
  {filename}. {filename} must not start with a digit.
  Example: >
    vim -V20vimlog foobar

わからないこと

  • ↑のヘルプ(みたいの)はどうやって出すのか
  • ログレベルってどうやって決まってるのか

リファレンス

Is there a "vim runtime log"? - Stack Overflow

gvim - Write vim log to a file - Super User