how to repeat the last or previous command in emacs editor

One of the useful features of an editor is the ability repeat commands with minimal keystrokes. Many users find it useful when having to execute arduous long commands that require some typing. The emacs repeat command will repeat the last action that was performed while ignoring the input events like moving around in the buffer. M-x repeat It is bound…