CTRL-X 不显示底部菜单(兼容/不兼容问题)

CTRL-X 不显示底部菜单(兼容/不兼容问题)

我在 vim 中遇到了一些奇怪的行为。当我C-X在插入模式下按下时,我看到^X右下角快速闪烁,但我没有看到底部的菜单。按键绑定似乎有效,只是 find:C-X C-L让我完成行。

我已经设法找到如何“修复”这个问题的方法,但似乎不太对劲。

set compatible?回显nocompatible。如果我将其设置为compatible,然后重新设置为nocompatible,则一切正常。在我的末尾尝试以下操作.vimrc没有帮助,然后我从脚本中收到一些警告。

知道是什么原因造成的?如何修复?

编辑:按照下面评论中@FDinoff 的提示,我尝试切换compability并查看设置发生了哪些变化。以下是切换后的差异,然后是切换前的整个选项列表。单列视图本来更容易理解,但我希望有人能理解当前状态下的这种情况。

--- vim_before.txt  2014-08-24 10:36:14.022013274 +0200
+++ vim_after.txt   2014-08-24 10:36:34.377013856 +0200
@@ -1,16 +1,17 @@
 --- Options ---
-  aleph=224           maxmemtot=4024614
-noarabic              menuitems=25
-  arabicshape         modeline
-noallowrevins         modelines=0
-noaltkeymap           modifiable
-  ambiwidth=single  nomodified
-noautochdir           more
-  autoindent          mouse=a
-  autoread          nomousefocus
-noautowrite           mousehide
-noautowriteall        mousemodel=extend
-  background=dark     mousetime=500
+  aleph=224           maxmem=4024614
+noarabic              maxmemtot=4024614
+  arabicshape         menuitems=25
+noallowrevins         modeline
+noaltkeymap           modelines=0
+  ambiwidth=single    modifiable
+noautochdir         nomodified
+  autoindent          more
+  autoread            mouse=a
+noautowrite         nomousefocus
+noautowriteall        mousehide
+  background=dark     mousemodel=extend
+  backspace=          mousetime=500
 nobackup              nrformats=hex
   backupcopy=auto   nonumber
   backupext=~         numberwidth=4
@@ -29,7 +30,7 @@
   cdpath=,,           printmbcharset=
   cedit=^F            printmbfont=
   charconvert=        printoptions=
-  cindent             prompt
+nocindent             prompt
   cinoptions=         pumheight=0
   cmdheight=1         quoteescape=\
   cmdwinheight=7    noreadonly
@@ -40,36 +41,36 @@
   conceallevel=0      report=2
   completefunc=     norevins
 noconfirm           norightleft
-nocopyindent          ruler
-  cpoptions=aAceFsB   rulerformat=
+nocopyindent        noruler
+  cpoptions=aABceFs   rulerformat=
   cryptmethod=zip     scroll=26
   cscopepathcomp=0  noscrollbind
   cscopequickfix=     scrolljump=1
-nocscoperelative      scrolloff=3
-  cscopetag         nosecure
+nocscoperelative      scrolloff=0
+nocscopetag         nosecure
   cscopetagorder=0    selectmode=
-  cscopeverbose       shell=/bin/zsh
+nocscopeverbose       shell=/bin/zsh
 nocursorbind          shellcmdflag=-c
 nocursorcolumn        shellquote=
   cursorline          shelltemp
   debug=              shellxquote=
 nodelcombine          shellxescape=
-  dictionary=         shiftround
+  dictionary=       noshiftround
 nodiff                shiftwidth=4
   diffexpr=         noshortname
   diffopt=filler      showbreak=
-nodigraph             showcmd
+nodigraph           noshowcmd
   display=lastline  noshowfulltag
   eadirection=both    showmatch
 noedcompatible        showmode
   encoding=utf-8      showtabline=1
   endofline           sidescroll=0
   equalalways         sidescrolloff=0
-  equalprg=           smartcase
-noerrorbells          smartindent
+  equalprg=         nosmartcase
+noerrorbells        nosmartindent
   esckeys           nosmarttab
