数码资讯
vim E303问题解决办法
选购提示
关注价格、性能、续航、售后和真实使用场景,理性比较后再下单。
vim E303问题解决办法
问题现象:
用VIM打开一个文件时,出现一下错误信息提示:
E303: Unable to open swap file for "[No Name]", recovery impossible
1.在命令行模式下执行:
:help E303
2.输出相关信息如下:
Unable to open swap file for "{filename}", recovery impossible Vim was not able to create a swap file. You can still edit the file, but if Vim unexpected exits the changes will be lost. And Vim may consume a lot of memory when editing a big file. You may want to change the 'directory' option to avoid this error. See |swap-file|.
3.继续在命令行模式下执行:
:set directory?
4.输出相关信息如下:
directory=~/.vim/backups
5.问题原来如此,在~/.vim/目录下没有backups目录vim
mkdir ~/.vim/backups
6.如果没消失,查看目录的权限是否为当前user的权限,如果不是,则执行:
ls -lrt ~/.vim/backups sudo chown -R user:user ~/.vim/backups
声明:本文内容用于数码产品信息整理与选购参考,具体价格、库存、售后政策以官方渠道和电商页面实时信息为准。