vim terminal - cannot generate C-Space (C-@)

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

vim terminal - cannot generate C-Space (C-@)

mckel...@gmail.com
Hi,

Thank you for awesome vim!

In a vim terminal I cannot seem to get a C-@ key.
This works fine in vim itself and at a normal shell prompt, but not inside a vim terminal.
Is this supported ?  Is there something I need to add (tmap etc.) ?

thanks for any/all help,
-m

--
--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/984ee63e-7557-481a-b23a-7b541ad15412n%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: vim terminal - cannot generate C-Space (C-@)

mckel...@gmail.com
Hi,

Just more info, I am using version 8.2.2184, on Ubuntu 18.04

thx,
-m
On Monday, December 21, 2020 at 11:46:46 AM UTC-5 [hidden email] wrote:
Hi,

Thank you for awesome vim!

In a vim terminal I cannot seem to get a C-@ key.
This works fine in vim itself and at a normal shell prompt, but not inside a vim terminal.
Is this supported ?  Is there something I need to add (tmap etc.) ?

thanks for any/all help,
-m

--
--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/3a0bd13a-cd09-4916-8eac-1ee74bbb217en%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: vim terminal - cannot generate C-Space (C-@)

mckel...@gmail.com
Hi again,

Just fyi, I think adding this helps -

    tnoremap <C-@> <C-Space>

Not sure why, and will keep trying different things.

take care,
-m

On Monday, December 21, 2020 at 4:10:40 PM UTC-5 [hidden email] wrote:
Hi,

Just more info, I am using version 8.2.2184, on Ubuntu 18.04

thx,
-m
On Monday, December 21, 2020 at 11:46:46 AM UTC-5 [hidden email] wrote:
Hi,

Thank you for awesome vim!

In a vim terminal I cannot seem to get a C-@ key.
This works fine in vim itself and at a normal shell prompt, but not inside a vim terminal.
Is this supported ?  Is there something I need to add (tmap etc.) ?

thanks for any/all help,
-m

--
--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/ea8b7914-ac3a-41bd-aea7-d22122fd60a8n%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: vim terminal - cannot generate C-Space (C-@)

Tony Mechelynck
On Wed, Jan 13, 2021 at 6:17 PM [hidden email]
<[hidden email]> wrote:

>
> Hi again,
>
> Just fyi, I think adding this helps -
>
>     tnoremap <C-@> <C-Space>
>
> Not sure why, and will keep trying different things.
>
> take care,
> -m
>
> On Monday, December 21, 2020 at 4:10:40 PM UTC-5 [hidden email] wrote:
>>
>> Hi,
>>
>> Just more info, I am using version 8.2.2184, on Ubuntu 18.04
>>
>> thx,
>> -m
>> On Monday, December 21, 2020 at 11:46:46 AM UTC-5 [hidden email] wrote:
>>>
>>> Hi,
>>>
>>> Thank you for awesome vim!
>>>
>>> In a vim terminal I cannot seem to get a C-@ key.
>>> This works fine in vim itself and at a normal shell prompt, but not inside a vim terminal.
>>> Is this supported ?  Is there something I need to add (tmap etc.) ?
>>>
>>> thanks for any/all help,
>>> -m
>>>

There are keystrokes which are difficult to get on some keyboard
layouts or on some terminals. A workaround is to define a mapping with
the desired keystroke as {rhs} and something which you know how to
type, but don't need in Vim, as {lhs}. Here is an example:

When I started using Vim, I couldn't find how to get Ctrl-] on my
AZERTY keyboard. Now that's an extremely useful keystroke in Vim: in
Normal mode it finds tags (and when in the help, it follows hotlinks),
and in Insert mode it triggers an abbreviation (if there is one) for
whatever has just been typed without inserting an additional
character. Finally I added the following to my vimrc:

if exists(':map') == 2
  map    <F9>    <C-]>
  map!   <F9>    <C-]>
endif

Now I can follow help links with just F9 (in +eval buids because of
the :if wrapper; in any +mouse builds I can also use a double-click,
and all builds are compiled with +mouse nowadays). Years later, I
found how to get Ctrl-] on my keyboard: it's Ctrl-AltGr-$ where $ is
the key at the end of the top alphabet row, two keys to the right of
the P in AZERTYUIOP. Now that's a fairly complicated (three-finger)
keystroke combination, so I keep using F9 (and sometimes a double
click).

Maybe you can easily get Ctrl-] on your keyboard; but similar mappings
can be used for any difficult-to-reach keystrokes, keystrokes not
available on your keyboard layout in one or more of Vim's modes, or
even just keystrokes for which an alternative is desired.

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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CAJkCKXt2z36YMchcT4_K4%2Br4hPkfG51%2BVTaxMyQozDC3BmnPdw%40mail.gmail.com.
BPJ
Reply | Threaded
Open this post in threaded view
|

Re: vim terminal - cannot generate C-Space (C-@)

BPJ
Den tors 14 jan. 2021 09:06Tony Mechelynck <[hidden email]> skrev:

> There are keystrokes which are difficult to get on some keyboard
> layouts or on some terminals. A workaround is to define a mapping with
> the desired keystroke as {rhs} and something which you know how to
> type, but don't need in Vim, as {lhs}.

Since I have cerebral palsy it is difficult for me to press more than one key at the same time, especially with the same hand, so I have remapped most commands which involve pressing two keys simultaneously to sequences starting with an F-key which I can press one after another. This was before I discovered sticky keys, but I still prefer my remappings to sticky keys. In fact this was the reason I started to use Vim in the first place, although it is not the main reason I stay with Vim and do almost everything in Vim. :-) I also use other applications with a Vi(m)-like interface like Zathura, or plugins which allow the use of Vi(m) style key sequences in things like web browsers and mail clients. I also use several key maps so that I easily can type "special" characters and other scripts — including a hack so that I quickly can switch keymaps just by pressing a sequence of two keys.[^1] I use a mouse too — actually a trackball attached to my laptop — but precision pointing, and GUIs in general, just isn't my thing!

[^1]: <https://git.io/JtJI3> I haven't kept the keymaps in that repo up to date with what's on my local machine but those autoload functions for switching keymaps and defining mappings to do it are the same. Basically I type something like <F11>g to switch to a keymap for Ancient Greek, then I type <F11><F11> to disable it *or* switch to the previously used keymap if a keymap was active when I switched to Greek, then I can type <F11><F11> again to switch back to Greek, e.g. <F11>x to switch to a mapping between modified X-SAMPA <https://w.wiki/uKk> and Unicode IPA, or <F11>0 (zero) to switch to no keymap at all, all without leaving insert mode. This is achieved with two per-buffer variables which store the previous and the current value of the 'keymap' option, with the empty string being a possible value meaning that no keymap is active. There also is a helper function so that I can define multiple mappings with a common prefix trough a Dictionary in my .vimrc.

--
--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CADAJKhDBoEwddcAZDDK65Z6uq_BzT480mQgrzp9YvbWqoJ6VkA%40mail.gmail.com.