-  eventignore=        softtabstop=4
-  expandtab         nospell
+  eventignore=        softtabstop=0
+noexpandtab         nospell
 noexrc                spellfile=
   fileencoding=       spelllang=en
   fileformat=unix     spellsuggest=best
@@ -83,65 +84,64 @@
   foldignore=#        synmaxcol=3000
   foldlevel=99        syntax=
   foldlevelstart=99   tabpagemax=50
-  foldmethod=indent   tabstop=4
+  foldmethod=manual   tabstop=4
   foldminlines=1      tagbsearch
   foldnestmax=20      taglength=0
   formatexpr=         tagrelative
-  formatprg=          tagstack
-  fsync             notermbidi
-  gdefault            termencoding=
-  guifont=          noterse
-  guifontwide=        textauto
-  guiheadroom=50    notextmode
-  guipty              textwidth=79
-  guitabtooltip=      thesaurus=
-  helpheight=20     notildeop
-  helplang=en         timeout
-  hidden              timeoutlen=1000
-  history=1000        title
-nohkmap               titlelen=85
-nohkmapp              titlestring=
-  hlsearch            ttimeout
-  icon                ttimeoutlen=100
-  iconstring=         ttybuiltin
-  ignorecase          ttyfast
-  imactivatefunc=     ttymouse=urxvt
-  imactivatekey=      ttyscroll=999
-noimcmdline           undodir=.
-noimdisable           undofile
-  iminsert=2          undolevels=1000
-  imsearch=2          undoreload=10000
-  imstatusfunc=       updatecount=200
-  includeexpr=        updatetime=2000
-  incsearch           verbose=0
-  indentexpr=         verbosefile=
-noinfercase           virtualedit=
-noinsertmode          visualbell
-  isprint=@,161-255   warn
-  joinspaces        noweirdinvert
-  key=                whichwrap=b,s
-  keymap=             wildchar=<Tab>
-  keymodel=           wildcharm=0
-  keywordprg=man      wildignore=
-  langmap=          nowildignorecase
-  langmenu=           wildmenu
-  laststatus=2        wildoptions=
-nolazyredraw          winaltkeys=menu
-nolinebreak           window=54
-  lines=55            winheight=1
-  linespace=0       nowinfixheight
-nolisp              nowinfixwidth
-  list                winminheight=1
-  loadplugins         winminwidth=1
-  magic               winwidth=20
-  makeef=             wrap
-  makeprg=make        wrapmargin=0
-  matchtime=5         wrapscan
-  maxcombine=2        write
-  maxfuncdepth=100  nowriteany
-  maxmapdepth=1000    writebackup
-  maxmem=4024614      writedelay=0
-  backspace=indent,eol,start
+  formatoptions=tcq   tagstack
+  formatprg=        notermbidi
+  fsync               termencoding=
+nogdefault          noterse
+  guifont=            textauto
+  guifontwide=      notextmode
+  guiheadroom=50      textwidth=0
+  guipty              thesaurus=
+  guitabtooltip=    notildeop
+  helpheight=20       timeout
+  helplang=en         timeoutlen=1000
+  hidden              title
+  history=50          titlelen=85
+nohkmap               titlestring=
+nohkmapp            nottimeout
+nohlsearch            ttimeoutlen=100
+  icon                ttybuiltin
+  iconstring=         ttyfast
+  ignorecase          ttymouse=urxvt
+  imactivatefunc=     ttyscroll=999
+  imactivatekey=      undodir=.
+noimcmdline         noundofile
+noimdisable           undolevels=1000
+  iminsert=2          undoreload=10000
+  imsearch=2          updatecount=200
+  imstatusfunc=       updatetime=2000
+  includeexpr=        verbose=0
+noincsearch           verbosefile=
+  indentexpr=         virtualedit=
+noinfercase           visualbell
+noinsertmode          warn
+  isprint=@,161-255 noweirdinvert
+  joinspaces          whichwrap=b,s
+  key=                wildchar=<Tab>
+  keymap=             wildcharm=0
+  keymodel=           wildignore=
+  keywordprg=man    nowildignorecase
+  langmap=            wildmenu
+  langmenu=           wildoptions=
+  laststatus=2        winaltkeys=menu
+nolazyredraw          window=54
+nolinebreak           winheight=1
+  lines=55          nowinfixheight
+  linespace=0       nowinfixwidth
+nolisp                winminheight=1
+  list                winminwidth=1
+  loadplugins         winwidth=20
+  magic               wrap
+  makeef=             wrapmargin=0
+  makeprg=make        wrapscan
+  matchtime=5         write
+  maxcombine=2      nowriteany
+  maxfuncdepth=100    writebackup
+  maxmapdepth=1000    writedelay=0
   backupdir=.,~/tmp,~/
   breakat= ^I!@*-+;:,./?
   casemap=internal,keepascii
