Skip to content

Instantly share code, notes, and snippets.

@JeOam
Last active August 29, 2015 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JeOam/2e59f2abc56586849ae5 to your computer and use it in GitHub Desktop.
Save JeOam/2e59f2abc56586849ae5 to your computer and use it in GitHub Desktop.
Sublime Text 3

官网:Sublime Text

命令行设置:

$ sudo rm /bin/subl #if needed
$ sudo ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /bin/subl

插件管理:Package Control

Shortcut:

  • Command+Shift+P: Command Palette; Type: "Package Control Install Package" to install Package
  • `Ctrl+`` : Show Console

Plugin:

  • CTags: Goto Definition
    • Install via Package Control, succeeded if there is a Navigate to Definition option in Right-Click
    • Try this:
    • If got an error: /usr/bin/ctags: illegal option -- R usage: ctags [-BFadtuwvx] [-f tagsfile] file ...
    • Solution: brew install ctags and Sublime3 -> Preferences -> Package Settings -> CTags -> Settings - User:: "command" : "/usr/local/bin/ctags"
    • Copy content from Mouse Bindings-Default to Mouse Bindings-User, set navigate_to_definition's modifiers to key ["command"]
    • Ref:click
  • Anaconda:
  • Side​Bar​Enhancements: Enhancements to Sublime Text sidebar. Files and folders
  • Theme - Soda

Ref:

@JeOam
Copy link
Author

JeOam commented Nov 14, 2014

Run Python code from Sublime Text 2:

  1. Tools -> Build System -> (choose) Python
  2. To Run: CMD + B
    This would start your file in console which should be at bottom of the editor.
  3. To stop: Ctrl + Break or Tools -> Cancel Build. note: CTRL + C will NOT work.
    What to do when Ctrl + Break does not work, go to Preferences -> Key Bindings - User and paste the line below:
{"keys": ["ctrl+shift+c"], "command": "exec", "args": {"kill": true} } 

Now, you can use Ctrl+Shift+C instead of CTRL+BREAK

@JeOam
Copy link
Author

JeOam commented Nov 16, 2014

Origin Build Setting in Sublime Text 2:

{
    "cmd": ["python", "-u", "$file"],
    "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
    "selector": "source.python"
}

Using virtualenv with Sublime Text 2/3:

{
    "env": {
            "PYTHONPATH": ".../flasky/venv/lib/python2.7/site-packages"
            },
    "cmd": ["python", "-u", "$file"],
    "selector": "source.python"
}

Read More: Build Systems

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment