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/./=/gsubstitute every character (.) with a=
Any clarification/pointers on the above two components of the commands would be great.
:h :tand: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 :-). – Ralf May 31 '20 at 07:07t==> alias forco[py]. Still working through.and|-- there are lots of references for them in the docs... – David542 May 31 '20 at 07:17:t->:copyseems 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:helpgrepto search through the help files. – Ralf May 31 '20 at 07:26:h :.instead of just:h .(which is what I was doing previously)? – David542 May 31 '20 at 07:28.with a (ex-)command, so the leading colon means "dot on the command line". Like the different between:h barand:h :bar. Sometimes also with leadingc_like:help c_<CR>. – Ralf May 31 '20 at 07:59: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-summarywhich gives full explanation. – Matt May 31 '20 at 07:59