Imagine that you’re using Emacs and you have a list of items that you would like to convert into a numbered list.
We’re going from:
first
second
third
To:
1. first
2. second
3. third
Obviously, there are many ways to achieve this, but one is to use the Emacs Keyboard Macro Counter.
- Put the cursor one line ABOVE your list.
- Start a macro: `F3`
- Insert the counter value: `C-x C-k C-i`. A 0 will appear
- Insert the DOT and a space: `.`
- Move the cursor to the next line
- Stop the macro: `F4`
- Select your list
- `M-x apply-macro-to-region-lines`
- You can delete the 0 you added on the top and enjoy
Discussion
No comments yet.