Skip to content

Instantly share code, notes, and snippets.

@lanshenghai
Last active August 29, 2015 14:23
Show Gist options
  • Save lanshenghai/844eebf6446478d06a69 to your computer and use it in GitHub Desktop.
Save lanshenghai/844eebf6446478d06a69 to your computer and use it in GitHub Desktop.

Some good tips & usage of Sublime Text

How to install the "Package Control"

  1. Execute the follow command in console:

    import urllib2,os,hashlib; h = 'eb2297e1a458f27d836c04bb0cbaf282' + 'd0e7a3098092775ccb37ca9d6b2e4b7d'; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); os.makedirs( ipp ) if not os.path.exists(ipp) else None; urllib2.install_opener( urllib2.build_opener( urllib2.ProxyHandler({'http':'http://your_account:[email protected]:8080'})) ); by = urllib2.urlopen( 'http://packagecontrol.io/' + pf.replace(' ', '%20')).read(); dh = hashlib.sha256(by).hexdigest(); open( os.path.join( ipp, pf), 'wb' ).write(by) if dh == h else None; print('Error validating download (got %s instead of %s), please try manual install' % (dh, h) if dh != h else 'Please restart Sublime Text to finish installation')
    
    Note:

    Replace your_account with your windows account, replace your_password with your real password.

  2. restart sublime

  3. Install other plugins

    1. Preferences -> Package Control, Enter Install, and click Enter
    2. Select your prefered plugins, and click Enter
    3. Restart sublime text to enable it.

Plugins for reStructuredText edit

  • OmniMarkupPreviewer
    You can use your change when you enter any text at the same time. Default hot keys to enable it Ctrl+Alt+O
  • reStructuredText Improved
    This Package is for nice syntax highlighting of reStructuredText
  • Restructured Text (RST) Snippets
    sublime-rst-completion is a group of snippets and commands to facilitate writing restructuredText with SublimeText. You can render your code by selecting the reStructuredText Improved at the left corner.
    • How to use auto-completion function:
      1. Click Ctrl+t, then enter the key characters
      2. Enter some text, and then click Tab
  • Markdown Preview
    • use cmd+shift+P then Markdown Preview to show the follow commands (you will be prompted to select which parser you prefer)

Column Selection

Overview

Column Selection can be used to select a rectangular area of a file. Column selection doesn't operate via a separate mode, instead it makes use of multiple selections.

You can use additive selections to select multiple blocks of text, or subtractive selections to remove a block.

Using the Mouse

Different mouse buttons are used on each platform:

OS X

  • Left Mouse Button + Option
  • OR: Middle Mouse Button
  • Add to selection: Command
  • Subtract from selection: Command+Shift

Windows

  • Right Mouse Button + Shift
  • OR: Middle Mouse Button
  • Add to selection: Ctrl
  • Subtract from selection: Alt

Linux

  • Right Mouse Button + Shift
  • Add to selection: Ctrl
  • Subtract from selection: Alt

Using the Keyboard

OS X

  • Ctrl + Shift + Up
  • Ctrl + Shift + Down

Windows

  • Ctrl + Alt + Up
  • Ctrl + Alt + Down

Linux

  • Ctrl + Alt + Up
  • Ctrl + Alt + Down
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment