Skip to content
Advertisement

Change key binding for autocomplete in haskell-vim-now

I have installed the Vim plugin haskell-vim-now in Ubuntu 14.04 LTS and in Xubuntu 14.04 LTS.

After using the plugin in Ubuntu, I could use the autocompletion with Ctrl-space. However, when I installed it in Xubuntu, the Ctrl-space key would not work. The only way I made the autocompletion work was with the key Ctrl-@.

I looked in the .vimrc file generated by haskell-vim-now, and the problem seems to be in the following line:

inoremap <Nul> <c-r>=SuperTabAlternateCompletion("<lt>c-x><lt>c-o>")<cr>

It seems to me that <Nul> binds to Ctrl-space in Ubuntu and to Ctrl-@ in Xubuntu.

How can I change the configuration so that <Nul> binds to Ctrl-space in Xubuntu (so that autocompletion may be done with Ctrl-space).

Thanks in advance for your answers.

Advertisement

Answer

You just edit that line in your ~/.vimrc to:

inoremap <c-space> <c-r>=SuperTabAlternateCompletion("<lt>c-x><lt>c-o>")<cr>

Mappings take the following basic form: {mode}map {key} {lhs}. For more information on mappings see :h :map as well as :h key-notation.

Haskell-vim-now is not a plugin it is a more like vim config distribution. Now from what I see Haskell-vim-now seems to try and play as nice as possible for a vim distribution, but it still installs many vim plugins and makes many customizations. Such numerously and rapid changes to a newer vimmer’s config often causes confusion because they are both using someone else’s customization and they did not learn all the intermediary Vim steps. So I caution you against such distribution and to slowly build up your own vimrc as you learn.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement