title: Sublime Text 3, convert spaces to tabs
body: <p>I know there are a lot of posts about this, but I couldn´t get it to work.<br>
  I use tabs for coding. Is there a way, to convert always spaces to tabs? I.e. on open and on Save files? Anyone got an idea?</p>
  
  <p>// edit:<br>
  My desire is to do this <strong>automatically</strong>! -> open, save or on the fly<bR>
  Does anyone know how to do?</p>
  
  <p><br>I tried <a href="https://coderwall.com/p/zvyg7a" rel="noreferrer">this</a>:</p>
  
  <pre><code>import sublime, sublime_plugin, os
  
  class ExpandTabsOnSave(sublime_plugin.EventListener):
    # Run ST's 'expand_tabs' command when saving a file
    def on_pre_save(self, view):
      if view.settings().get('expand_tabs_on_save') == 1:
        view.window().run_command('expand_tabs')
  </code></pre>
  
  <p>And here are my user Settings:</p>
  
  <pre><code>{
      "auto_complete_selector": "source - comment, meta.tag - punctuation.definition.tag.begin",
      "auto_indent": true,
      "detect_indentation": true,
      "draw_white_space": "all",
      "ensure_newline_at_eof_on_save": true,
      "expand_tabs_on_save": true,
      "font_face": "SourceCodePro-Regular",
      "font_size": 10,
      "format_on_save": true,
      "ignored_packages":
      [
          "Vintage"
      ],
      "indent_to_bracket": true,
      "open_files_in_new_window": false,
      "smart_indent": true,
      "tab_size": 4,
      "translate_tabs_to_spaces": false,
      "trim_automatic_white_space": true,
      "trim_trailing_white_space_on_save": true,
      "use_tab_stops": false,
      "word_wrap": false
  }
  </code></pre>