I have enjoyed coding not too large projects in one single file. This way I can press
* on an identifier and find it without having to hop across buffers.
But naturally this doesn't scale and at some point I need to isolate code into multiple files.
Here is a dream use-case for which I wonder what is the best way to accomplish:
Edit one buffer with multiple sections, each titled with the name of a file. Upon saving, each section is saved into the appropriate file. Upon loading/reading files, each file is incorporated into the buffer into a section titled with its name.
By "section" I do not mean any special construct. Just some convention, perhaps file name underlined by
===== to denote a boundary in text.
Here's an example:
main.py ======= import util print(util.rnd()) util.py ======= def rnd (): return 7
PS: please excuse the diminished entropy of the random generator in this example