Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Vim: reserved control sequences

I would not remap any of these:

<C-@> and <C-A>: Repeat last insert (and automatically escape with <C-@>). These are basically the same as <C-R>.. Indispensable once you get used to them.
<C-D> and <C-T>: Change indent level even if you're not at the beginning of the line. Handy, but I don't use it much.
<C-E> and <C-Y>: Copy character from below/above the cursor. Sort of useful, not terribly. But not having them would drive me nuts.
<C-G>: A prefix key. I don't really care about <C-G>u to split the insert into multiple undo levels. Almost no one uses <C-G>j/<C-G>k to start a new insert a line down/up at the same column the current insert started on, but I'm a huge fan. I wouldn't touch this.
<C-I>: This is literally the same as <Tab>. Don't you dare touch this.
<C-M>: This is literally the same character you get from hitting Enter. Don't you dare touch this.
<C-N> and <C-P>: Basic word completion. Extremely useful. I would never touch this.
<C-O>: Return to insert after a single normal command. You can always just use escape. Has its uses though.
<C-Q> and <C-S>: Since these are used by terminals for the locking feature, they're unbound in basically every terminal program. That makes them great candidates for screen/tmux prefixes (if you disable the locking feature first). Generally not safe for portable remapping though.
<C-R>: Like pasting registers from insert mode. This is extremely useful and should not be touched.
<C-U> and <C-W>: Delete line/word. Extremely useful. Works similar but not exactly the same as in cooked terminal though, which is frustrating...
<C-V>: Insert literal characters. I use this a lot.
<C-X>: A prefix to several completion functions. I would say <C-X><C-F> is probably the most indispensable (complete filename), but a lot of them are handy. Read :help i^X to learn about them all.
<C-[>: This is literally <Esc>. Don't you dare touch it.
I wouldn't mind remapping these:
<C-B>: This is safe.
<C-C>: Really escape. I'm not a big fan.
<C-F>: This is safe.
<C-H> and <C-?>: These behave the same as backspace, but they aren't literally backspace. I wouldn't mind too much if I lost these.
<C-J>: Literal newline. Not used too much in its own right. If mappings worked in <C-R> pastes, remapping this would mess up your multiline pastes, but since they don't, it should be safe to remap.
<C-K>: Digraphs. I don't use them. If you just need occasional characters maybe, like a single Greek character or a way to type an em dash, they're fine. If you try to type in a foreign script using this feature, God help you.
<C-L>: This is safe.
<C-Z>: In a terminal, backgrounds Vim, though it shouldn't do that in insert mode.
<C-\>: This is mostly safe. If you're using <C-O> in mappings, you should probably use <C-\><C-O> instead, so the cursor doesn't shift inconsistently if you're at the end of the line. It's very unlikely I'd use that outside of mappings though.
<C-]>: Abbreviations. I've never used this.
<C-^>: Useless in insert mode.
<C-_>: Toggling reverse insert (if you have some special nondefault settings). Useless for almost everyone.


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment