Is it possible to map <C-Space> for vim

957 views
Skip to first unread message

vimim

unread,
Jan 27, 2010, 2:22:53 PM1/27/10
to mintty
Hi,

It looks like <C-Space> in mintty is hard-coded for <C-@> always, and
there is no way to disable it. The consequence is that error message
is showed when <C-Space> is pressed right after vim is opened.

It would be nice if <C-Space> mapping can be supported. At least, it
can be disabled, as
inomap <C-Space> <Nop>

Thanks

Sean

Andy Koppe

unread,
Jan 27, 2010, 2:44:49 PM1/27/10
to mintty
On Jan 27, 7:22 pm, vimim wrote:
> It looks like <C-Space> in mintty is hard-coded for <C-@> always, and
> there is no way to disable it. The consequence is that error message
> is showed when <C-Space> is pressed right after vim is opened.

I don't understand. Is someone forcing you to press Ctrl+Space?

> It would be nice if <C-Space> mapping can be supported. At least, it
> can be disabled, as
> inomap <C-Space> <Nop>

Just map ^@. No, I don't know what the vimrc syntax for that is.

Andy

vimim

unread,
Jan 27, 2010, 3:37:50 PM1/27/10
to mintty
Cool, it does work!!!

In case someone asks for how <C-Space> is mapped for MinTTY console
vim,
I am copying the correct syntax below (working code snip from VimIM)
" ---------------------------------------
function! s:vimim_ctrl_space_mapping_on()
" ---------------------------------------
if s:vimim_ctrl_space_to_toggle > 0
if has("gui_running")
nmap <C-Space> <C-Bslash>
imap <C-Space> <C-Bslash>
elseif has("win32unix")
nmap <C-@> <C-Bslash>
imap <C-@> <C-Bslash>
endif
endif
endfunction

Thanks Andy. It saves me lots of headache.

Now, from end-user point of view, it is the same:
<C-Space> works the same way for gVim on Windows and vim under WinTTY
console.

Sean

Reply all
Reply to author
Forward
0 new messages