Standard escape codes are prefixed with Escape:
- Ctrl-Key:
^[ - Octal:
\033 - Unicode:
\u001b - Hexadecimal:
\x1B - Decimal:
27
| // ============================================================================= | |
| // XNU kperf/kpc demo | |
| // Available for 64-bit Intel/Apple Silicon, macOS/iOS, with root privileges | |
| // | |
| // | |
| // Demo 1 (profile a function in current thread): | |
| // 1. Open directory '/usr/share/kpep/', find your CPU PMC database. | |
| // For M1 (Pro/Max), the database file is '/usr/share/kpep/a14.plist'. | |
| // 2. Select a few events that you are interested in, | |
| // add their names to the `profile_events` array below. |
Answer by Jim Dennis on Stack Overflow question http://stackoverflow.com/questions/1218390/what-is-your-most-productive-shortcut-with-vim/1220118#1220118
Your problem with Vim is that you don't grok vi.
You mention cutting with yy and complain that you almost never want to cut whole lines. In fact programmers, editing source code, very often want to work on whole lines, ranges of lines and blocks of code. However, yy is only one of many way to yank text into the anonymous copy buffer (or "register" as it's called in vi).
The "Zen" of vi is that you're speaking a language. The initial y is a verb. The statement yy is a simple statement which is, essentially, an abbreviation for 0 y$:
0 go to the beginning of this line. y yank from here (up to where?)
This project is a tiny compiler for a very simple language consisting of boolean expression.
The language has two constants: 1 for true and 0 for false, and 4 logic gates:
! (not), & (and), | (or), and ^ (xor).
It can also use parentheses to manage priorities.
Here is its grammar in BNF format:
expr ::= "0" | "1"