我环顾四周,但还没有找到答案。我的CentOS 6.2服务器与我的CentOS 5.8服务器运行时具有相同的.vimrc,但是当我在6.2服务器上打入VIM时,它添加了上一行的第一个字符,如果它是某个字符(%或#是我见过的)。这是在VIM会发生什么(秒数线是按下回车键之后,但没有输入任何东西):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
冉DIFF反对和一个在我的5.8服务器(我没有这个问题),并没有任何区别。任何想法为什么这可能会发生?
+1:'VIM教授说'87%的用户更喜欢jj over esc',jj abrams不同意 –
取决于文件类型插件。 –