Are you programming in assembler or C?
If you need to rewrite every time you use a bit of code, you should get your self a proper editor. One with possibility to open more the one file at the time, and good coppy/ paste commands.
If you want to make your own code files, the simplest way is...