title: Is there a way to add custom keyboard shortcuts to Vim for running numerous commands?
body: <p>I'm having the following issue - whenever I finish writing some C++ code in Vim and want to compile and run it, I have to:</p>
  
  <ol>
  <li>Exit insert mode</li>
  <li>Save the file using the command <code>:w</code></li>
  <li>Write <code>:! g++ *.cpp -o programName; ./programName</code> in order to compile and run at once</li>
  </ol>
  
  <p>After inputting the last two commands once, I obviously make use of the upper arrow key on the keyboard to get the last few commands instead of writting them down again and again on future compilations and runs. </p>
  
  <p>But it's still kind of slow to me. So I was wondering if there's some sort of way to maybe create a keyboard shortcut which inputs these last two commands or even does all the three things at once!</p>