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