The rst (restructuredtext) writers need to write heads frequently like this:
Code: Select all
Chapter 1 Title
===============
Section 1.1 Title
-----------------
Subsection 1.1.1 Title
~~~~~~~~~~~~~~~~~~~~~~
Section 1.2 Title
-----------------
Chapter 2 Title
===============
- 1. delete the line of markers by pressing del key many times
- 2. insert a line of new markers, which is the same length as the head name
- 1. When a shortcut (for example: Ctrl + 1 ) is pressed, the current line are marked with a specific head level (inserting a line consisting of "="s) .
- 2. If there are markers for the current line already, the old markers are deleted before the new ones being inserted.
- 3. The new inserted markers should be the same length with the head name.
Perhaps macros cann't do this and some python codes are needed.