Skip to content

Commit

Permalink
Merge pull request #31 from arsham/master
Browse files Browse the repository at this point in the history
Mouse click navigation, whicherrs and code cleanups
  • Loading branch information
alvarolm authored Feb 18, 2017
2 parents 9d9c0ef + 02bdc56 commit c26eccf
Show file tree
Hide file tree
Showing 9 changed files with 204 additions and 100 deletions.
8 changes: 5 additions & 3 deletions Default (Linux).sublime-keymap
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
[
{ "keys": ["ctrl+shift+g"], "command": "go_guru"},
{ "keys": ["ctrl+alt+shift+g"], "command": "go_guru_show_results"}
{ "keys": ["ctrl+alt+shift+g"], "command": "go_guru_show_results"},
{ "keys": ["ctrl+.+ctrl+g"], "command": "go_guru_goto_definition", "context": [{ "key": "selector", "operator": "equal", "operand": "source.go" }] },
]
/*
You can also set a key binding for a specific mode by adding a "mode" arg, e.g.:
You can also set a key binding for a specific mode by adding a "mode" arg, e.g.:
...
{ "keys": ["ctrl+super+c"], "command": "go_guru", "args": {"mode": "callers"} },
{ "keys": ["ctrl+super+i"], "command": "go_guru", "args": {"mode": "implements"} },
{ "keys": ["ctrl+super+r"], "command": "go_guru", "args": {"mode": "referrers"} },
{ "keys": ["ctrl+.+ctrl+g"], "command": "go_guru", "args": {"mode": "definition", output=false}},
...
please set this in your user keybinds, no here.
*/
*/
12 changes: 12 additions & 0 deletions Default (Linux).sublime-mousemap
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[
{
"button": "button2",
"modifiers": ["ctrl"],
"press_command": "drag_select",
"command": "go_guru",
"args": {
"mode": "definition",
"output": false
},
},
]
7 changes: 5 additions & 2 deletions Default (OSX).sublime-keymap
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
[
{ "keys": ["ctrl+shift+g"], "command": "go_guru"},
{ "keys": ["ctrl+alt+shift+g"], "command": "go_guru_show_results"}
{ "keys": ["ctrl+alt+shift+g"], "command": "go_guru_show_results"},
{ "keys": ["ctrl+.+ctrl+g"], "command": "go_guru_goto_definition", "context": [{ "key": "selector", "operator": "equal", "operand": "source.go" }] },
]
/*
You can also set a key binding for a specific mode by adding a "mode" arg, e.g.:
...
{ "keys": ["ctrl+super+c"], "command": "go_guru", "args": {"mode": "callers"} },
{ "keys": ["ctrl+super+i"], "command": "go_guru", "args": {"mode": "implements"} },
{ "keys": ["ctrl+super+r"], "command": "go_guru", "args": {"mode": "referrers"} },
{ "keys": ["ctrl+.+ctrl+g"], "command": "go_guru", "args": {"mode": "definition", output=false}},
...
please set this in your user keybinds, no here.
*/
*/
12 changes: 12 additions & 0 deletions Default (OSX).sublime-mousemap
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[
{
"button": "button2",
"modifiers": ["ctrl"],
"press_command": "drag_select",
"command": "go_guru",
"args": {
"mode": "definition",
"output": false
},
},
]
6 changes: 4 additions & 2 deletions Default (Windows).sublime-keymap
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
[
{ "keys": ["ctrl+shift+g"], "command": "go_guru"},
{ "keys": ["ctrl+alt+shift+g"], "command": "go_guru_show_results"}
{ "keys": ["ctrl+alt+shift+g"], "command": "go_guru_show_results"},
{ "keys": ["ctrl+.+ctrl+g"], "command": "go_guru_goto_definition", "context": [{ "key": "selector", "operator": "equal", "operand": "source.go" }] },
]
/*
You can also set a key binding for a specific mode by adding a "mode" arg, e.g.:
...
{ "keys": ["ctrl+super+c"], "command": "go_guru", "args": {"mode": "callers"} },
{ "keys": ["ctrl+super+i"], "command": "go_guru", "args": {"mode": "implements"} },
{ "keys": ["ctrl+super+r"], "command": "go_guru", "args": {"mode": "referrers"} },
{ "keys": ["ctrl+.+ctrl+g"], "command": "go_guru", "args": {"mode": "definition", output=false}},
...
please set this in your user keybinds, no here.
*/
*/
12 changes: 12 additions & 0 deletions Default (Windows).sublime-mousemap
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[
{
"button": "button2",
"modifiers": ["ctrl"],
"press_command": "drag_select",
"command": "go_guru",
"args": {
"mode": "definition",
"output": false
},
},
]
22 changes: 15 additions & 7 deletions Default.sublime-commands
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@
"mode": "definition"
}
},
{
"caption": "GoGuru: jump to definition",
"command": "go_guru",
"args": {
"output": false,
"mode": "definition"
}
},
{
"caption": "GoGuru: describe",
"command": "go_guru",
Expand Down Expand Up @@ -78,24 +86,24 @@
}
},
{
"caption": "GoGuru: referrers",
"caption": "GoGuru: whicherrs",
"command": "go_guru",
"args": {
"mode": "referrers"
"mode": "whicherrs"
}
},
{
"caption": "GoGuru: what",
"caption": "GoGuru: referrers",
"command": "go_guru",
"args": {
"mode": "what"
"mode": "referrers"
}
},
{
"caption": "GoGuru: callgraph",
"caption": "GoGuru: what",
"command": "go_guru",
"args": {
"mode": "callgraph"
"mode": "what"
}
},
{
Expand Down Expand Up @@ -129,5 +137,5 @@
"platform": "OSX"
}
},

]
25 changes: 23 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ GoGuru is a Golang plugin for [SublimeText](http://www.sublimetext.com/) 3 that

Please report any issues or improvements here [https://github.com/alvarolm/GoGuru/issues](https://github.com/alvarolm/GoGuru/issues)

based on previus work from [waigani](http://github.com/waigani/GoOracle).
based on previous work from [waigani](http://github.com/waigani/GoOracle).

the guru tool still is on developent,
the guru tool still is on development,
check out the plan, the official git repo and the code review if you want to keep up:
* https://docs.google.com/document/d/1UErU12vR7jTedYvKHVNRzGPmXqdMASZ6PfE7B-p6sIg/edit#
* https://go.googlesource.com/tools/+log/master/cmd/guru
Expand Down Expand Up @@ -38,6 +38,8 @@ Select, or place your cursor over, a symbol (function, variable, constant etc) a
Select one of the modes and the output will be displayed in a new tab.
**double click on the file name in the results to jump directly to it.**

You also can hold the `ctrl` key and `right-click` on a symbol to jump right to the definition.

Install
-------

Expand Down Expand Up @@ -111,6 +113,7 @@ Default key binding:
[
{ "keys": ["ctrl+shift+g"], "command": "go_guru"},
{ "keys": ["ctrl+alt+shift+g"], "command": "go_guru_show_results"},
{ "keys": ["ctrl+.+ctrl+g"], "command": "go_guru_goto_definition", "context": [{ "key": "selector", "operator": "equal", "operand": "source.go" }] },
]
```

Expand All @@ -123,9 +126,27 @@ You can also set a key binding for a specific mode by adding a "mode" arg, e.g.:
{ "keys": ["ctrl+super+c"], "command": "go_guru", "args": {"mode": "callers"} },
{ "keys": ["ctrl+super+i"], "command": "go_guru", "args": {"mode": "implements"} },
{ "keys": ["ctrl+super+r"], "command": "go_guru", "args": {"mode": "referrers"} },
{ "keys": ["ctrl+.+ctrl+g"], "command": "go_guru", "args": {"mode": "definition", output=false}},
...
```

Default mouse bindings:

```javascript
[
{
"button": "button2",
"modifiers": ["ctrl"],
"press_command": "drag_select",
"command": "go_guru",
"args": {
"mode": "definition",
"output": false
},
},
]
```


Dependencies
------------
Expand Down
Loading

0 comments on commit c26eccf

Please sign in to comment.