Question about mapping C-C in macvim

Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Question about mapping C-C in macvim

Filippo Salustri
I have this in my .vimrc: nnoremap <C-X><C-F> :edit<Space> and it works fine.

But this: nnoremap <C-X><C-C> :edit<Space> doesn't work.
It produces the message: Type :qa and press <Enter> to exit Vim 
Even this: nnoremap <C-a><C-c> :echo 1<CR> produces the same message.

The only difference is the <C-C>. 
Every other binding I have works fine.  None of them rebind <C-C>.

I have looked everywhere I know, and I cannot find an explanation.
Can someone help me diagnose this?

--
--
You received this message from the "vim_mac" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_mac" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_mac/56a3a538-1265-4b5e-9935-9b90a1ce598a%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: Question about mapping C-C in macvim

Aymen Hafeez
On 21/05/2020 23:58, Filippo Salustri wrote:

> I have this in my .vimrc: nnoremap <C-X><C-F> :edit<Space> and it works
> fine.
>
> But this: nnoremap <C-X><C-C> :edit<Space> doesn't work.
> It produces the message: Type :qa and press <Enter> to exit Vim
> Even this: nnoremap <C-a><C-c> :echo 1<CR> produces the same message.
>
> The only difference is the <C-C>.
> Every other binding I have works fine.  None of them rebind <C-C>.
>
> I have looked everywhere I know, and I cannot find an explanation.
> Can someone help me diagnose this?
>

I tested the command on Linux and it seems to work as expected, so I
don't know if this is a macvim specific issue. In normal mode CTRL-C
aborts the pending command, but from :help map-CTRL-C,

"Using CTRL-C in the {lhs} is possible, but it will only work when Vim
is waiting for a key, not when Vim is busy with something.  When Vim is
busy CTRL-C interrupts/breaks the command. When using the GUI version on
MS-Windows CTRL-C can be mapped to allow a Copy command to the
clipboard. Use CTRL-Break to interrupt Vim.",

so it should work. Have you tried it in Vim from the terminal?

Regards,

-- Aymen --

--
--
You received this message from the "vim_mac" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_mac" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_mac/6b4906a2-16a2-8662-5406-1346189c7db4%40gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: Question about mapping C-C in macvim

Filippo Salustri
In reply to this post by Filippo Salustri
I have an answer: Thanks to a redditor (link to reddit thread here): bind <C-C> to something on its own before using it for anything else - e.g., I put nnoremap <C-c> :echo 1<Cr> before any bindings involving <C-C> and now it works on all my platforms, vim, gvim, macvim on Mac and crostini.

On Friday, 22 May 2020 07:31:35 UTC-4, Filippo Salustri wrote:
I have this in my .vimrc: nnoremap <C-X><C-F> :edit<Space> and it works fine.

But this: nnoremap <C-X><C-C> :edit<Space> doesn't work.
It produces the message: Type :qa and press <Enter> to exit Vim 
Even this: nnoremap <C-a><C-c> :echo 1<CR> produces the same message.

The only difference is the <C-C>. 
Every other binding I have works fine.  None of them rebind <C-C>.

I have looked everywhere I know, and I cannot find an explanation.
Can someone help me diagnose this?

--
--
You received this message from the "vim_mac" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_mac" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_mac/65aff26d-38e5-4f82-9e11-93edfc96652d%40googlegroups.com.