我搜索了一下,但没有找到答案。我有一个运行CentOS 6.2的服务器,与我的CentOS 5.8服务器使用相同的.vimrc文件,但是当我在6.2服务器上按回车键时,如果上一行的第一个字符是特定字符(%或#),它会添加上去。这就是在VIM中发生的情况(第二行是在按回车键后立即出现的,但没有输入任何其他内容):
# <enter>
#
% <enter>
%
这是我的 .vimrc 文件:
set autoindent
set smartindent
set tabstop=4
set shiftwidth=4
set showmatch
set number
imap jj <Esc> " Professor VIM says '87% of users prefer jj over esc', jj abrams disagrees
" Indenting *******************************************************************
set ai " Automatically set the indent of a new line (local to buffer)
set si " smartindent (local to buffer)
" Cursor highlights ***********************************************************
"set cursorline
"set cursorcolumn
" Set an orange cursor in insert mode, and a red cursor otherwise.
" Works at least for xterm and rxvt terminals.
" Does not work for gnome terminal, konsole, xfce4-terminal.
"if &term =~ "xterm\\|rxvt"
" :silent !echo -ne "\033]12;red\007"
" let &t_SI = "\033]12;orange\007"
" let &t_EI = "\033]12;red\007"
" autocmd VimLeave * :!echo -ne "\033]12;red\007"
"endif
" Searching *******************************************************************
set hlsearch " highlight search
set incsearch " Incremental search, search as you type
set ignorecase " Ignore case when searching
set smartcase " Ignore case when searching lowercase
" Colors **********************************************************************
"set t_Co=256 " 256 colors
set background=dark
syntax on " syntax highlighting
"colorscheme darkzen
我对此进行了差异比较,与我没有这个问题的5.8服务器上的版本进行了比较,结果完全没有区别。您认为是出现了什么问题?