7 ms·
ASCII 0-31 are called "control" characters so it should come as no surprise that you could type them using the Control key. Unit Separator is Control-_ (unders
by scelerat 13y ago
ASCII 0-31 are called "control" characters so it should come as no surprise that you could type them using the Control key.
Unit Separator is Control-_ (underscore) and Record Separator is Control-^ (caret), for instance.
Most modern text editors won't pass through every control character. Vim lets me type the unit separator, but not the record separator, for instance.
Control-C and Control-D, End of Text and End of Transmission, still have utility in most shells, and it goes back directly to these ASCII control characters.
https://www.cs.tut.fi/~jkorpela/chars/c0.html https://www.cs.tut.fi/~jkorpela/chars/c0.html
- Pxtl 13y agoHuh. I wonder how many of those are completely disused, or would be meaningless in a file?
- npongratz 13y agoVim will let you type the record separator, but you may have to precede it with Ctrl-V. In other words, type the Ctrl-V Ctrl-^ key sequence. At least, that worked for me. Interesting that the unit separator does not have the same requirement to precede it with Ctrl-V. More info in the vim docs: http://vimdoc.sourceforge.net/htmldoc/insert.html#ins-special-keys http://vimdoc.sourceforge.net/htmldoc/insert.html#ins-specia...
- groovy2shoes 13y agoYes, Ctrl-V in {insert,command} mode lets you input literal control characters, as well as numeric codes (31 for unit separator, 30 for record separator). If you're using vim on Windows, however, note that the default vimrc loads mswin.vim which changes Ctrl-V to paste. In that case, you can simply remove mswin.vim from your vimrc or use Ctrl-Q instead. (See :h i_Ctrl-V). You can also use Ctrl-K to enter RFC1345 digraphs, in which case unit separator is 'Ctrl-K US' and record separator is 'Ctrl-K RS'. (See :h Ctrl-K). Emacs has similar features, as well as a nifty TeX input mode: http://stackoverflow.com/q/6269618 http://stackoverflow.com/q/6269618
- thwarted 13y agoUnit Separator is Control-_ (underscore) and Record Separator is Control-^ (caret), for instance. Most modern text editors won't pass through every control character. Vim lets me type the unit separator, but not the record separator, for instance. Vim has bindings for some control key combos, which is why you can't type them directly. I can type control-_ without issue, but to get an ASCII 30 (RS) to show up, I have to type control-v first (just like when at the shell prompt). Useful hint: if you look at the output of man ascii (at least on linux with man-pages-3.22) find the control character you want to type in the left column and look in the same row on in the right column to find the letter/key to use with the control key. For example, to type NAK, it's <control-u>. Vertical tab is <control-k>: $ echo <control-v><control-k> | od -c 0000000 \v \n This is useful for control characters that don't have backslash escape expansions.
- raldi 13y ago...and that's why, when running a command that's reading what you're typing to stdin, you press Ctrl-D to tell it that you're done. Because, as your "man ascii" trick shows, this generates the "end of transmission" character. Similarly, Ctrl-L clears the screen in most Unix apps because that generates the "form feed" character, and on a line printer or paper-based teletype terminal, "form feed" means to advance to the next page -- a nice empty clear piece of paper.
- sopooneo 13y agowhat about Ctrl-C to break out of stuff? Does that correspond to an ascii control character?
- jrochkind1 13y ago> Unit Separator is Control-_ (underscore) and Record Separator is Control-^ (caret), for instance. And this is in fact how they show up in vim (or at least my fairly uncustomized vim), using ^ to stand for ctrl as was once conventional: `^_` and `^^` The legacy MARC binary format still used for library data uses ascii 29, 30, and 31 -- although for reasons with probably some bizarre historical definition uses them DIFFERENTLY than defined in ascii. 0x1D == 29 == ascii group seperator == MARC Record separator 0x1E == 30 == ascii record seperator == MARC Field Terminator 0x1F == 31 == ascii unit separator == MARC subfield seperator http://en.wikipedia.org/wiki/MARC_standards http://en.wikipedia.org/wiki/MARC_standards
- pjbrunet 13y agoBack in the day with a numeric keypad you could type Alt-(number) to get any ASCII character, but not sure if that still works. In Firefox apparently Alt-1 takes you to the first tab, Alt-2 second tab...
- Terretta 13y agoAlt-(3 digits)
- BorgHunter 13y agoIn most graphical *nix environments that I'm familiar with, if you hold Control and Shift¹ and type U, you can type any Unicode character by its (hex) code point. For instance, if you want an em dash, which is U+2014, hold Control and Shift, and type "U2014". ¹You can release Control and Shift after typing "U", in which case the character will appear after you type a space. Or, you can hold Control and Shift while typing the code point, in which case the character will appear after you release either modifier key.
- pjbrunet 13y agoI just tried in Debian, works! Very handy.
- chinpokomon 13y ago