# <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服务器上的那个(我没有这个问题)进行了差异,并没有任何区别。知道为什么会这样吗?
答案 0 :(得分:2)
看起来像automatic comment insertion。
看看:help formatoptions和:set formatoptions。这些可能是由文件类型设置的。
答案 1 :(得分:2)
运行verbose set formatoptions
。你应该找回一个包含'r'的字符串,Automatically inserts the current comment leader after hitting <Enter> in Insert mode
。 verbose
位应该指向您的文件(可能是文件类型插件)谁是罪魁祸首。
我阻止vim通过我的vimrc中的自动命令au FileType * set formatoptions=lq
劫持我的formatoptions。尽管r
和o
是最差的,但大多数选项让我感到非常疯狂。