从今天早上起,我正在寻找一个没有任何运气的解决方案。你能告诉我如何禁用当我按TAB时出现的这个东西吗?
这是我的.vimrc文件:
set nocompatible
filetype off
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
" This is the Vundle package, which can be found on GitHub.
" For GitHub repos, you specify plugins using the
" 'user/repository' format
Plugin 'gmarik/vundle'
" We could also add repositories with a ".git" extension
Plugin 'scrooloose/nerdtree.git'
" To get plugins from Vim Scripts, you can reference the plugin
" by name as it appears on the site
Plugin 'Buffergator'
" Syntax hihgler
Plugin 'scrooloose/syntastic'
" Pluginper gli snippet
Plugin 'msanders/snipmate.vim'
" Plugin per la gestione delle parentesi, per maggiori informazioni: https://github.com/jiangmiao/auto-pairs
Plugin 'jiangmiao/auto-pairs'
" Now we can turn our filetype functionality back on
filetype plugin indent on
" Enable syntax high.
syntax on
" Set the default charset
set encoding=utf-8 nobomb
" Enable line number
set number
" Highligth cursor line
set cursorline
" Set tab as 2 white space
set tabstop=4
set shiftwidth=4
set softtabstop=4
set expandtab
" Enable mouse in all mode
set mouse=a
" Show the cursor position
set ruler
" Show the filename inside the titlebar
set title
" Strip trailing whitespace (,ss)
function! StripWhitespace()
let save_cursor = getpos(".")
let old_query = getreg('/')
:%s/\s\+$//e
call setpos('.', save_cursor)
call setreg('/', old_query)
endfunction
" Map CTRL+n to toggle nerdtree
map <C-n> :NERDTreeToggle<CR>
" close vim if the only window left open is a NERDTree
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif
filetype plugin on
" More Common Settings.
set scrolloff=3
set autoindent
set showmode
set hidden
set visualbell
答案 0 :(得分:3)
您似乎已输入 CTRL N CTRL P ,如屏幕截图底部所示。< / p>
这是关键字完成的默认键。您可能会尝试使用:verbose imap <Tab>
找出 TAB 重新映射到完成的原因和位置,它会显示重新定义的最后位置。
我会怀疑SuperTab之类的东西使用 TAB 进行各种完成,但我不会在.vimrc中看到它。
答案 1 :(得分:1)
可以通过<c-y>
停止完成以停止并接受当前完成,或通过<c-e>
停止完成并恢复完成前的文本。但是,停止完成的最常用方法是键入空格或符号等非关键字字符。
应该注意,默认情况下,Vim在插入模式下不会在<tab>
上完成。相反,它使用<c-n>
和<c-p>
。如果在<tab>
上完成,那么您可能希望通过:verbose imap <tab>
跟踪@FDinoff建议的映射。
如需更多帮助,请参阅:
:h ins-completion