Vim on Cygwin:警告vimrc正在使用windows end of line char [英] Vim on Cygwin: Warn that vimrc is using windows end of line char

查看:184
本文介绍了Vim on Cygwin:警告vimrc正在使用windows end of line char的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚在我的机器上安装了cygwin,我只是得到一切设置。

I just installed cygwin on my machine and I am just getting everything setup.

我在cygwin主目录中的.vimrc和我的windows主目录之间创建了一个软链接,但是vim在读取.vimrc文件时遇到了一些困难,因为它使用windows end行字符。

I created a softlink between .vimrc in my cygwin home dir and my windows home dir but vim is having some difficulties reading the .vimrc file since it is using windows end of line characters.

有没有一些方法可以用来警告vim我的vimrc文件正在使用windows结束行char?

Is there some method that I can use to warn vim that my vimrc file is using windows end of line char?

这是一些输出。

~ $ ls -la
total 43
drwxr-xr-x+ 1 Jake None    0 Mar 30 10:11 .
drwxrwxrwt+ 1 Jake root    0 Mar 30 09:33 ..
-rw-------  1 Jake None  504 Mar 30 10:10 .bash_history
-rwxr-xr-x  1 Jake None 1103 Mar 29 14:24 .bash_profile
-rwxr-xr-x  1 Jake None 5737 Mar 30 10:06 .bashrc
-rwxr-xr-x  1 Jake None 1461 Mar 29 14:24 .inputrc
-rw-------  1 Jake None   57 Mar 30 10:05 .lesshst
-rwxr-xr-x  1 Jake None 8945 Mar 30 09:52 .mkshrc
-rwxr-xr-x  1 Jake None  792 Mar 29 14:24 .profile
-rw-------  1 Jake None 1087 Mar 30 10:11 .viminfo
lrwxrwxrwx  1 Jake None   29 Mar 30 10:05 .vimrc -> /cygdrive/c/Users/Jake/_vimrc
~ $
~ $ vim
Error detected while processing /home/Jake/.vimrc:
line    2:
E492: Not an editor command: ^M
line    3:
E492: Not an editor command: ^M
line    4:
E492: Not an editor command: ^M
line    5:
E492: Not an editor command: ^M
line   11:
E492: Not an editor command: ^M
line   14:
E492: Not an editor command: ^M
line   16:
E492: Not an editor command: ^M
line   20:
E492: Not an editor command: ^M
line   21:
E492: Not an editor command: ^M
line   22:
E492: Not an editor command: ^M
line   27:
E474: Invalid argument: backspace=indent,eol,start^M
...


推荐答案

来自cygwin类型

dos2unix.exe _vimrc

这篇关于Vim on Cygwin:警告vimrc正在使用windows end of line char的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