Sublime Text 2 Tricks

Sublime Text 2 Tricks

Project is a collection of Folders (multiple), not files. http://docs.sublimetext.info/en/latest/reference/keyboard_shortcuts_win.html :: Keyboard ShortcutsUnofficial Documentation

Sublime Text 2 Tips and Shortcuts

Themes and snippets

TextMate snippets and themes port-over nicely to Sublime Text.

You only need to drop them in the Packages folder — .tmbundle extension intact, and Sublime will recognize the files. Repository of themes:

http://textmatetheme.com/ :: TextMate Theme

Install Themr package to switch themes, and Schemr package to switch color schemes.

Theme Switcher for Sublime Text 2: https://github.com/skt84/Themr
Color schemes through the commands: https://github.com/skt84/Schemr

Packages to cycle through color schemes with F8 / Ctrl-F8:

  • Camaleón plugin allows you to quickly cycle between a combination of user defined chrome themes and colours schemes when pressing F8. https://github.com/SublimeText/Camaleon :: SublimeText/Camaleon

  • SchemeCycler: https://github.com/rrerolle/sublime-scheme-cycler :: rrerolle/sublime-scheme-cycler · GitHub This plugin is similar to the Camaleon plugin, but only handles Color Schemes, not UI themes, and doesn’t require manually defining a list of schemes.

Nice themes: Soda: https://github.com/buymeasoda/soda-theme/ Frontend Delight, Phoenix, Aqua, Refined

Manualy (without Package Manager) installed color schemes :

*   Solarized Colorscheme for TextMate, with Markdown:
    https://github.com/deplorableword/textmate-solarized

    Or you could patch the default Solarized themes to support Markdown:
        http://eleclerc.ca/2012/02/17/sublime-text-2-solarized-and-markdown/ :: Sublime Text 2, Solarized, and Markdown « Eric Leclerc

        Put the .thTheme file and this .diff file in the same directory
        and enter this at the command line (from the same directory):

        patch -p1 -i solarized-light-markdown.diff

*   Fake (from the collection):
    https://github.com/filmgirl/TextMate-Themes/ :: filmgirl/TextMate-Themes · GitHub

    Install theme collection with:

    cd "%APPDATA%\Sublime Text 2\Packages"
    git clone https://github.com/filmgirl/TextMate-Themes/ "Theme - Filmgirl Themes Collection"

Shortcuts

Ctrl+P – Go to anything. http://docs.sublimetext.info/en/latest/file_management/file_management.html :: File Navigation and File Management — Sublime Text

