On Sat, Aug 5, 2017 at 1:03 AM, Pablo Giménez <pablog...@gmail.com> wrote: > Hello, I would like to map CTRL-[ to do the same action as CTRL-T, or in > other words > to go back one step in the tag stack, doing a :pop command. > It makes a lot of sense to me to use CTRL-] to go forward and CTRL-[ to go > backwards > in the stack. > > But for vim ESC and CTRL-[ seems to be the same keystroke and when I map > CTRL-[ > it also affects the ESC key, so I can't get out from insert mode using it > anymore. > Is there any way to accomplish this? > This is how I am mapping CTRL-[ now: > > nnoremap <silent> <C-[> <C-T> > vnoremap <silent> <C-[> <C-T> > inoremap <silent> <C-[> <C-T> > > Thanks. > -- > Un saludo > Best Regards > Pablo Giménez
Yes, Vim inherits this ultimately from early ASCII teletypes, which had no separate function keys, so Esc and Ctrl-[ are both seen as 0x1B. Similarly Backspace and Ctrl-H, Tab and Ctrl-I, Ctrl-(any letter a-z) with or without Shift, etc. This can just as well be seen as a feature: if your Esc key is too far out of the way, you can use Ctrl-[ instead. But as you found out, mapping either of them applies also to the other. 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+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.