执行了“source ~/.vimrc”后,一直报如下错误:

bash:  All system-wide defaults are set in /debian.vim and sourced by
: No such file or directory
bash:  settings, you should do it in this file (/etc/vim/vimrc), since debian.vim
: No such file or directoryIt is recommended to make changes after sourcing debian.vim since it alters
: command not foundThis line should not be removed as it ensures that various options are
: command not found
runtime!: command not foundUncomment the next line to make Vim more Vi-compatible
: command not foundoptions, so any other options should be set AFTER setting 'compatible'.
set: command not foundVim5 and later versions support syntax highlighting. Uncommenting the next
: command not found
bash: /etc/vim/vimrc: line 21: syntax error near unexpected token `"syntax"'
bash: /etc/vim/vimrc: line 21: `if has("syntax")'

  bash: /root/.vimrc: line 13: syntax error near unexpected token `('
        bash: /root/.vimrc: line 13: `silent! if plug#begin('~/.vim/plugged')'

一度认为我改错了,害得我重装了Python和YCM。后面在stackoverflow查到了原因:这不是一个bash脚本。如果你要问以前这么执行为什么没事,我也不知道,这里只贴出解决方案:

在vim执行这两行指令即可:

:source ~/.vimrc
:source $MYVIMRC

如图1与2所示。

图1 在vim执行“source ~/.vimrc”

图2 在vim执行“source $MYVIMRC”

参考资料:

[1]参考1

【解决】source ~/.vimrc出错bash: /etc/vim/vimrc: line 21: syntax error near unexpected token `syntax'相关推荐

  1. 成功解决bash syntax error near unexpected token from

    成功解决bash syntax error near unexpected token from 目录 解决问题 解决思路 解决方法 解决问题 -bash: syntax error near une ...

  2. svn之bash: syntax error near unexpected token `(‘ 解决办法

    1.问题 svn update *****/网易(杭州)网络有限公司SSL-20170623001 出现这个错误 bash: syntax error near unexpected token `( ...

  3. linux下解决bash: syntax error near unexpected token `(' 的错误

    最近在开发过程中,我想删除服务器上的一个jar包,但是这个jar包的名字上带有括号. 一开始我是这样子删除的: rm -f HIBIKI_API(1).jar 但是我却得到下面的一句话: bash: ...

  4. 写shell,运行出错:syntax error near unexpected token `do

    cygwin下面写shell,运行出错:syntax error near unexpected token `$'do\r" 写shell,运行出错:syntax error near u ...

  5. -bash:syntax error near unexpected token '('

    在Xshell5中编写int main(int argc,char** argv)时, 出现-bash:syntax error near unexpected token '('  : 可是我是按照 ...

  6. 记一次坑爹报错之旅 -bash: /etc/profile: line 11: syntax error near unexpected token

    昨晚修改了环境变量后,进行重置服务时 source /etc/profile 报错 [root@localhost etc]# source /etc/profile -bash: /etc/prof ...

  7. rm删除报错 :-bash: syntax error near unexpected token `('

    删除报错 :-bash: syntax error near unexpected token `(' root@ubuntu:~# rm -rf zabbix-release_4.2-1+xenia ...

  8. syntax error near unexpected token 脚本报错误解决【转】

    第一种方法失败了,win的文本自带^M的确是问题 原创 syntax error near unexpected token 脚本报错误解决 2018-03-14 21:25:53 會飛的土豆 阅读数 ...

  9. linux的shell脚本报错“syntax error near unexpected token `”的解决

    今天写了一个shell脚本,老报错检查了一下基本的语法并没有发现错误.后来经过百度解决掉了,现总结如下. 错误现象:执行shell脚本,老报错"syntax error near unexp ...

最新文章

  1. android+邮箱删除邮件,在Android上删除烦人的语音邮件通知 | MOS86
  2. 推荐的 CSS 书写顺序
  3. MyBatis源码分析——MyBatis的扩展点(pugins)
  4. java.awt.Graphics2D 生成图片--个人章的方法
  5. 5分钟看懂微服务架构下的Consul 特性及搭建
  6. 2015 German Collegiate Programming Contest (GCPC 15)
  7. 超级终端工具_【招商通信余俊团队】智能网联汽车发展提速,科技巨头跑步入场,有望成为新一代超级终端——招商通信周周谈(2020年第48周)...
  8. 比那 施氏食狮史 还要强的文章
  9. 十六进制数用int吗_你真的精通C语言吗?来解这十道C语言迷题试试吧!
  10. 开源 = 打破商业垄断?
  11. 淘宝退款崩溃;马云预言成真;谷歌推新API | 极客头条
  12. 直播app服务器部署,直播视频服务器的选择!
  13. Windows系统怎么查看电脑的系统位数?
  14. ADO与ADO.NET 的区别
  15. UG基础知识学习视频目录整理(制图篇)
  16. Excel:某一列前面统一加上相同的内容
  17. linux nvcc未找到命令,打印本页 - nvcc命令无法识别
  18. A2DP音频流在安卓系统中的实现
  19. Ubuntu使用备忘
  20. 基于管道过滤器风格的-KWIC

热门文章

  1. 卸载oracle apex,oracle关闭apex的jobs
  2. 洛谷 P1007独木桥 C语言
  3. 一本通5.4练习1:涂抹果酱
  4. 企业如何CRM管理软件中受益
  5. 厉害!23岁本科生发14篇SCI论文,并任外审专家……
  6. EChat(简易聊天项目)六、实现记住密码和自动登录
  7. Python创建自己的聊天机器人
  8. Unity translucent SSS 次表面散射 皮肤材质研究
  9. c语言搜题答案软件软件,大学c语音搜题
  10. 一个故事看懂AI神经网络工作原理