我環顧四周,但還沒有找到答案。我的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不同意 –
取決於文件類型插件。 –