ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Cheat Sheets

by dmikalova ST2/ST3

A Sublime Text cheat sheets plugin.

Details

  • 1.0.19
  • github.​com
  • 2 years ago
  • 37 minutes ago
  • 4 years ago

Installs

  • Total 8K
  • Win 4K
  • OS X 2K
  • Linux 2K
Jan 19 Jan 18 Jan 17 Jan 16 Jan 15 Jan 14 Jan 13 Jan 12 Jan 11 Jan 10 Jan 9 Jan 8 Jan 7 Jan 6 Jan 5 Jan 4 Jan 3 Jan 2 Jan 1 Dec 31 Dec 30 Dec 29 Dec 28 Dec 27 Dec 26 Dec 25 Dec 24 Dec 23 Dec 22 Dec 21 Dec 20 Dec 19 Dec 18 Dec 17 Dec 16 Dec 15 Dec 14 Dec 13 Dec 12 Dec 11 Dec 10 Dec 9 Dec 8 Dec 7 Dec 6 Dec 5
Windows 0 1 4 2 2 3 0 0 1 0 2 0 1 1 2 4 1 1 0 1 0 0 3 1 0 0 0 2 0 0 1 3 2 0 0 0 0 2 2 1 1 2 0 0 1 0
OS X 0 1 0 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 0 0 0 0 1 1 0 0 0 0 1 0 0 0 1 1 0 1 0 0 0 0 2 1 1 1 0 2
Linux 0 0 0 0 0 0 0 0 1 1 0 5 0 0 3 1 1 1 0 0 1 0 0 1 0 0 0 0 1 0 2 0 1 0 1 1 3 3 0 1 1 0 1 1 1 0

Readme

Source
raw.​githubusercontent.​com

Sublime Text Cheat Sheets Plugin

Cheat Sheets is a plugin for quickly accessing cheat sheets in the Sublime Text editor. Typing the key sequence will open a cheat sheet in a new tab. If the cheat sheet is already open, it will activate that tab.

Regular Expressions Cheatsheet

Installation

Package Control

The Cheat Sheets package is available in Package Control. Once Package Control is installed, install Cheat Sheets by opening the command palette Ctrl + Shft + P, type Install, and select Package Control: Install Package, then type and select Cheat Sheets.

Clone from Github

git clone https://github.com/dmikalova/sublime-cheat-sheets.git

Available Cheat Sheets

At the moment most cheat sheets are under heavy development. Feel free to submit your own sheets or edits. Be aware that edits to the defaults sheets will be erased by an update. If you want to safely edit a sheet, copy it from $ST/Packages/Cheat Sheets/cheat-sheets to $ST/Packages/User/cheat-sheets. If both folders have sheets with the same $filename then the one in $ST/User/cheat-sheets will be opened.

Cheat Sheets can be opened either from the menu: Tools > Cheat Sheets, the command palette by pressing Ctrl + Shft + P and typing Cheat Sheet, or from the following keyboard shortcuts:

Command Keyboard Shortcut
Bash * Ctrl + Shft + C, S, H
Git * Ctrl + Shft + C, G, I, T
Github Flavored Markdown * Ctrl + Shft + C, G, F, M
Go * Ctrl + Shft + C, G, O
KDE * Ctrl + Shft + C, K, D, E
Regular Expressions Ctrl + Shft + C, R, X
Sublime Text * Ctrl + Shft + C, S, T

* Incomplete sheet.

How to add your own Cheat Sheets

  1. Add your cheat sheet to $ST/Packages/User/cheat-sheets/$filename.cheatsheet.

  2. Add a keyboard shortcut by adding the following line to $ST/Packages/User/Default ($OS).sublime-keymap and change the keys and $filename:

    [
        { "keys": ["ctrl+shift+c", "n", "s"], "command": "cheat_sheet", "args": {"cheatsheet": "$filename"} }
    ]
    
  3. Add a menu entry by adding the following to $ST/Packages/User/Main.sublime-menu and change both instances of $filename:

    [
        { "id": "tools", "children": [
            { "id": "cheat-sheets", "caption": "Cheat Sheets", "children": [
                { "caption": "$filename", "command": "cheat_sheet", "args": {"cheatsheet": "$filename"} }
            ]}
        ]}
    ]
    
  4. Add a palette item to $ST/Packages/User/Default.sublime-commands and change both instances of $filename.

    [
        { "caption": "Cheat Sheet: $filename", "command": "cheat_sheet", "args": {"cheatsheet": "$filename"} }
    ]
    

    To add multiple cheat sheets copy and paste just the keys or caption line and add a comma in between each entry to all the above files.

  5. Highlighting follows this format:

    >\t Header
    >\t\t Subtext
    Text
    Command \t Text
    Command \s\s Text
    \tCommand \t Text # Comments
    

    Where \t means tab and \s means space.

  • If there's a problem, you can use the cheat_sheet_tester command. The tester command will print in the console the file paths where it expected to find your $filename. The console can be opened with Ctrl + ` or View > Show Console.

    The tester command can be run directly in the console with:

    view.run_command("cheat_sheet_tester", {"cheatsheet": "$filename"})
    

    The tester command can also be run as a keyboard shortcut with:

    { "keys": ["ctrl+shift+c", "r", "y"], "command": "cheat_sheet_tester", "args": {"cheatsheet": "$filename"} }
    

External Programs

If you want to have access to your cheat sheets outside of Sublime Text you can use KLook on KDE, Gloobus on Gnome, Quick Look on OSX, or maComfort on Windows. However none of the these have syntax highlighting, and there's always the subl command to quickly open a file in Sublime Text.

Credits

This plugin is based off of Steve Hammond's Cheater plugin.