How to map ctrl x ctrl o ctrl space in vim terminal?

After searching for bits on the network, it seems that I cannot match Ctrl Space with anything / alot. Is there a way to do this today, what I found was usually 2 years.

+45
vim mapping omnicomplete
Oct 11 '11 at 6:31
source share
6 answers

I ran into the same problem, the short answer is yes, you can, and not just in the gui version. Adding this to you .vimrc enough:

 inoremap <C-Space> <Cx><Co> inoremap <C-@> <C-Space> 
+39
Sep 10 '12 at 1:25
source share

The problem is that Terminal.app does not correctly interpret <C-Space> , and Vim understands it as <C-@> , which is an inline display ( :help CTRL-@ ).

Maybe your .vimrc might be something like the following:

 if !has("gui_running") inoremap <C-@> <Cx><Co> endif 

which seems to work here, but I don't like the idea of โ€‹โ€‹overriding inline modules.

Instead, you should try with <Leader> ( :help leader ), this gives you great opportunities to define your own mappings and (depending on the mapleader you mapleader ) will not interfere with OS / app / restriction shortcuts and therefore be more portable .

With this in my .vimrc:

 let mapleader="," inoremap <leader>, <Cx><Co> 

I just clicked, to complete the method names.

+23
Oct 11 '11 at 12:07
source share

nitpicker violated pablox's decision. The essence of the decision was to reassign. Therefore, when you turn off remapping, this will not work.
If you really want to insert noremap , it looks like this:

 inoremap <expr><C-space> neocomplete#start_manual_complete() imap <C-@> <C-Space> 

What wo n't work: inoremap <C-@> <C-Space> ', because the <C-Space> will not be reassigned by itself.

+5
Jul 03 '14 at 10:08
source share
  • Have you tried :inoremap <c-space> <cx><co> ?
  • Does Ctrl X Ctrl O do anything when typing in paste mode? Is omnifunc ?
+3
Oct 11 2018-11-11T00
source share

Add the following code to ~/.vimrc :

 " Ctrl-Space for completions. Heck Yeah! inoremap <expr> <C-Space> pumvisible() \|\| &omnifunc == '' ? \ "\<lt>Cn>" : \ "\<lt>Cx>\<lt>Co><cr>=pumvisible() ?" . \ "\"\\<lt>cn>\\<lt>cp>\\<lt>cn>\" :" . \ "\" \\<lt>bs>\\<lt>Cn>\"\<CR>" imap <C-@> <C-Space> 

Source: https://coderwall.com/p/cl6cpq

+2
Aug 29 '14 at 21:27
source share

To host both Windows and Linux, I applied this to ~/.vimrc

 if has("unix") inoremap <C-@> <cx><co> elseif has("win32") inoremap <C-Space> <cx><co> endif 
+1
Aug 03 '17 at 19:59 on
source share



All Articles