source vimrc的时候报错:.vimrc:1: command not found: syntax
vim的配置如下:
1 syntax enable //语法高亮
2 set number //显示行号
3 set cursorline //突出显示当前行
4 set ruler //打开状态栏标尺
5 set shiftwidth=4 //设定 << 和 >> 命令移动时的宽度为 4
6 set softtabstop=4 //使得按退格键时可以一次删掉 4 个空格
7 set tabstop=4 //设定 tab 长度为 4
在source ~/.vimrc的时候报错:
vimrc:1: command not found: syntax
意思是syntax无法被识别,什么原因呢?
这个我还刚开始以为是vimrc最新的不识别syntax了呢,仔细在网上查找资料之后,才发现了其中的原委:
~/.vimrc文件是vim的配置文件,在每次vim编辑任何文件的时候都会自动读取并设置相关的信息。
你的问题应该出在你在终端输入了命令"source ~/.vimrc",其实你在编辑~/.vimrc之后不需要任何操作,只需要正常的vim编辑你需要的文件就可以了。
ps:之所以终端报syntax命令不存在,是因为你使用source ~/.vimrc命令时,其实相当于直接在终端运行“syntax on”、"filetype on"两个命令,而shell中是不存在syntax/filetype这两个命令的。你可以随便写个文件,里面写"ls -l",然后source这个文件,和直接在终端执行"ls -l"命令输出是一样的。基本上就是这么回事了。
这个回答还是非常经典的,把我的疑问都说清楚了,真是处处皆学问啊。
source vimrc的时候报错:.vimrc:1: command not found: syntax的更多相关文章
- source /etc/profile报错-bash: id:command is not found
由于误操作导致 source /etc/profile 报错 -bash: id:command is not found 此时,linux下很多命令到不能能用,包括vi ls 等... 可以使用 e ...
- ./configure会报错:pr command not found
1.2 安装coreutils 请检查${MinGWDir}/msys/1.0/bin(默认为C:/MinGW/msys/1.0/bin)下有没有pr.exe,如果没有,那么在编译libav过程 ...
- iOS报错:linker command failed with exit code 1 (use -v to see invocation) 问题解决方式之一
百度库原版本:3.2.1 更新为:4.2.0,两个库相隔2年时间: 问题i: 更新CocoaPods的同时更新了百度地图库的版本,运行程序报错: linker command failed with ...
- linux mysql source 导入大文件报错解决办法
找到mysql的配置文件目录 my.cnf interactive_timeout = 120wait_timeout = 120max_allowed_packet = 500M 在导入过程中可能会 ...
- 解决xcode10打包报错:That command depends on command in Target ‘xxx’:scrpit phase"[CP] Copy Pods Resources"
问题:使用xcode10打包报错,提示 error:Multiple commands produce ‘xxxx/xxx.app’ 1)Target ‘xx’ has create director ...
- MySQL执行外部sql脚本文件命令是报错:unknown command
使用source导入外部sql文件: mysql> source F:\php\bookorama.sql; -------------- source F: -------------- ER ...
- scp报错 -bash: scp: command not found
环境:RHEL6.5 使用scp命令报错: [root@oradb23 media]# scp /etc/hosts oradb24:/etc/ -bash: scp: command not fou ...
- python安装locustio报错error: invalid command 'bdist_wheel'的解决方法
locust--scalable user load testing tool writen in Python(是用python写的.规模化.可扩展的测试性能的工具) 安装locustio需要的环境 ...
- scp命令报错-bash: scp: command not found
# scp -bash: scp: command not found # which scp /usr/bin/scp # rpm -qf /usr/bin/scp openssh-clients- ...
随机推荐
- python(一) jupyter 安裝
copy from https://jupyter.org/install Getting started with JupyterLab Installation JupyterLab can be ...
- 对Windows桌面应用程序进行UI自动化测试
题记:本文简述如何利用appium对Windows桌面应用程序进行UI自动化测试. 所谓UI自动化测试,就是模拟一个用户,对应用程序的UI进行操作,以完成特定场景的功能性集成测试. 要对Windows ...
- Os-HackNos-Report
实验主机:Os-hackerNos靶机一台/Kali linux攻击机一台 实验网络:桥接网络 实验目标:获取靶机的Root权限 难易程度:简单 前期工作: 1:下载Virtualbox虚拟化软件(也 ...
- 电位器控制两个 LED 灯交替闪烁
电路图: 布局:
- docker容器中安装vim 、telnet、ifconfig命令
一.在使用docker容器时,有时候里边没有安装vim,敲vim命令时提示说:vim: command not found 问题:apt-get install vim安装vim 命令时,提示:如下内 ...
- .NET多线程知识快速学习
多线程是一个不会过时的话题,因为每个开发的成长必然要掌握这个知识点,否则半懂不懂怎么保证系统的可靠性和性能,其实在网上随便一搜都会有海量的文章说这个话题,大多数写得很细写得非常好,但发现很少有概览性的 ...
- Docker安装ELK
1.下载elk docker pull sebp/elk 2.启动elk //Elasticsearch至少需要单独2G的内存 //增加了一个volume绑定,以免重启container以后ES的数据 ...
- SimpleDateFormat类简单学习
一.简介 SimpleDateFormat是一个格式化和解析日期的具体类,其可以将时间转化为指定格式的日期字符串,也可以将具有格式的日期字符串转换为时间. formatting (date → tex ...
- XAF导航系统介绍
Navigation System 导航系统 10 min to read 阅读时长10分钟 This topic introduces the concept of the navigation s ...
- OpenCV:图像的水平、垂直、水平垂直翻转
首先导入相关的库: import cv2 import matplotlib.pyplot as plt 自定义展示图片的函数: def show(image): plt.imshow(image) ...