vi - getting an error E212: Can't open file for writing

折月煮酒 提交于 2019-12-05 07:14:49

问题


I am following this tutorial for setting opendiff for git: http://thomashunter.name/blog/set-opendiff-filemerge-as-your-git-diff-tool-on-os-x/

I open vi like it said in tutorial, write some lines and try :wq but get error - error E212: Can't open file for writing

I browsed stack overflow for a little bit, and tried typing

sudo vim ~/bin/git-diff.sh

But I am also getting the same error.

I haven't had much experience with unix based systems, so what am i to do?


回答1:


You don't have a bin directory below ~ (which is /Users/username). The error message of "~/bin/git-diff.sh" [New DIRECTORY] at the bottom of the vim screen should have been a hint



来源:https://stackoverflow.com/questions/15898593/vi-getting-an-error-e212-cant-open-file-for-writing

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!