When editing my config files I might need to refer to the documentation to refresh my memory about a component’s many options. A simple convenience is to put the documentation link in a comment. Here’s an example of a doc link for recorder (on line 96).
I use Visual Studio Code so I can just CTRL+Click the link to quickly view the documentation.
I do this too, helps me and with my config on github hopefully points people back to the docs rather than just copy/pasting and not knowing why it works.
It crossed my mind that this could be a Feature request (add links to the default config file created upon installation). However, users need not wait for its implementation and can easily add doc links wherever they feel it may serve as a convenience. Most (but not all) of Home Assistant’s doc links take the form of https://www.home-assistant.io/components/<TOPIC>/