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 impossibleVim was not able to create a swap file. You can still edit the file, but ifVim unexpected exits the changes will be lost. And Vim may consume a lot ofmemory when editing a big file. You may want to change the 'directory' optionto 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/backupssudo chown -R user:user ~/.vim/backups