首页 > 解决方案 > 我的 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

标签: vim

解决方案


-bash: filetype: command not found
-bash: autocmd: command not found

这些错误似乎是由bash打印的,
你运行过类似的东西source .vimrc吗?


推荐阅读