10

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?

Keith Thompson
  • 254,901
  • 44
  • 429
  • 631
Marco
  • 4,345
  • 6
  • 43
  • 77

2 Answers2

8
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.

ZyX
  • 52,536
  • 7
  • 114
  • 135
6

Put this in your .vimrc

let g:SuperTabCrMapping=1
moeabdol
  • 4,779
  • 6
  • 44
  • 43