@@ -163,7 +163,6 @@
   foldmarker={{{,}}}
   foldopen=block,hor,mark,percent,quickfix,search,tag,undo
   foldtext=foldtext()
-  formatoptions=qrn1
   formatlistpat=^\s*\d\+[\]:.)}\t ]\s*
   grepformat=%f:%l:%m,%f:%l%m,%f  %l%m
   grepprg=grep -nH $*
@@ -195,7 +194,7 @@
   sessionoptions=blank,buffers,curdir,folds,help,options,tabpages,winsize,tabpages,globals
   shellpipe=2>&1| tee
   shellredir=>%s 2>&1
-  shortmess=filnxtToOc
+  shortmess=filnxtToO
   spellcapcheck=[.?!]\_[\])'"^I ]\+
   statusline=%!airline#statusline(1)
   suffixes=.bak,~,.swp,.o,.info,.aux,.log,.dvi,.bbl,.blg,.brf,.cb,.ind,.idx,.ilg,.inx,.out,.toc,.png,.jpg

--- Options ---
  aleph=224           maxmemtot=4024614
noarabic              menuitems=25
  arabicshape         modeline
noallowrevins         modelines=0
noaltkeymap           modifiable
  ambiwidth=single  nomodified
noautochdir           more
  autoindent          mouse=a
  autoread          nomousefocus
noautowrite           mousehide
noautowriteall        mousemodel=extend
  background=dark     mousetime=500
