Monday, December 17, 2018

Re: remap C-\ to a different C- key ?

On Mon, Dec 17, 2018 at 3:56 PM M Kelly <mckelly2833@gmail.com> wrote:
>
> Hi,
>
> If the window mgr grabs C-\ then I don't think it will work ?
> I did test but will test again, I propably messed something up.

As Christan said, if you map something else to Ctrl-\ the Ctrl-\ will
never be actually generated and your window manager won't see it. For
instance, if you add to your vimrc
noremap <F6> <C-\>
noremap! <F6> <C-\>
then save it and restart Vim, when you hit F6 your window manager will
see F6, pass it to Vim, which will interpret it as having the function
of Ctrl-\.

It is not needed to unmap Ctrl-\, you can have several keys for a
single function. If you do
:map <C-\> <Nop>
then Vim won't act on the Ctrl-\ key combo even if the winmanager
doesn't grab it but it will still act on the :noremap'ped F6.

>
> I think what I'm hoping for is if perhaps we knew something like:
> C-\ calls function foo() ...

By default, Ctrl-\ calls different functions in C depending on
context, we have no access to those; but if we map something to <C-\>
it will call those same C functions in the same contexts, and the
winmanager will never see a Ctrl-\

> then I can unmap C-\ and map C-x (or S-F12) to call function foo()
> and then I get the same functionality from a different key sequence
> and the window mgr can grab C-\ all it wants.
>
> thx so much for your help,
> -m

Best regards,
Tony.

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment