Use the first line of each file as its filename

I haven’t used it myself, but a plugin exists for this: Plugin for keeping the filename and first heading of a file in sync