2 ms·
It’s equivalent in any terminal, not just in vim. ASCII “control” characters are paired up nicely with the letters and punctuation on a keyboard. Instead of h
by gorgoiler 4y ago
It’s equivalent in any terminal, not just in vim. ASCII “control” characters are paired up nicely with the letters and punctuation on a keyboard. Instead of having a key for each letter and another key for each control code, the control code can instead be typed by holding the control key and pressing the equivalent letter. This is why it is called the control key.
The pairings are offset by 0100 in octal. The octal ordinal for escape is 033. 0133 maps to [ so ^[ (control-open-square-bracket) is equivalent to escape.
Some other common ones are: line feed/^J, backspace/^H, tab/^I, and end-of-transmission/^D. If you ever type “exit<enter>” to end a shell session you can do the same with ^D.
Similarly of course you don’t have keys for upper and lower case letters. You use the shift key for that, which shifts the code by 040 instead of 0100. Technically it’s down by 040 because while most keys are labelled in capitals their default behaviour is to send the lower case letter.
- vram22 4y ago>Some other common ones are: line feed/^J, backspace/^H, tab/^I, and end-of-transmission/^D. If you ever type “exit<enter>” to end a shell session you can do the same with ^D. Yes. Also line feed/^J, form feed/^L, carriage return/^M. And, related: anyone not knowing the basics of vi, can check out my vi quickstart tutorial below. I had first written it at the request of two Windows sysadmin friends of mine, in a company where I was working at the time. They had been given additional charge of two Unix boxes and I wrote the tutorial to enable them to hit the ground running with common sysadmin editing tasks. After reading it and using Unix for a few days, they told me that it was useful and met their need. The tutorial is small, so it can be read soon and you can start applying it right away: https://vasudevram.gumroad.com/l/vi_quick?layout=profile https://vasudevram.gumroad.com/l/vi_quick?layout=profile