Skip to content

Instantly share code, notes, and snippets.

@FootballFan141
Forked from tibbon/sublimehints.md
Created July 23, 2018 04:00
Show Gist options
  • Select an option

  • Save FootballFan141/c55152ab43fdd310787ed83e61e00ed6 to your computer and use it in GitHub Desktop.

Select an option

Save FootballFan141/c55152ab43fdd310787ed83e61e00ed6 to your computer and use it in GitHub Desktop.

Revisions

  1. @tibbon tibbon created this gist Oct 31, 2013.
    45 changes: 45 additions & 0 deletions sublimehints.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,45 @@
    # David's Sublime Hints

    ## Hint 1 - Set default indentation to 2 spaces

    A tab size of 2 almost always looks better and can fit more on screen

    * Click on `Sublime Text` -> `Preferences` -> `Settings - User`
    * Alter the file to add `"tab_size: 2"` and save it

    Mine looks like the following:

    ```json
    {
    "color_scheme": "Packages/Color Scheme - Default/Solarized (Light).tmTheme",
    "font_size": 20,
    "ignored_packages":
    [
    "Vintage"
    ],
    "tab_size": 2
    }
    ```

    ## Hint 2 - Install Sublime Autocomplete All

    It's more helpful to have autocomplete across all of your open files, as we have more an more files open. Fortunately, there's a [plugin for that](https://github.com/alienhard/SublimeAllAutocomplete)!

    Hit `cmd+shift+p` in Sublime to open the Command Pallete. Start typing 'install' to select `'Package Control: Install Package'`, then search for `AllAutocomplete` and select it. That's it.

    ## Hint 3 - Install [JSHint](https://github.com/victorporof/Sublime-JSHint) for automatic JavaScript linting

    Linting is automatically evaluating your code for syntax errors, style and best practices. And we've got a tool for it!

    This is a bit more complicated, as it requires you install Node.js.

    * Install [Node.js and NPM](http://madebyhoundstooth.com/blog/install-node-with-homebrew-on-os-x/). You still may find better instructions out there
    * Run `npm install jshint` from your bash terminal.
    * Install Sublime-JSHint. `Cmd+Shift+P` in Sublime. Start typing `install`, select `Package Control: Install Package`
    type `js gutter`, select JSHint Gutter
    * Configure JS Gutter/JSHint. Hit `Cmd+Shift+P` and start typing `jshint set plugin` and go to the Set Plugin Options. Set `lint_on_edit` and `lint_on_save` to be true. Save the file. Now when you edit/save a JavaScript file it will automatically lint!
    *

    #### Minor note with JSHint

    It will probably bug you about stuff that you don't want to be bothered about. [Consult this link](https://github.com/victorporof/Sublime-JSHint#using-your-own-jshintrc-options) on configuring a hidden `.jshintrc` file in each of your projects to configure what type of things you want JSHint to look for.