---
  - name: Install Sublime Text 3
    homebrew_cask:
      name: sublime-text3
      state: present

  - name: Set Sublime Text 3 general settings
    template:
      src: Preferences.sublime-settings.j2
      dest: "~/Library/Application Support/Sublime Text 3/Packages/User/Preferences.sublime-settings"

  - name: Set Sublime Text 3 PHP settings
    template:
      src: PHP.sublime-settings.j2
      dest: "~/Library/Application Support/Sublime Text 3/Packages/User/PHP.sublime-settings"

  - name: Set Sublime Text 3 JS settings
    template:
      src: Javascript.sublime-settings.j2
      dest: "~/Library/Application Support/Sublime Text 3/Packages/User/Javascript.sublime-settings"

  - name: Set Sublime Text 3 CSS settings
    template:
      src: CSS.sublime-settings.j2
      dest: "~/Library/Application Support/Sublime Text 3/Packages/User/CSS.sublime-settings"

---
  - name: Install Sublime Text 3
    homebrew_cask:
      name: sublime-text3
      state: present

  - name: "Make sure Sublime Text preference folder exists"
    file:
      path: "~/Library/Application Support/Sublime Text 3/Packages/User"
      state: directory

  - name: Set Sublime Text 3 general settings
    template:
      src: Preferences.sublime-settings.j2
      dest: "~/Library/Application Support/Sublime Text 3/Packages/User/Preferences.sublime-settings"

  - name: Set Sublime Text 3 PHP settings
    template:
      src: PHP.sublime-settings.j2
      dest: "~/Library/Application Support/Sublime Text 3/Packages/User/PHP.sublime-settings"

  - name: Set Sublime Text 3 JS settings
    template:
      src: Javascript.sublime-settings.j2
      dest: "~/Library/Application Support/Sublime Text 3/Packages/User/Javascript.sublime-settings"

  - name: Set Sublime Text 3 CSS settings
    template:
      src: CSS.sublime-settings.j2
      dest: "~/Library/Application Support/Sublime Text 3/Packages/User/CSS.sublime-settings"

Make sure Sublime Text preference folder exists
Make sure Sublime Text preference folder exists
