Thursday, January 14, 2021

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

Den tors 14 jan. 2021 09:06Tony Mechelynck <antoine.mechelynck@gmail.com> 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 vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CADAJKhDBoEwddcAZDDK65Z6uq_BzT480mQgrzp9YvbWqoJ6VkA%40mail.gmail.com.

No comments:

Post a Comment