Skip to content

Instantly share code, notes, and snippets.

@drunkel
Last active November 27, 2020 05:09
Show Gist options
  • Save drunkel/c8ac9081c5a9505a843a334608d9c3da to your computer and use it in GitHub Desktop.
Save drunkel/c8ac9081c5a9505a843a334608d9c3da to your computer and use it in GitHub Desktop.
Sublime 3 setup

Getting Setup with Sublime Text (3)

  1. Download here: http://www.sublimetext.com/
  2. Copy into /Applications (OSX, install however your OS wants you to)
  3. Add symlink so you can launch sublime from the command line using 'sublime'

ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/sublime

Launch Sublime! > sublime .

Note: Sublime unregistered will bug you every few minutes to purchase a license. If you've decided that this is going to be be your daily driver editor, it is a good idea to purchase a licence. These can be expensed!

Useful Settings

Set these by going to your User preferences, Sublime Text -> Preferences -> Settings - User

  • Always have a newline at the end of your files. Cleaner diffs for all! Add this line: "ensure_newline_at_eof_on_save": true,

  • To touch on Jordan's speedy grep post, exclude unnecessary files from search for faster greps with less noise:

"binary_file_patterns": ["*zxcvbn.js",".git/*","vendor/*","node_modules/*","coverage/*","log/*","tmp/*","*.jpg", "*.jpeg", "*.png", "*.gif", "*.ttf", "*.tga", "*.dds", "*.ico", "*.eot", "*.pdf", "*.swf", "*.jar", "*.zip"],

  • Do searches on highlighted text (If not on OSX this defaults to true, but OSX needs to add this line):

"find_selected_text": true,

  • Show whitespace characters (sometimes useful)

"draw_white_space": true,

  • Translate tabs to spaces. Please do not check in tab characters!
"tab_size": 2,
"translate_tabs_to_spaces": true,
  • Trim whitespace (Note: enabling this will cause messy diffs for a while, as there are a lot of files with unnecessary whitespace. Use only if you're OK with that.)
// Set to true to removing trailing white space on save
    "trim_trailing_white_space_on_save": true,

Packages

The following assume you're using Package Control ! Makes it really easy to manage packages. Highly recommended. Follow installation steps for your sublime version here.

To install a package, hit CMD+SHIFT +P to open the command pallet, and type 'install package'. Hit enter, and then search/install the following:

// I had to add this to my BetterCoffeeScript user Settings:
{
  "envPATH": "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
}
  • GitGutter! show an icon in the gutter area indicating whether a line has been inserted, modified or deleted.
  • RuboCop! Ruby linter. Show syntax errors and violation of best practices. (This performs terribly under ST2, use only if on ST3).
  • Git! Do git commands inside Sublime. Eg. Git Blame
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment