vim E303问题解决办法
问题现象:
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
原文链接:https://www.f2er.com/bash/390411.html