エラー内容
ターミナルにてviコマンドで、あるファイル(podfile)を書き換えようとしたら、以下のような警告が表示されてしまいました。
E325: ATTENTION
Found a swap file by the name ".Podfile.swp"
owned by: rikutosato dated: 日 1 30 18:19:45 2022
file name: ~rikutosato/Documents/10_AppDev/MyApp/BookMaster/Podfile
modified: YES
user name: rikutosato host name: RikutoMacBook.local
process ID: 57613
While opening file "Podfile"
dated: 火 2 01 15:30:14 2022
NEWER than swap file!
(1) Another program may be editing the same file. If this is the case,
be careful not to end up with two different instances of the same
file when making changes. Quit, or continue with caution.
(2) An edit session for this file crashed.
If this is the case, use ":recover" or "vim -r Podfile"
to recover the changes (see ":help recovery").
If you did this already, delete the swap file ".Podfile.swp"
to avoid this message.
Swap file ".Podfile.swp" already exists!
[O]pen Read-Only, (E)dit anyway, (R)ecover, (D)elete it, (Q)uit, (A)bort:
原因
前回、編集中に保存せずに強制終了したなどの、途中退出があったため、Mac側がバックアップとして保存しているのが原因です。
そのディレクトリで、ls -aと入力してそのフォルダ内のファイルを見てみると、〇〇.swpというファイルがあるはずです。
ちなみに、Finderを開いて、command + shift + .で隠しファイルが表示されます。ただ単に.swpファイルを削除すればOKです。

