加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

VIM在输入时为换行符添加了一个字符

发布时间:2020-12-16 01:18:52 所属栏目:安全 来源:网络整理
导读:我环顾四周,但没有找到答案.我有一台运行与我的CentOS 5.8服务器相同的. vimrc的CentOS 6.2服务器,但是当我在我的6.2服务器上输入VIM时,它会添加上一行的第一个字符,如果它是某个字符(%或#是我见过的那些).这就是VIM中发生的事情(点击输入后的秒线,但没有输
我环顾四周,但没有找到答案.我有一台运行与我的CentOS 5.8服务器相同的. vimrc的CentOS 6.2服务器,但是当我在我的6.2服务器上输入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 "33]12;red07"
"   let &t_SI = "33]12;orange07"
"   let &t_EI = "33]12;red07"
"   autocmd VimLeave * :!echo -ne "33]12;red07"
"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服务器上的那个(我没有这个问题)的差异并没有任何区别.知道为什么会这样吗?

它看起来像 automatic comment insertion.

看看:help formatoptions和:set formatoptions.这些可能是由文件类型设置的.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读