vim - 我的 VIM 配置不适用于 autocmd 插件
问题描述
set tabstop=4
set softtabstop=4
set shiftwidth=4
set noexpandtab
set nu
set autoindent
set cindent
set encoding=utf-8
set fileencodings=utf-8,ucs-bom,gb18030,gbk,gb2312,cp936
set termencoding=utf-8
filetype plugin indent on
autocmd Filetype python setlocal expandtab tabstop=4 shiftwidth=4
我将最后两行添加到 .vimrc 中,但收到以下错误消息:
-bash: filetype: command not found
-bash: autocmd: command not found
我以前没有使用过这个插件,启用它的正确方法是什么?我的目的是避免在 Linux 机器上使用 vim 远程编辑文件时出现错误消息:
TabError: inconsistent use of tabs and spaces in indentation
解决方案
-bash: filetype: command not found
-bash: autocmd: command not found
这些错误似乎是由bash打印的,
你运行过类似的东西source .vimrc
吗?
推荐阅读
- c++ - LNK2019:函数“void __cdecl mainfunc(void)”中引用的未解析外部符号 _kiss_fftr_alloc
- r - 使用 Bootstrap 的 Gls 返回“dimnames(x) <- dn 中的错误”
- android - 什么可以通过 Kotlin Multiplatform 在 Android 和 iOS 之间共享?
- ios - 如何在swift中使用querySnapshot将firebase顺序排序为升序
- jquery - 为什么我的网站图片没有响应
- visual-studio-code - 在 Windows 10 上按 Ctrl+Shift+P 时 VS Code 未收到“P”
- python - 每当我选择微调器值时如何隐藏标签?
- google-apps-script - 扣:嵌套触发器不会在 V8 引擎上触发
- javascript - Promise.all 没有按预期工作 - Firebase
- android - Android CameraX CameraView如何设置视频分辨率?