Monday, February 22, 2016

Re: List of potential insert mode control character mappings?


On Feb 22, 2016 1:38 PM, "Josef Fortier" <josef.fortier@gmail.com> wrote:
>
> Just some followup on my original request for consensus advice on what insert mode mappings could be reasonably available. Some (at least tentative) conclusions:
>
> There aren't really any non-mapped insert mode control characters, which means "stealing" and re- purposing existing mappings.
>
> SAFE
>
> <C-J> is the most common candidate. It's NewLine, as opposed to C-M/Return, something that's almost never actually typed. It's also something that would lend itself to overloading, i.e. remap to add functionality and also return <NL>. And, importantly it's easy to hit.
>
> <C-L> is almost certainly usefully re-purposed. It's original purpose, to aid using vim in an "always insert" mode is almost always going to be unused.
>
> <C-G> <C-\> likewise are intended for insertmode.
>
> REASONABLE
>
> <C-_> (or <C-?>) This is mapped to switch keyboards, a use case I'm not all that familiar with. But I suspect even in an alternate keyboard situation it's reasonable to give up a hot key and instead map the functionality to a command. This doesn't seem that useful off the top (undescore is typically awkward to type which effects the primary use case for insert mode mappings) but... it turns out that all the terminal environments I've tested map <C-?> to <C-_> which makes this mapping *much* more useful. Question mark is prime 101 keyboard territory (as opposed to underscore).

<C-_> is even more conveniently provided by <C-/>, at least on US keyboards. (I'm sort of surprised that <C-?> doesn't do the same as DEL, since often that's notated as <C-?> or <^?>.)

>
> REASONABLE WITH QUALIFICATIONS
>
> <C-F><C-T><C-D> These are all intended to adjust indentation on the fly. It could be argued that normal mode are almost always the way to do this. But there is also a large degree of overlap here. For the most common use case scenario, adjusting pasted in text, <C-F> most likely is all that's really needed (YMMV).

I personally use <C-T>/<C-D> when for whatever reason indentation isn't set up right after I hit enter. That probably should be done in normal mode, but it's convenient to have it in insert mode, sort of like the arrow keys.

>
> <C-S><C-Q> are terminal flow control. They're really only useful if your terminal is set to ignore flow control (a very reasonable step, but not one that's done by default).

--
--
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: