Skip to content

Instantly share code, notes, and snippets.

@iw
Forked from yorkxin/KeyBindings.json
Created November 1, 2012 12:56
Show Gist options
  • Save iw/3993467 to your computer and use it in GitHub Desktop.
Save iw/3993467 to your computer and use it in GitHub Desktop.
My Sublime Text 2 Config

My Sublime Text 2 Config

Font

Source Code Pro Light from Adobe Source Code Pro.

Theme

Nil Theme

Or do Package Install Nil.

Color Theme (syntax highlighting color)

Nil Theme (same as above)

SublimeLinter

Linter is code quality checker. SublimeLinter integrated many languages including Ruby, JavaScript and CoffeeScript, which are my daily coding languages.

JavaScript (JSHint)

JavaScript is a language that even experienced programmers write bad-smell, error-prone codes. A good linter makes our daily coding / debugging life much happier.

By default SublimeLinter uses JSHint. Documents: http://www.jshint.com/docs/

/* Default (OS X).sublime-keymap */
/* Key Bindings - User */
[
{ "keys": ["ctrl+shift+."], "command": "erb" },
{ "keys": ["super+shift+t"], "command": "show_overlay", "args": {"overlay": "goto", "text": "@"} },
{ "keys": ["ctrl+super+r"], "command": "reveal_in_side_bar" },
// swap normal paste and paste-with-indention
{ "keys": ["super+v"], "command": "paste_and_indent" },
{ "keys": ["super+shift+v"], "command": "paste" },
// https://github.com/alexstaubo/sublime_text_alternative_autocompletion
{ "keys": ["escape"], "command": "alternative_autocomplete", "context":
[
{ "key": "num_selections", "operator": "equal", "operand": 1 },
{ "key": "overlay_visible", "operator": "equal", "operand": false },
{ "key": "panel_visible", "operator": "equal", "operand": false }
]
},
{ "keys": ["shift+escape"], "command": "alternative_autocomplete", "args": {"cycle": "previous"}, "context":
[
{ "key": "num_selections", "operator": "equal", "operand": 1 },
{ "key": "overlay_visible", "operator": "equal", "operand": false },
{ "key": "panel_visible", "operator": "equal", "operand": false }
]
},
// CTags
{
"command": "navigate_to_definition",
"keys": ["super+j", "super+j"]
},
{
"command": "search_for_definition",
"keys": ["super+shift+j", "super+shift+j"]
},
{
"command": "jump_back",
"keys": ["super+k", "super+k"]
},
{
"command": "jump_back",
"args": {"to": "last_modification"},
"keys": ["super+shift+k", "super+shift+k"]
},
{
"command": "rebuild_tags",
"keys": ["super+;", "super+;"]
},
{
"command": "show_symbols",
"context": [
{
"key": "selector",
"match_all": true,
"operand": "source -source.css",
"operator": "equal"
}
],
"keys": ["super+l", "super+l"]
},
{
"command": "show_symbols",
"args": {"type": "multi"},
"context": [
{
"key": "selector",
"match_all": true,
"operand": "source -source.css",
"operator": "equal"
}
],
"keys": ["super+shift+l", "super+shift+l"]
}
]
/* Preferences.sublime-settings */
/* Settings - User */
{
"auto_indent": true,
"bold_folder_labels": true,
"caret_style": "phase",
"color_scheme": "Packages/Theme - Nil/Tubnil.tmTheme",
"draw_minimap_border": true,
"draw_white_space": "all",
"fallback_encoding": "Big5-HKSCS",
"font_face": "Source Code Pro Light",
// "font_options": ["no_round"],
"font_size": 16,
"highlight_line": true,
"highlight_modified_tabs": true,
"hot_exit": false,
"ignored_packages":
[
"Vintage",
"SublimeCodeIntel"
],
"indent_guide_options":
[
"draw_normal",
"draw_active"
],
"indent_to_bracket": false,
"margin": 0,
"overlay_scroll_bars": "enabled",
"shift_tab_unindent": true,
"smart_indent": true,
"tab_size": 2,
"theme": "Nil.sublime-theme",
"translate_tabs_to_spaces": true,
"file_exclude_patterns": ["*.pyc", "*.pyo", "*.exe", "*.dll", "*.obj","*.o", "*.a", "*.lib", "*.so", "*.dylib",
"*.ncb", "*.sdf", "*.suo", "*.pdb", "*.idb", ".DS_Store", "*.class", "*.psd", "*.db",
".tags", ".tags_sorted_by_file", "*.log"]
}
/* SublimeLinter.sublime-settings */
/* Package Settings -> SublimeLinter -> Settings - User */
{
"sublimelinter": "load-save",
"sublimelinter_executable_map":
{
"ruby": "~/.rvm/bin/rvm-auto-ruby"
},
"sublimelinter_gutter_marks": true, // put a mark before error lines
"jshint_options": {
// documents: http://www.jshint.com/docs/
"curly": true, // always {} around blocks
"eqeqeq": true, // always === and !==
"forin": true, // for-in only iterate through properties owned by object itself
"immed": true, // avoid immediate function without () wrapping
"latedef": true, // avoid lately declaration of variables
"newcap": true, // Capitalized() is considered as initializing a new object, and requires `new'
"noarg": true, // avoid accessing function caller & callee
"noempty": true, // avoid empty-statement blocks
"nonew": true, // avoid invoking `new Constructor()` without l-value
"regexp": true, // avoid `.' in regex pattern
"undef": true, // avoid undeclared variable (e.g. typo)
"unused": true, // warn for unused variables
"trailing": true, // warn for trailing spaces
"maxcomplexity": 5, // warn for high cyclomatic compexity: http://en.wikipedia.org/wiki/Cyclomatic_complexity
// Relaxing Options
"sub": true, // allow `object["property"]'
"supernew": true, // allow `singleton = new function () { ... };'
// Environments
"browser": true, // treat JavaScripts as if running in client-side
"jquery": true, // jQuery is always there (though I don't like it)
// The following options override SublimeLint defaults
"evil": false, // [NO RELAX] avoid eval()
"regexdash": false, // [NO RELAX] avoid tailing dash (`-') in regex pattern
"wsh": false // [NO ENVIRONMENT] There is no Windows Scripting Host on this computer
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment