Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
My keymap for GoSublime

GoSublime Key Mappings

These key mappings make more sense to me than always pushing Command-. first. I may yet swap some around depending on which keys I use most often.

Imports

  • Command-I to insert/remove an import
  • Command-Shift-I to jump to the import section

These override incremental find, which I don't see the benefit vs. a normal find.

Open

  • Command-O to fuzzy find a file to open within the project
  • Command-Shift-O to open a file from any Go package
  • Command-N to create a new Go file in the same package
  • Command-Shift-W to open the last closed file (was Command-Shift-T)

Declarations

  • Ctrl-T for jump to a declaration within this file
  • Command-T to jump to a declaration in this project
  • Command-Shift-Tto jump to a declaration from any Go package

Definition under the cursor

  • Command-J for goto definition
  • Command-Shift-H for godocs

Run

  • Command-R for Run (main)
  • Command-Shift-R to run tests

Shell

  • Command-B for GoSublime Shell
  • Command-Shift-B for GoSublime Commander

Command Palette

  • Command-P to open the GoSublime command palette
  • Command-Shift-P to open Sublime Text command palette (default)
[
/* GoSublime */
{
"keys": ["super+s"],
"command": "gs_fmt_save",
"context": [{ "key": "selector", "operator": "equal", "operand": "source.go" }]
},
{
"keys": ["super+shift+s"],
"command": "gs_fmt_prompt_save_as",
"context": [{ "key": "selector", "operator": "equal", "operand": "source.go" }]
},
{
"keys": ["super+space"],
"command": "auto_complete",
"args": {"disable_auto_insert": true, "api_completions_only": true, "next_completion_if_showing": false},
"context": [{ "key": "selector", "operator": "equal", "operand": "source.go" }]
},
{
"keys": ["super+i"],
"command": "gs_palette",
"args": {"palette": "imports", "direct": true},
"context": [{ "key": "selector", "operator": "equal", "operand": "source.go" }]
},
{
"keys": ["ctrl+t"],
"command": "gs_palette",
"args": {"palette": "declarations", "direct": true},
"context": [{ "key": "selector", "operator": "equal", "operand": "source.go" }]
},
{
"keys": ["super+.", "super+e"],
"command": "gs_palette",
"args": {"palette": "errors", "direct": true},
"context": [{ "key": "selector", "operator": "equal", "operand": "source.go" }]
},
{
"keys": ["super+.", "super+["],
"command": "gs_palette",
"args": {"palette": "jump_back"},
"context": [{ "key": "selector", "operator": "equal", "operand": "source.go" }]
},
{
"keys": ["super+shift+i"],
"command": "gs_palette",
"args": {"palette": "jump_to_imports"},
"context": [{ "key": "selector", "operator": "equal", "operand": "source.go" }]
},
{
"keys": ["super+b"],
"command": "gs9o_build",
"context": [{ "key": "selector", "operator": "equal", "operand": "source.go" }]
},
{
"keys": ["super+r"],
"command": "gs9o_open",
"args": {"run": ["replay"]},
"context": [{ "key": "selector", "operator": "equal", "operand": "source.go" }]
},
{
"keys": ["super+j"],
"command": "gs_doc",
"args": {"mode": "goto"},
"context": [{ "key": "selector", "operator": "equal", "operand": "source.go" }]
},
{
"keys": ["super+.", "super+g"],
"command": "gs9o_open_selection",
"context": [{ "key": "selector", "operator": "equal", "operand": "text.9o" }]
},
{
"keys": ["super+shift+h"],
"command": "gs_doc",
"args": {"mode": "hint"},
"context": [{ "key": "selector", "operator": "equal", "operand": "source.go" }]
},
{
"keys": ["super+p"],
"command": "show_overlay",
"args": {"overlay": "command_palette", "text": "GoSublime: "}
},
{
"keys": ["super+.", "super+f"],
"command": "gs_fmt",
"context": [{ "key": "selector", "operator": "equal", "operand": "source.go" }]
},
{
"keys": ["super+n"],
"command": "gs_new_go_file",
"context": [{ "key": "selector", "operator": "equal", "operand": "source.go" }]
},
{
"keys": ["super+shift+t"],
"command": "gs_browse_declarations"
},
{
"keys": ["super+t"],
"command": "gs_browse_declarations",
"args": { "dir": "." },
"context": [{ "key": "selector", "operator": "equal", "operand": "source.go" }]
},
{
"keys": ["super+shift+o"],
"command": "gs_browse_packages"
},
{
"keys": ["super+", "super+m"],
"command": "gs_browse_files"
},
{
"keys": ["super+shift+r"],
"command": "gs_test",
"context": [{ "key": "selector", "operator": "equal", "operand": "source.go" }]
},
{
"keys": ["super+.", "super+space"],
"command": "gs_show_call_tip",
"context": [{ "key": "selector", "operator": "equal", "operand": "source.go" }]
},
{
"keys": ["super+shift+b"],
"command": "gs9o_open"
},
{
"keys": ["super+space"],
"command": "auto_complete",
"args": {"disable_auto_insert": true, "api_completions_only": true, "next_completion_if_showing": false},
"context": [{ "key": "selector", "operator": "equal", "operand": "text.9o" }]
},
{
"keys": ["enter"],
"command": "gs9o_exec",
"args": {"save_hist": true},
"context": [{ "key": "selector", "operator": "equal", "operand": "text.9o" }]
},
{
"keys": ["enter"],
"command": "commit_completion",
"context": [
{ "key": "auto_complete_visible" },
{ "key": "setting.auto_complete_commit_on_tab", "operand": false },
{ "key": "selector", "operator": "equal", "operand": "text.9o" }
]
},
{
"keys": ["super+enter"],
"command": "gs9o_insert_line",
"context": [{ "key": "selector", "operator": "equal", "operand": "text.9o" }]
},
{
"keys": ["super+shift+enter"],
"command": "gs9o_insert_line",
"args": {"after": false},
"context": [{ "key": "selector", "operator": "equal", "operand": "text.9o" }]
},
/* Override OS X defaults */
{ "keys": ["super+o"], "command": "show_overlay", "args": {"overlay": "goto", "show_files": true} },
{ "keys": ["super+shift+w"], "command": "reopen_last_file" },
{ "keys": ["ctrl+j"], "command": "show_overlay", "args": {"overlay": "goto", "text": ":"} }
]
@nathany

This comment has been minimized.

Copy link
Owner Author

nathany commented Feb 12, 2016

More recent keymaps at https://github.com/nathany/dotfiles

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.