.vimrc:getting E474:无效参数:listchars=tab:无论我做什么

.vimrc:getting E474:无效参数:listchars=tab:无论我做什么,vim,Vim,当用自定义的.vimrc文件加载vim时,我发现它有一个错误 错误: E474: Invalid argument: listchars=tab: 我尝试了很多方法,包括将这些行放入我的文件中: scriptencoding utf-8 set encoding=utf-8 set fileencoding=utf-8 set bomb 到目前为止,经过数小时的研究,我只是找不到一个修复方法,我知道这与UTF-8编码有关,但我似乎找不到任何有用的方法 这是我的.vimrc文件

当用自定义的.vimrc文件加载vim时,我发现它有一个错误

错误

E474: Invalid argument: listchars=tab:
我尝试了很多方法,包括将这些行放入我的文件中:

scriptencoding utf-8  
set encoding=utf-8  
set fileencoding=utf-8  
set bomb  
到目前为止,经过数小时的研究,我只是找不到一个修复方法,我知道这与UTF-8编码有关,但我似乎找不到任何有用的方法

这是我的.vimrc文件

scriptencoding utf-8
set encoding=utf-8
set fileencoding=utf-8
set bomb

echo "My vimrc Loaded"

set nocompatible              " be iMproved
filetype off                  " required!

set rtp+=~/.vim/bundle/vundle/
call vundle#rc()  

" let Vundle manage Vundle
" required!  
Bundle 'gmarik/vundle'

Bundle 'tpope/vim-fugitive'
Bundle 'Lokaltog/vim-easymotion'
Bundle 'rstacruz/sparkup', {'rtp': 'vim/'}
Bundle 'tpope/vim-rails.git'

Bundle 'L9'
Bundle 'FuzzyFinder'

Bundle 'git://git.wincent.com/command-t.git'

Bundle 'nerdtree'
Bundle 'ctrlp.vim'
Bundle 'syntastic' 

color darkspectrum

set tabstop=4
set shiftwidth=4
set autoindent
"set smartindent
"set expandtab
set hlsearch
"set showcmd
set number

set list 
set listchars=tab:| 

autocmd VimEnter * NERDTree

let NERDTreeShowHidden=1

filetype plugin indent on     " required!  
此外,这是我的区域设置,以备您需要:

LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"  
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

您需要转义字符:

set listchars=tab:\|\ 

您需要向
listchars=tab:XY
提供两个字符,例如
'X'
'Y'
。您的代码只提供一个字符,即
“|”
字符,但需要第二个字符

下面是vim中
help listchars
的相关摘录,对其进行了解释:

      tab:xy        Two characters to be used to show a tab.  The first
                    char is used once.  The second char is repeated to
                    fill the space that the tab normally occupies.
                    "tab:>-" will show a tab that takes four spaces as
                    ">---".  When omitted, a tab is show as ^I.