Ctrl + PgUp/PgDn – Cicles throught the open files Ctrl + ` - Opens command console (similar to Ctrl-Esc but one button down :)

Ctrl+Alt+F Provides “Instant File Search” functionality (added by SideBarEnhancements plugin).

  • Multiple cursors and selections. Hold down Ctrl and click as many times as you want into the file. Now if you enter something the characters get entered multiple times. Esc will exit this. There is an alternative, often very useful, keyboard only way: Ctl+Alt+Up/Down. You can also split one big selection into multiple smaller ones. Select a big chunk of text and press Ctrl-Shift-L (Lines), and you will have multiple selection out of every line of text.
  • Quick word editing. Not easy to explain. Ctrl-D selects the current word. Now, keep hitting - it will select nearby strings that are a match, and can be used for multiple editing. Also note that by pressing Ctrl-U you can always undo selection - shrink to the last one.
  • Quick find/replace: If you want to quickly change all the instances of the same word/part in a file at the same time, mark the desired area, press Alt-F3 and all of its occurrences get selected for parallel editing.
  • Type lorem and the Tab. It’s called Quick Lorem Ipsum Paragraph.
  • Best way to quickly preview Markdown files, while editing, is to fold whole document by top level headers. This is done, if you have SmartMarkdown plug-in installed, by simply typing Shift-Tab.
  • Joining lines. Select any two or more lines, and press Ctrl-J (Join).
  • Moving a line/-s up or down. Nothing has to be selected. Just try Ctrl-Shift-Up/Down.
  • Duplicating a line or multiple lines. Ctrl-Shift-D (Duplicate).
  • Deleting one or more lines. Ctrl-Shift-K (Kill).
  • Comments. Type Ctrl-/ for single line, or Ctrl-Shift-/ for multiline comments.
  • Split paragraph to word-wrap lines. Alt-Q. Perfect, really.
  • Wrap selection with a tag. Select text, press shortcut, enter tag’s name (in designated area). Done. Alt-Shift-W (Wrap)
  • Soft Undo / Soft Redo = Last edit location (without doing Undo) Ctrl+U / Ctrl+Shift+U But, it’s only meaningful for the first step - later is same as Undo. So override these shortcuts with Edit History plugin.

Less fasinating :)

  • Press Ctrl-E and current or selected text will be copied to a ‘find string’ memory. Now, just typing F3 you can find needed term. This operation is called slurp find string.
  • Show or hide sidebar. To toggle it press Ctrl-K, Ctrl + B. (Kill Bar)
  • Delete a part of a line, left and right from a cursor. Ctrl-Shift-Backspace / Ctrl-Shift-Del

Beautiful ones:

  • Try typing div.cl or span#id and then press Tab.
  • You just typed some opening tag and some text: <span>test. Now, just press Alt-. (dot, like the end). Tag closed.
  • Idented paste: pasted the code to the right indentation position, press Ctrl-Shift-V
  • Brackets are auto-closed and subtly highlighted. To jump to the opening/closing bracket of a current block, hit Ctrl-M. Also, select the whole block with Ctrl-Shift-M. Keep pressing this key, and selection will nicely expand.
  • Selections: shortcuts to select the current line (Ctrl-L), word (Ctrl-D) and in HTML, the whole tag (Ctrl-Shift-A), expand the selection to the same indentation level (Ctrl-Shift-J).

The Definitive Guide: Sublime Text 2

Problems & Solutions

Q: “Switch Project” dialog shows deleted projects A: %APPDATA%\Sublime Text 2\Settings\Session.sublime_session Close ST2. Open that file with another editor. Remove the unwanted projects. Save and re-open ST2.

Q: Markdown support. A: Syntax Highlighting: just make extension .md, and select Color Scheme: Sunburst Plugins: typing helper - SmartMarkdown

Best plugins

Solutions

Synchronization of prefs & packages between multiple computers Sync Sublime Text settings across Windows computers | Juha Palomäki

Articles

Using Sublime Text 2 for Development http://clintberry.com/2012/sublime-text-2-php-symfony-development/ :: Sublime Text 2 for PHP & Wordpress Development | Clint Berry http://rathersplendid.net/home/customise-sublime-text-2 :: Rather Splendid: Customise Sublime Text 2

http://tarantsov.com/blog/2012/02/sublime-text-workflow-that-beats-coda-and-espresso/ :: Andrey Tarantsov: Sublime Text Workflow Customize your Sublime Text 2 configuration for awesome coding. | Nerdi http://hiltmon.com/blog/2012/08/14/my-sublime-text-2-setup/ :: My Sublime Text 2 Setup - The Hiltmon

http://jkudish.com/2012/02/11/sublime-text-2/ :: Why and how I use Sublime Text 2 | Joachim Kudish http://steverandytantra.com/thoughts/three-months-with-sublime-text-2 :: Three Months With Sublime Text 2 in Thoughts http://net.tutsplus.com/tutorials/tools-and-tips/essential-sublime-text-2-plugins-and-extensions/ :: Essential Sublime Text 2 Plugins

A great list of resources: Sublime Text 2 Kick Start

Exclude Compressed CSS from Sublime Text 2 Projects

http://1p1e1.tumblr.com/post/14262857223/9-reasons-you-must-install-sublime-text-2-code-like-a :: 1 + 1 = 1 http://soyouwannacode.tumblr.com/post/27240635014/sublime-text-install-w-recommended-plugins :: So You Wanna Code? - Sublime Text Install w/Recommended Plugins

To see command binded to a specific key, type in a console:

sublime.log_commands(True)

Tag: Sublime Text 2 | shoogle designs’ blog

Disable auto update

Settings - User:

// Disable automatic update
"update_check": false,

Linux Install

sudo add-apt-repository ppa:webupd8team/sublime-text-2 sudo apt-get update sudo apt-get install sublime-text


Markdown Syntax Definition

I fixed the Markdown syntax file to include support for multi-line links: Syntax Definitions

Don’t write it in JSON. JavaScript does not support raw strings, so all the regexes will have to be double-escaped. This is an absolute nightmare. Just use YAML.

Cloning a sublime text 3 highlighting syntax definition


Markdown Workflow

Markdown Plugins for Sublime Text

Themes

Themes on Package Control

Themes for Web Developer’s Toys

The Best Sublime Text 3 Themes of 2014 Colorsublime Big List of Sublime Text Themes

Color Schemes with Markdown highlighting

Color schemes on Package Control

FlavourSys/Perv-ColorScheme jonschlinkert/sublime-monokai-extended

An easy way to extend schemes? Syntax highlighting strongly varying from one color scheme to another

!!!

ThemeTweaker - Packages - Package Control


The Complete Visual Guide to Sublime Text 3

Find in files

How to search in all unsaved open files plus in all folders, only for meningfull content.

<open files>,<open folders>,-www/*,-data/*,-*.xlsx,-*.pdf,-*.html,-*tif

date 08. Mar 2015 | modified 10. Jun 2024
filename: Sublime Text - Tricks