Vim Ttp

如何插入递增数字在非空行中 Open your file in Vim. Set a variable to hold the incrementing number. You can start with 1 or any number you prefer. In command mode, type this and press Enter: bash :let i=0 Now, use the following command to insert numbers at the beginning of each non-empty line. This command uses the global (g) command to run a substitution (s) on every line that is not just whitespace. The \ze in the substitution pattern ensures that the number is inserted at the start of the line: ...

March 1, 2024 · 1 min · Eddy