I've assembled the following command to take a markdown file and add a ====
under each line that starts with a #
:
:g/^#/t. | s/./=/g
How exactly does this work? As far as I understand:
:g/
start a global command^#/
where the line starts with a#
/t.
(not sure what this is or does, had trouble finding it in help)|
(also not quite sure exactly how this works, I've seen a few different examples of this)s/./=/g
substitute every character (.
) with a=
Any clarification/pointers on the above two components of the commands would be great.
:h :t
and:h :bar
. Important feature when searching for help is<C-d>
. Just enter:h |<C-d>
, it will show any help topics that contains the wordbar
(Vim is automatically replacing|
withbar
). Less helpful with:h t<C-d>
I have to admit :-).t
==> alias forco[py]
. Still working through.
and|
-- there are lots of references for them in the docs...:t
->:copy
seems to be historical. It's also in original vi. And::h :.
. David, I don't want to annoy you with all the "see help", but the help of Vim is really good and extensive. It is sometimes a little bit difficult to find the right help subject. Another cool feature is:helpgrep
to search through the help files.:h :.
instead of just:h .
(which is what I was doing previously)?:h .
means "give me help about "dot" in Normal mode", i.e. repeat-operator. While:h :.
means "say what is "dot" in the command-line?" Just read the main topic<F1>
- right after the words "Get specific help" there are several examples, and also the link to:h help-summary
which gives full explanation.