2
我试图让vim让我通过tab键自动填充弹出列表。它适用于标签,但不适用于s-tab(shift-tab)。 看起来像shift-tab某种程度上取消了应用C-P之前的自动完成菜单vim omnicomplete与shift-tab不工作?
任何人有任何想法?
function InsertTabWrapper(direction)
if pumvisible()
if "forward" == a:direction
return "\<C-N>"
else
return "\<C-P>"
endif
endif
let col = col('.') - 1
if !col || getline('.')[col - 1] !~ '\k'
return "\<tab>"
else
return "\<c-x>\<c-o>"
endif
endfunction
inoremap <tab> <c-r>=InsertTabWrapper("forward")<cr>
inoremap <s-tab> <c-r>InsertTabWrapper("backward")<cr>
好像有人用你的代码留下深刻印象:。HTTP:/ /moviecode.tumblr.com/post/76605632708/the-intro-sequence-of-the-anime-time-of-eve – MOnsDaR 2014-02-14 08:53:44
OMG!我在RSS feed上看到帖子,但并没有意识到这是来自我的回答,尽管。 – tungd 2014-02-14 12:32:12