Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to select SuperTab completion suggestion without creating new line?

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?

like image 548
Marco Avatar asked Oct 23 '11 23:10

Marco


2 Answers

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.

like image 180
ZyX Avatar answered Nov 14 '22 12:11

ZyX


Put this in your .vimrc

let g:SuperTabCrMapping=1
like image 44
moeabdol Avatar answered Nov 14 '22 11:11

moeabdol