Skip to content

Instantly share code, notes, and snippets.

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 cenobyte/5bd4822271e31eed1bf1 to your computer and use it in GitHub Desktop.
Save cenobyte/5bd4822271e31eed1bf1 to your computer and use it in GitHub Desktop.
[
// assigns double tapping ctrl+r to reversing your selection
{
"keys": ["ctrl+r", "ctrl+r"],
"command": "permute_selection",
"args": {
"operation": "reverse"
}
},
// Use paste and indent as default paste mechanism,
// this conserves your indentation and it's overall better.
// original paste is now ctrl+shift+v
[{
"keys": ["ctrl+v"],
"command": "paste_and_indent"
}, {
"keys": ["ctrl+shift+v"],
"command": "paste"
}],
// plugin settings for moveText
{"keys": ["ctrl+up"], "command": "move_text_right"},
{"keys": ["ctrl+down"], "command": "move_text_left"}
]
{
// autosaving can sometimes be a nuisance, maybe differentiate between format saving and normal saving with two different hotkeys?
"format_on_save": false,
}

This is my complete sublime text configuration. Set up for html, css, javascript and python on Linux. Each plugin has a link to either their github page or their website. All plugins but package control itself are available through package control. All of them work perfectly with Sublime Text 3.

Plugins

  • Package control - Self explanatory
  • Bracket highlighter - Highlights brackets in your line numbers and inline. Very useful for nested html or js objects.
  • Emmet - The must have html and css plugin.
  • all autocomplete - Enhances your autocomplete with words from all your open files, very useful.
  • auto semi-colon - Automatically inserts a semicolon at the end of the file if you type one, so you don't have to move your cursor around all the time Alternatively, you could use the the following macro to insert a semicolon at the end of the line for you.
[
    { "command": "set_mark" },
    { "command": "move_to", "args": {"to": "eol"} },
    { "command": "insert_snippet", "args": {"contents": "${TM_LINE_TERMINATOR:;}"} },
    { "command": "swap_with_mark" }
]

I've set this macro to activate on double keypress of the ; key as follows in my user keymap file:

{ "keys": [";", ";"], "command": "run_macro_file", "args": {"file": "Packages/User/macros/insert-semicolon.sublime-macro"} },
  • docBlockr - Neat doc comments, supports a large amount of programming languages
  • autoFileName - autocompletion for filenames, useful for many different things, just press tab like you're used to
  • Git - Git in sublime, useful. (there are some alternative git plugins too)
  • Sublime linter - Linting for several languages
  • Sublime CodeIntel - Autocomplete for several languages (not a great fan of it since it bloats autocomplete with unrelated results and only does what you want half of the time with Python and JS)
  • sftp - an sftp file transfer plugin for ST, one of my favorite plugins, it's made by the developers of the package control package.
  • Advanced New File - Very quick file creation, does folder autocompletion too!
  • alignment - Useful for aligning blocks of text like below. Made by the devs of the package control package.
var justANumber   = 12;
var aLargerNumber = 3934;
var small         = "I'm smaller!";
var lastVariable  = 3.141592653589793238462;
  • colorhighlighter - Shows the color on color values, ex: red would get a red background.

  • dictionaryautocomplete - Installs a dictionary to autocomplete from, it does slow down ST's autocomplete a little, but might be useful for writers.

  • css3 syntax highlighting - Enhanced css3 syntax highlighting, the built-in one misses some newer features

  • jsFormat - Beautifies your javascript. I've configured it to run on file save in my jsformat settings file.

  • Pretty JSON - Beautifier for json files. (jsFormat also includes a json beautifier I believe)

  • html beautify - Beautifier for html files. I've configured it to run on file save in my settings file.

  • sublime REPL - Interactive coding console, think console Python/ruby/node.js/lisp but then directly in sublime text. Supports a few dozen languages. One of my favorite plugins.

  • moveText - With this you can move your selection left and right as well as up and down. And use

    {"keys": ["ctrl+up"], "command": "move_text_right"}, {"keys": ["ctrl+down"], "command": "move_text_left"}

In your keybindings

