Skip to content

Instantly share code, notes, and snippets.

@kimyvgy
Last active May 5, 2017 03:48
Show Gist options
  • Save kimyvgy/3514beddc05cbf9194368627dad53537 to your computer and use it in GitHub Desktop.
Save kimyvgy/3514beddc05cbf9194368627dad53537 to your computer and use it in GitHub Desktop.
Sublime text 3 key bindings like PHPStorm 2016
// Key bindings like phpstorm 2016.3,
********************************** Requirements before using ***************************************************
1. Please install "Chain of command" plugin.
2. Create 2 custom command for "close_others" and "close_to_right":
2.1. Create "Close others command plugin":
- Tools/Developer/New plugin.
- Paste code bellow:
import sublime_plugin
class CloseOthersCommand(sublime_plugin.TextCommand):
def run(self, edit):
window = self.view.window()
group_index, view_index = window.get_view_index(self.view)
window.run_command("close_others_by_index", { "group": group_index, "index": view_index})
- Then save it.
2.2. Create "Close to right command plugin":
- New plugin.
- Paste code bellow:
import sublime_plugin
class CloseToRightCommand(sublime_plugin.TextCommand):
def run(self, edit):
window = self.view.window()
group_index, view_index = window.get_view_index(self.view)
window.run_command("close_to_right_by_index", { "group": group_index, "index": view_index})
- Then save it.
**************************************************************************************************************
[
{ "keys": ["ctrl+alt+l"], "command": "reindent", "args": {"single_line": false} },
{ "keys": ["alt+right"], "command": "next_view" },
{ "keys": ["alt+left"], "command": "prev_view" },
{ "keys": ["ctrl+shift+d"], "command": "find_under_expand" },
{ "keys": ["ctrl+d"], "command": "duplicate_line" },
{ "keys": ["ctrl+y"], "command": "cut" },
{ "keys": ["alt+1"], "command": "toggle_side_bar" },
{ "keys": ["ctrl+b"], "command": "goto_definition" },
{ "keys": ["ctrl+r"], "command": "show_panel", "args": {"panel": "replace", "reverse": false} },
{ "keys": ["ctrl+."], "command": "fold" },
{ "keys": ["ctrl+,"], "command": "unfold" },
{ "keys": ["ctrl+shift+n"], "command": "show_overlay", "args": {"overlay": "goto", "show_files": true} },
{
"keys": ["ctrl+i"],
"command": "chain",
"args": {
"commands": [
["copy"],
["show_overlay", {"overlay": "goto", "show_files": true}],
["paste"]
]
},
"context": { "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }
},
{ "keys": ["ctrl+shift+w"], "command": "close_others" },
{ "keys": ["ctrl+alt+a"], "command": "close_all" },
{ "keys": ["ctrl+alt+r"], "command": "close_to_right" },
]
// Ctrl + click to go to definition:
Linux - create "Default (Linux).sublime-mousemap" in ~/.config/sublime-text-3/Packages/User
Mac - create "Default (OSX).sublime-mousemap" in ~/Library/Application Support/Sublime Text 3/Packages/User
Win - create "Default (Windows).sublime-mousemap" in %appdata%\Sublime Text 3\Packages\User
[
{
"button": "button1",
"count": 1,
"modifiers": ["ctrl"],
"press_command": "drag_select",
"command": "goto_definition"
}
]
// End
@kimyvgy
Copy link
Author

kimyvgy commented May 4, 2017

Please install "Chain of command" plugin before using.

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