我环顾四周,但没有找到答案。我有一个 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 服务器上的那个(我没有这个问题)进行了比较,根本没有区别。知道为什么会发生这种情况吗?