For example, I want to create a command called Mycmd (the first letter need to be capitalized). Whey I'm in normal mode and type :Mycmd, I hope the following command series can be done:
:set ts=2
:set sw=2
:set sws=2
:set expandtab
I found command syntax seems to be on the right track, for example: [StackOverflow], but I couldn't do it with more than two commands (i.e., :set one thing then :set another thing).
I don't really consider nmap since I want to create my command instead of mapping to a hot key, though nmap allows to execute commands at the same time (e.g., nmap <F7> :set ts=2<enter>:set sw=2<enter>)