nobackup              nrformats=hex
  backupcopy=auto   nonumber
  backupext=~         numberwidth=4
  backupskip=/tmp/*   omnifunc=
  balloondelay=600    operatorfunc=
noballooneval       nopaste
  balloonexpr=        pastetoggle=
nobinary              patchexpr=
nobomb                patchmode=
nobreakindent       nopreserveindent
  breakindentopt=     previewheight=12
  browsedir=last    nopreviewwindow
  bufhidden=          printdevice=
  buflisted           printencoding=
  buftype=            printfont=courier
  cdpath=,,           printmbcharset=
  cedit=^F            printmbfont=
  charconvert=        printoptions=
  cindent             prompt
  cinoptions=         pumheight=0
  cmdheight=1         quoteescape=\
  cmdwinheight=7    noreadonly
  colorcolumn=+1      redrawtime=2000
  columns=57          regexpengine=0
nocompatible          relativenumber
  concealcursor=      remap
  conceallevel=0      report=2
  completefunc=     norevins
noconfirm           norightleft
nocopyindent          ruler
  cpoptions=aAceFsB   rulerformat=
  cryptmethod=zip     scroll=26
  cscopepathcomp=0  noscrollbind
  cscopequickfix=     scrolljump=1
nocscoperelative      scrolloff=3
  cscopetag         nosecure
  cscopetagorder=0    selectmode=
  cscopeverbose       shell=/bin/zsh
nocursorbind          shellcmdflag=-c
nocursorcolumn        shellquote=
  cursorline          shelltemp
  debug=              shellxquote=
nodelcombine          shellxescape=
  dictionary=         shiftround
nodiff                shiftwidth=4
  diffexpr=         noshortname
  diffopt=filler      showbreak=
nodigraph             showcmd
  display=lastline  noshowfulltag
  eadirection=both    showmatch
noedcompatible        showmode
  encoding=utf-8      showtabline=1
  endofline           sidescroll=0
  equalalways         sidescrolloff=0
  equalprg=           smartcase
noerrorbells          smartindent
  esckeys           nosmarttab
  eventignore=        softtabstop=4
  expandtab         nospell
noexrc                spellfile=
  fileencoding=       spelllang=en
  fileformat=unix     spellsuggest=best
nofileignorecase    nosplitbelow
  filetype=         nosplitright
nofkmap               startofline
  foldclose=          suffixesadd=
  foldcolumn=0        swapfile
  foldenable          swapsync=fsync
  foldexpr=0          switchbuf=
  foldignore=#        synmaxcol=3000
  foldlevel=99        syntax=
  foldlevelstart=99   tabpagemax=50
  foldmethod=indent   tabstop=4
  foldminlines=1      tagbsearch
  foldnestmax=20      taglength=0
  formatexpr=         tagrelative
  formatprg=          tagstack
  fsync             notermbidi
  gdefault            termencoding=
  guifont=          noterse
  guifontwide=        textauto
  guiheadroom=50    notextmode
  guipty              textwidth=79
  guitabtooltip=      thesaurus=
  helpheight=20     notildeop
  helplang=en         timeout
  hidden              timeoutlen=1000
  history=1000        title
nohkmap               titlelen=85
nohkmapp              titlestring=
  hlsearch            ttimeout
  icon                ttimeoutlen=100
  iconstring=         ttybuiltin
  ignorecase          ttyfast
  imactivatefunc=     ttymouse=urxvt
  imactivatekey=      ttyscroll=999
noimcmdline           undodir=.
noimdisable           undofile
  iminsert=2          undolevels=1000
  imsearch=2          undoreload=10000
  imstatusfunc=       updatecount=200
  includeexpr=        updatetime=2000
  incsearch           verbose=0
  indentexpr=         verbosefile=
noinfercase           virtualedit=
noinsertmode          visualbell
  isprint=@,161-255   warn
  joinspaces        noweirdinvert
  key=                whichwrap=b,s
  keymap=             wildchar=<Tab>
  keymodel=           wildcharm=0
  keywordprg=man      wildignore=
  langmap=          nowildignorecase
  langmenu=           wildmenu
  laststatus=2        wildoptions=
nolazyredraw          winaltkeys=menu
nolinebreak           window=54
  lines=55            winheight=1
  linespace=0       nowinfixheight
nolisp              nowinfixwidth
  list                winminheight=1
  loadplugins         winminwidth=1
  magic               winwidth=20
  makeef=             wrap
  makeprg=make        wrapmargin=0
  matchtime=5         wrapscan
  maxcombine=2        write
  maxfuncdepth=100  nowriteany
  maxmapdepth=1000    writebackup
  maxmem=4024614      writedelay=0
  backspace=indent,eol,start
  backupdir=.,~/tmp,~/
  breakat= ^I!@*-+;:,./?
  casemap=internal,keepascii
  cinkeys=0{,0},0),:,0#,!^F,o,O,e
  cinwords=if,else,while,do,for,switch
  clipboard=autoselect,exclude:cons\|linux
  comments=s1:/*,mb:*,ex:*/,://,b:#,:%,:XCOMM,n:>,fb:-
  commentstring=/*%s*/
  complete=.,w,b,u,t
  completeopt=preview,menuone
  cscopeprg=/usr/bin/cscope
  define=^\s*#\s*define
  directory=.,~/tmp,/var/tmp,/tmp
  errorfile=errors.err
  errorformat=%*[^"]"%f"%*\D%l: %m,"%f"%*\D%l: %m,%-G%f:%l: (Each undeclared identifier is reported only once,%-G%f:%l: for each function it appears in.),%-GIn file included from %f:%l:%c:,%-GIn file included from %f:%l:%c\,,%-GIn file included from %f:%l:%c,%-GIn file included from %f:%l,%-G%*[ ]from %f:%l:%c,%-G%*[ ]from %f:%l:,%-G%*[ ]from %f:%l\,,%-G%*[ ]from %f:%l,%f:%l:%c:%m,%f(%l):%m,%f:%l:%m,"%f"\, line %l%*\D%c%*[^ ] %m,%D%*\a[%*\d]: Entering directory %*[`']%f',%X%*\a[%*\d]: Leaving directory %*[`']%f',%D%*\a: Entering directory %*[`']%f',%X%*\a: Leaving directory %*[`']%f',%DMaking %*\a in %f,%f|%l| %m
  fileencodings=ucs-bom,utf-8,default,latin1
  fileformats=unix,dos
  fillchars=vert:|,fold:-
  foldmarker={{{,}}}
  foldopen=block,hor,mark,percent,quickfix,search,tag,undo
  foldtext=foldtext()
  formatoptions=qrn1
  formatlistpat=^\s*\d\+[\]:.)}\t ]\s*
  grepformat=%f:%l:%m,%f:%l%m,%f  %l%m
  grepprg=grep -nH $*
  guicursor=n-v-c:block-Cursor/lCursor,ve:ver35-Cursor,o:hor50-Cursor,i-ci:ver25-Cursor/lCursor,r-cr:hor20-Cursor/lCursor,sm:block-Cursor-blinkwait175-blinkoff150-blinkon175
  guioptions=aegimrLtT
  guitablabel=%!TabooGuiTabTitle()
  helpfile=/usr/share/vim/vim74/doc/help.txt
  highlight=8:SpecialKey,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search,m:MoreMsg,M:ModeMsg,n:LineNr,N:CursorLineNr,r:Question,s:StatusLine,S:StatusLineNC,c:VertSplit,t:Title,v:Visual,V:VisualNOS,w:WarningMsg,W:WildMenu,f:Folded,F:FoldColumn,A:DiffAdd,C:DiffChange,D:DiffDelete,T:DiffText,>:SignColumn,-:Conceal,B:SpellBad,P:SpellCap,R:SpellRare,L:SpellLocal,+:Pmenu,=:PmenuSel,x:PmenuSbar,X:PmenuThumb,*:TabLine,#:TabLineSel,_:TabLineFill,!:CursorColumn,.:CursorLine,o:ColorColumn
  include=^\s*#\s*include
  indentkeys=0{,0},:,0#,!^F,o,O,e
  isfname=@,48-57,/,.,-,_,+,,,#,$,%,~,=
  isident=@,48-57,_,192-255
  iskeyword=@,48-57,_,192-255
  lispwords=defun,define,defmacro,set!,lambda,if,case,let,flet,let*,letrec,do,do*,define-syntax,let-syntax,letrec-syntax,destructuring-bind,defpackage,defparameter,defstruct,deftype,defvar,do-all-symbols,do-external-symbols,do-symbols,dolist,dotimes,ecase,etypecase,eval-when,labels,macrolet,multiple-value-bind,multiple-value-call,multiple-value-prog1,multiple-value-setq,prog1,progv,typecase,unless,unwind-protect,when,with-input-from-string,with-open-file,with-open-stream,with-output-to-string,with-package-iterator,define-condition,handler-bind,handler-case,restart-bind,restart-case,with-simple-restart,store-value,use-value,muffle-warning,abort,continue,with-slots,with-slots*,with-accessors,with-accessors*,defclass,defmethod,print-unreadable-object
  listchars=tab:· ,trail:·
  matchpairs=(:),{:},[:]
  maxmempattern=1000
  mkspellmem=460000,2000,500
  mouseshape=i-r:beam,s:updown,sd:udsizing,vs:leftright,vd:lrsizing,m:no,ml:up-arrow,v:rightup-arrow
  paragraphs=IPLPPPQPP TPHPLIPpLpItpplpipbp
  path=.,/usr/include,,
  printexpr=system('lpr' . (&printdevice == '' ? '' : ' -P' . &printdevice) . ' ' . v:fname_in) . delete(v:fname_in) + v:shell_error
  printheader=%<%f%h%m%=Page %N
  rightleftcmd=search
  runtimepath=~/.vim/vimfiles/bundle/CamelCaseMotion,~/.vim/vimfiles/bundle/DSnips,~/.vim/vimfiles/bundle/Omnisharp,~/.vim/vimfiles/bundle/YouCompleteMe,~/.vim/vimfiles/bundle/ctrlp.vim,~/.vim/vimfiles/bundle/d.vim,~/.vim/vimfiles/bundle/dcd,~/.vim/vimfiles/bundle/delimitMate,~/.vim/vimfiles/bundle/editorconfig-vim,~/.vim/vimfiles/bundle/matchit,~/.vim/vimfiles/bundle/moonscript-vim,~/.vim/vimfiles/bundle/nerdtree,~/.vim/vimfiles/bundle/rust,~/.vim/vimfiles/bundle/singlefiles,~/.vim/vimfiles/bundle/syntastic,~/.vim/vimfiles/bundle/taboo.vim,~/.vim/vimfiles/bundle/taglist,~/.vim/vimfiles/bundle/ultisnips,~/.vim/vimfiles/bundle/vim-airline,~/.vim/vimfiles/bundle/vim-colors-solarized,~/.vim/vimfiles/bundle/vim-commentary,~/.vim/vimfiles/bundle/vim-dispatch,~/.vim/vimfiles/bundle/vim-easy-align,~/.vim/vimfiles/bundle/vim-easymotion,~/.vim/vimfiles/bundle/vim-indent-guides,~/.vim/vimfiles/bundle/vim-jade,~/.vim/vimfiles/bundle/vim-lawrencium,~/.vim/vimfiles/bundle/vim-localvimrc,~/.vim/vimfiles/bundle/vim-misc,~/.vim/vimfiles/bundle/vim-multiple-cursors,~/.vim/vimfiles/bundle/vim-over,~/.vim/vimfiles/bundle/vim-ps1,~/.vim/vimfiles/bundle/vim-ragtag,~/.vim/vimfiles/bundle/vim-repeat,~/.vim/vimfiles/bundle/vim-session,~/.vim/vimfiles/bundle/vim-signature,~/.vim/vimfiles/bundle/vim-signify,~/.vim/vimfiles/bundle/vim-surround,~/.vim/vimfiles/bundle/vimroom,~/.vim/vimfiles/bundle/xml.vim,~/.vim,/usr/share/vim/vimfiles,/usr/share/vim/vim74,/usr/share/vim/vimfiles/after,~/.vim/after,~/.vim/vimfiles/bundle/ultisnips/after,~/.vim/vimfiles/bundle/rust/after
  scrollopt=ver,jump
  sections=SHNHH HUnhsh
  selection=inclusive
  sessionoptions=blank,buffers,curdir,folds,help,options,tabpages,winsize,tabpages,globals
  shellpipe=2>&1| tee
  shellredir=>%s 2>&1
  shortmess=filnxtToOc
  spellcapcheck=[.?!]\_[\])'"^I ]\+
  statusline=%!airline#statusline(1)
  suffixes=.bak,~,.swp,.o,.info,.aux,.log,.dvi,.bbl,.blg,.brf,.cb,.ind,.idx,.ilg,.inx,.out,.toc,.png,.jpg
  tabline=%!TabooTabline()
  tags=./tags,./TAGS,tags,TAGS
  term=rxvt-unicode-256color
  titleold=Thanks for flying Vim
  toolbar=icons,tooltips
  toolbariconsize=small
  ttytype=rxvt-unicode-256color
  viewdir=~/.vim/view
  viewoptions=folds,options,cursor
  viminfo='100,<50,s10,h
  wildmode=list:longest

答案1

不同之处在于添加shortmess了标志c。这是在 Vim 7.4.314 中添加的。从:help shortmessfor开始c

  c don't give |ins-completion-menu| messages.  For example,
    "-- XXX completion (YYY)", "match 1 of 2", "The only match",
    "Pattern not found", "Back at original", etc.

显然,这也会禁用CTRL-X菜单显示。YouCompleteMe 自动设置此设置,因为它不再-- User defined completion (^U^N^P) Pattern not found显示在屏幕底部。通常这是可取的(在某些情况下,此消息会闪烁,这真的很烦人)。

您可以通过c从 shortmess 中删除标志来解决此问题

set shortmess-=c

在 YouCompleteMe 设置它之后,它会YouCompleteMe#enable()在 VimEnter 上发生。

因此,在投入的过程中~/.vim/after/plugin/YouCompleteMe.vim

autocmd VimEnter set shortmess-=c

应该可以工作。(我还没有测试过,因为我现在没有 vim 7.4.314)


如果你不喜欢这种行为(或其中的一部分)。你可以将其作为错误报告给 vim 或 YouCompleteMe。

相关内容