How to select SuperTab completion suggestion without creating new line?

空扰寡人 提交于 2019-12-23 07:39:17

问题


When I hit Enter on SuperTab's popup suggestion, it automatically creates a new line at the end of the inserted keyword.

Is it possible to select an option in the SuperTab popup without creating a new line?

More specifically, is there a way for me to configure space as the method of selecting the code completion suggestion?


回答1:


inoremap <expr> <Space> pumvisible() ? "\<C-y>" : " "

Note the <C-y> that accepts currently selected option, you may want to use it directly instead of remapping space. You will see more in :h popupmenu-keys.




回答2:


Put this in your .vimrc

let g:SuperTabCrMapping=1


来源:https://stackoverflow.com/questions/7870086/how-to-select-supertab-completion-suggestion-without-creating-new-line

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!