Themes

  • base16 theme - About 20 different color schemes to choose from, you can preview all of them here
  • Spacegray - A hyperminimal UI theme for Sublime Text, this is what I currently use.
  • Flatland - A simple theme for Sublime, I've used this one for a long time.
  • Predawn - A theme for Sublime that stays very true to its name, very relaxing and especially good in the mornings.
{
// Only tab, so no enter, can commit auto completions
"auto_complete_commit_on_tab": true,
// a list of binary files, this removes them from ctrl+p goto anything
"binary_file_patterns":
[
"*.jpg",
"*.jpeg",
"*.png",
"*.gif",
"*.ttf",
"*.tga",
"*.dds",
"*.ico",
"*.eot",
"*.pdf",
"*.swf",
"*.jar",
"*.zip"
],
// makes the caret (text cursor) a tiny bit wider
"caret_extra_width": 1,
// my color scheme, predawn
"color_scheme": "Packages/Predawn/predawn.tmTheme",
// it goes with soda dark 3, pritty nice
"theme": "Soda Dark 3.sublime-theme",
// sets default encoding to UTF-8
"default_encoding": "UTF-8",
// LF line ending, I work on Linux
"default_line_ending": "unix",
// tab size will be calculated instead of using project/sublime-system-wide settings
"detect_indentation": false,
// draws a border around the minimap (for some reason not visible, maybe problem with this theme?)
"draw_minimap_border": true,
// makes white space visible
"draw_white_space": "all",
// inserts a newline if there is none at the end of the file on save
"ensure_newline_at_eof_on_save": true,
// my font face, if you're not using Ubuntu, you should change this
// note that you should pick a monospace font if you don't know what font to pick
// check out any of the following
// these are not default, so you have to find them:
// ['source code pro', 'monofur regular']
// these are installed by default on most systems:
// ['Courier', 'Consolas (one of my favs)']
// mac has a font called monaco, check that one out if you use a mac
"font_face": "Ubuntu Mono",
// uses subpixel antialiasing on the font, makes it look a littlebetter
"font_options": "subpixel_antialias",
// my font size
"font_size": 12,
// highlights the currently selected line
"highlight_line": true,
// Makes modified files a bit more visible in the tabs
"highlight_modified_tabs": true,
// on sublime exit, instead of asking if you want to save everything, just closes and reopens
// in the same state when you next open it up
"hot_exit": true,
// nobody likes vim ;_;
"ignored_packages":
[
"Vintage"
],
// excludes these files from goto anything
"index_exclude_patterns":
[
"*.log"
],
// draws indentation guidelines, I just discovered these, godlike option for making
// js and html more readable
"intent_guide_options": ["draw_normal", "draw_active"],
// if this is false, you cannot use goto anything
"index_files": true,
// makes folders in the treeview bold
"bold_folder_labels": true,
// adds one pixel to the bottom of every line, these slight changes allow for better readability
"line_padding_bottom": 1,
// adds one pixel to the top of every line, these slight changes allow for better readability
"line_padding_top": 1,
// allows you to scroll past the end of the file, normally the bottom of the screen is your last line, now it's the top
"scroll_past_end": true,
// set scroll speed a little slower
"scroll_speed": 0.7,
// not sure what this does, I keep it though, because I enabled it one day :)
"sidebar_default": true,
// sets tab_size to 4 characters
"tab_size": 4,
// converts tabs to spaces, insert a tab and you'll actually insert "tab_size" * space
"translate_tabs_to_spaces": true,
// removes unnecessary whitespace at the end of each line on save
"trim_trailing_white_space_on_save": true,
// characters that are considered word separators
// I specifically excluded $ because I use jQuery and mongoDB
// selecting something like $textArea will select the word including the $
// if you don't want that, just add a $ to the string below
"word_separators": "./()\"'-:,.;<>~!@#%^&*|+=[]{}`~?",
// instead of having to scroll horizontally for very long lines, just resumes a long line on
// the next line. Next line is an example (toggle between true/false to see)
// Lorem ipsum dolor sit amet, consectetur adipisicing elit. Vel, hic neque eum cumque tempora provident nihil inventore porro praesentium autem eligendi facere, reiciendis libero rerum sit numquam tenetur assumenda repellendus.
"word_wrap": true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment