4 ms·
If you use ‘vi’, in insert mode, it’s CTRL-V then tap escape button. Followed by [31m or whatever code.
by cyberge99 5y ago
If you use ‘vi’, in insert mode, it’s CTRL-V then tap escape button. Followed by [31m or whatever code.
- fanf2 5y agoCTRL-V is a common "quote the next character" input command: it's specified by POSIX (https://pubs.opengroup.org/onlinepubs/9699919799.2018edition/utilities/sh.html https://pubs.opengroup.org/onlinepubs/9699919799.2018edition... https://pubs.opengroup.org/onlinepubs/9699919799.2018edition/utilities/vi.html https://pubs.opengroup.org/onlinepubs/9699919799.2018edition...) and it works in bash (in vi mode and emacs mode) and zsh It also works with just the bare terminal line discipline in many flavours of unix: look at the 'lnext' control character in the output from 'stty' on Linux, macOS, or BSD (but not POSIX). (however the equivalent in emacs itself is ctrl-Q, probably for bad reasons)
- skissane 5y ago> (however the equivalent in emacs itself is ctrl-Q, probably for bad reasons) Good reasons: 1) Q is mnemonic for Quote. 2) emacs began life on non-Unix platforms (ITS, TOPS-20, Multics), and was only ported to Unix later. Ctrl-Q is inherited from the original ITS emacs.