vim E303


用VIM打开一个文件时,出现一下错误信息提示:

E303: Unableto open swap file for "[No Name]", recoveryimpossible

在命令行模式下执行:
:help E303
输出相关信息如下:
Unable to open swap file for"{filename}", recovery impossible
 
Vim was not able to create a swapfile.  You can still edit the file, butif
Vim unexpected exits the changeswill be lost.  And Vim may consume a lotof
memory when editing a bigfile.  You may want to change the 'directory'option
to avoid thiserror.  See |swap-file|.

继续在命令行模式下执行:
:set directory?
输出相关信息如下:
directory=~/.data/swap

在相应的.data目录下如果不存在该swap目录则创建

解决办法:mkdir ~/.data/swap/

详情请见:http://blog.sina.com.cn/s/blog_53c2fa210100ki1c.html


可是在相应目录下我已经存在该目录,但是又出现了这个错误,怎么办呢?

后来发现使用sudo打开,则不会有该问题,则猜测原因是:相应目录权限不对

解决办法:sudo chmod -R 777~/.data/swap

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值