title: How to run google format by execute google-java-format Plugin in Intellij IDEA
body: <p>Many questions regarding this issue can be found, for example <a href="https://stackoverflow.com/questions/42979700/how-to-configure-google-java-code-formatter-in-intellij-idea-17">this</a> and <a href="https://stackoverflow.com/questions/41780576/how-do-i-correctly-install-the-google-java-format-plugin-for-intellij-idea">this</a>. But none of them are really solves the issue that how to run the plugin to reformat java code against java google format code style</p>
  
  <p>Download and import intellij-java-google-style.xml to intellij only partly solves the issue, because using the code schema will not be 100% match against code formatted with the actual google code formatter. This is very annoying when using git hook for format check when commit. </p>
  
  <p>The currently intelliJ IDEA I'm using is 2018.3.4 community version</p>
  
  <p>Question 1:</p>
  
  <p>How can I create a hot key combination, for example: <strong>Ctrl+Shift+J</strong>, to run the code format? I did a similar configuration for scala code format according to this <a href="https://stackoverflow.com/questions/54980326/how-can-i-make-sure-i-applied-the-correct-code-format-in-intellij">question</a>, and it works fine. The different thing is, the scala format plugin comes with a default mapping key, I changed the key combinations rather than create any. </p>
  
  <p>Question 2:</p>
  
  <p>Is that means any new lines will be automatically formed according to the google java code style after installed and enabled the google-java-format Plugin for intellij IDEA</p>
  
  <p>Question 3:</p>
  
  <p>When multiple code format plugins were installed, is that means the code format will be automatically applied to the corresponding code files? or further configuration is needed?</p>