Instead of recording them, you should then write a script or macro. This is very useful to make templates for parts of your code. For example, a function header. You can make this as clever as you like. It's normal to make errors while typing.
Nobody can avoid it.
The trick is to quickly spot and correct them. The editor should be able to help you with this. Very often you will make the same mistake again and again. Your fingers just don't do what you intended. This can be corrected with abbreviations.