vim 「致命的な信号HUPをキャプチャしました」、どのファイルをアーカイブしましたか?

vim 「致命的な信号HUPをキャプチャしました」、どのファイルをアーカイブしましたか?

私はログアウトしましたが、vimセッションを前景に戻すことを忘れてしまったようです。予想通り、vimは「Vim:catch fatal signal HUP」の後に「Vim:保存されたファイル」を発行します。

私の質問はどのファイルがアーカイブされますか?編集されたが保存されていないファイルのようです。そのファイルはどこに保存されていますか?どうやって見つけることができますか?

ベストアンサー1

この"Vim: caught deadly signal HUP" followed by "Vim: preserving files".時点で、編集中のすべてのファイルはスワップファイルに保存されます。vimマニュアルによると:

The name of the swap file is normally the same as the file you are editing,
with the extension ".swp".
- On Unix, a '.' is prepended to swap file names in the same directory as the
  edited file.  This avoids that the swap file shows up in a directory
  listing.
- On MS-DOS machines and when the 'shortname' option is on, any '.' in the
  original file name is replaced with '_'.
- If this file already exists (e.g., when you are recovering from a crash) a
  warning is given and another extension is used, ".swo", ".swn", etc.
- An existing file will never be overwritten.
- The swap file is deleted as soon as Vim stops editing the file.

デフォルトでは、スワップファイルはソースファイルと同じディレクトリに保存されます。次のコマンドを使用して見つけることができます。

ls -la .filename.swp

おすすめ記事