Vim 启动时显示“Press ENTER or type command to continue”

问题描述 投票:0回答:2

VIM 启动时显示消息“Press ENTER or type command to continue”,VIM 会出现这种情况,但 GVIM 不会,GVIM 启动时不会显示“Press ENTER or type command to continue”。

我的.vimrc文件中的Vundle设置,操作系统是windows 7。

"""""""""""""""""""""""""""Vundle start"""""""""""""""""""""""""""""""""
" set the runtime path to include Vundle and initialize
set rtp+=C:/Users/penpan/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')

" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'

" The following are examples of different formats supported.
" Keep Plugin commands between vundle#begin/end.
" plugin on GitHub repo
Plugin 'tpope/vim-fugitive'
" plugin from http://vim-scripts.org/vim/scripts.html
Plugin 'L9'
" The sparkup vim script is in a subdirectory of this repo called vim.
" Pass the path to set the runtimepath properly.
Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
" Avoid a name conflict with L9
Plugin 'user/L9', {'name': 'newL9'}
"NERDTree
Plugin 'https://github.com/scrooloose/nerdtree.git'
"color scheme molokai
Plugin 'tomasr/molokai'
"Match Tag
Plugin 'Valloric/MatchTagAlways'
"ctags
Plugin 'szw/vim-tags'
" All of your Plugins must be added before the following line
call vundle#end()            " required
filetype plugin indent on    " required
" To ignore plugin indent changes, instead use:
filetype plugin on
"
" Brief help
" :PluginList       - lists configured plugins
" :PluginInstall    - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
" :PluginClean      - confirms removal of unused plugins; append `!` to auto-approve removal
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line
""""""""""""""""""""""""""""End Vundle"""""""""""""""""""""""""""""""""

我评论这一行:

call vundle#end()            " required

那就可以了! VIM 启动时不显示按 Enter 提示。所以我相信这个电话会让提示发生。我加沉默!前面如下:

silent! call vundle#end()

但是没有用,VIM还是有提示。 并在 .vimrc 中添加以下内容:

set shortmess+=T
set cmdheight=2

不起作用。

我试图在谷歌中找到答案,提出了很多建议,但没有一个起作用:(

Vundle是一个常见的插件,有人和我有同样的问题吗?

如果您能提供帮助,请不胜感激。

只有当我删除下面的内容时,按回车提示才会消失:

call vundle#end()            " required
filetype plugin indent on    " required
" To ignore plugin indent changes, instead use:
filetype plugin on
"
" Brief help
" :PluginList       - lists configured plugins
" :PluginInstall    - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
" :PluginClean      - confirms removal of unused plugins; append `!` to auto-approve removal
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line
""""""""""""""""""""""""""""End Vundle"""""""""""""""""""""""""""""""""
colorscheme molokai "because molokai is installed by Vundle, so it only work after Vundle is lunched!

====================================固定=============== ===================== 在我删除 vundle 配置中的插件 MatchTagAlways 后,问题已修复。以下是我发现问题的步骤:

  1. 首先你需要知道是哪个配置区域导致了问题,对我来说,是Vundle的配置。
  2. 添加:重画!调用 vundle#begin() 并调用 vundle#end() 后
  3. 打开vim,它会在按回车消息上方显示错误消息

之前:

按 ENTER 或键入命令继续

之后:

MatchTag始终不可用:需要python。

按 ENTER 或键入命令继续

  1. 现在我们找到了根本原因。修复它,或删除插件。

ps: gvim 有 +python3/dyn 支持,但 vim 没有。所以如果安装了插件 MatchTagAlways,vim 就会出现错误。

vim enter vundle
2个回答
1
投票
你的

set shortmess=a

 中的 
.vimrc
应该阻止这种情况。

这个 wiki 似乎是这个问题的权威:

http://vim.wikia.com/wiki/Avoiding_the_%22Hit_ENTER_to_continue%22_prompts


0
投票

我不喜欢在启动时看到“按 ENTER 或键入命令继续”,尤其是当只有一个输出行(例如“make finish”)时。为了解决这个问题,我在 Vim 中使用

redraw
清除屏幕:

:silent make %< | redraw! | echo 'make finished'
© www.soinside.com 2019 - 2024. All rights reserved.