title: How to format a Java file in Vim like Eclipse
body: <p>I am using Vim to edit a Java file, but I find the way Vim formats Java files is very different from Eclipse.<p>
  If I select the following code and press <kbd>=</kbd>, Vim does not format the code the way I would like. Can anyone help me?<p>
  Before Format:</p>
  
  <pre><code>  case RINGTONE_PICKED: {
                              Uri pickedUri = data.getParcelableExtra(RingtoneManager.EXTRA_RINGTONE_PICKED_URI);
                              handleRingtonePicked(pickedUri);
                              break;
                          }
      case PHOTO_PICKED_WITH_DATA: {
  
          if (mPhotoEditorView != null) {
              final Bitmap photo = data.getParcelableExtra("data");
              mPhotoEditorView.setPhotoBitmap(photo);
          } else {
              // The contact that requested the photo is no longer present.
              // TODO: Show error message
          }
  
          break;
      }
  </code></pre>
  
  <p>After Format:</p>
  
  <pre><code>  case RINGTONE_PICKED: {
                              Uri pickedUri = data.getParcelableExtra(RingtoneManager.EXTRA_RINGTONE_PICKED_URI);
                              handleRingtonePicked(pickedUri);
                              break;
                          }
    case PHOTO_PICKED_WITH_DATA: {
  
                                     if (mPhotoEditorView != null) {
                                         final Bitmap photo = data.getParcelableExtra("data");
                                         mPhotoEditorView.setPhotoBitmap(photo);
                                     } else {
                                         // The contact that requested the photo is no longer present.
                                         // TODO: Show error message
                                     }
  
                                     break;
                                 }
  </code></pre>
  
  <p>This is what I want:</p>
  
  <pre><code>    case RINGTONE_PICKED: {
          Uri pickedUri = data.getParcelableExtra(RingtoneManager.EXTRA_RINGTONE_PICKED_URI);
          handleRingtonePicked(pickedUri);
          break;
          }
      case PHOTO_PICKED_WITH_DATA: {
  
          if (mPhotoEditorView != null) {
              final Bitmap photo = data.getParcelableExtra("data");
              mPhotoEditorView.setPhotoBitmap(photo);
          } else {
              // The contact that requested the photo is no longer present.
              // TODO: Show error message
          }
  
          break;
      }
  </code></pre>