Skip to content

Commit

Permalink
Bindings and documentation cleanup: Added new keybindings of 'ctrl+>'…
Browse files Browse the repository at this point in the history
… to jump to definition and 'ctrl+<' to jump back. Fixed README to reflect proper binding of 'ctrl+SHIFT+left-click' for jump to definition, and added 'ctrl+shift+right-click' to jump back. Added symbol list commands to command palette.'
  • Loading branch information
Greg Williams committed Oct 20, 2012
1 parent e2eb539 commit c66c34c
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 22 deletions.
28 changes: 27 additions & 1 deletion Default.sublime-commands
@@ -1,7 +1,33 @@
[
{
"args": {},
"caption": "CTags: Rebuild Tags",
"command": "rebuild_tags"
},
{
"caption": "CTags: Show Symbols (file)",
"command": "show_symbols",
"context": [
{
"key": "selector",
"match_all": true,
"operand": "source -source.css",
"operator": "equal"
}
]
},
{
"caption": "CTags: Show Symbols (all)",
"command": "show_symbols",
"args": {
"type": "multi"
},
"context": [
{
"key": "selector",
"match_all": true,
"operand": "source -source.css",
"operator": "equal"
}
]
}
]
10 changes: 9 additions & 1 deletion Default.sublime-keymap
Expand Up @@ -3,6 +3,10 @@
"command": "navigate_to_definition",
"keys": ["ctrl+t", "ctrl+t"]
},
{
"command": "navigate_to_definition",
"keys": ["ctrl+shift+period"]
},
{
"command": "search_for_definition",
"keys": ["ctrl+t", "ctrl+y"]
Expand All @@ -11,6 +15,10 @@
"command": "jump_back",
"keys": ["ctrl+t", "ctrl+b"]
},
{
"command": "jump_back",
"keys": ["ctrl+shift+comma"]
},
{
"command": "jump_back",
"args": {"to": "last_modification"},
Expand Down Expand Up @@ -61,7 +69,7 @@
{ // override current default
"command": "transpose",
"context": [
{ "key": "num_selections", "operator": "not_equal", "operand": 1 }
{ "key": "num_selections", "operator": "greater_than", "operand": 1 }
],
"keys": ["ctrl+t"]
}
Expand Down
6 changes: 6 additions & 0 deletions Default.sublime-mousemap
Expand Up @@ -5,5 +5,11 @@
"press_command": "drag_select",
"modifiers": ["ctrl","shift"],
"command": "navigate_to_definition"
},
{
"button": "button2",
"count": 1,
"modifiers": ["ctrl","shift"],
"command": "jump_back"
}
]
30 changes: 10 additions & 20 deletions README.creole
Expand Up @@ -16,19 +16,9 @@ To get a proper copy of ctags, use one of the following options:
* Using [[http://www.macports.org/|MacPorts]]:
{{{port install ctags}}}
* Make sure that Sublime Text is using the right version of CTags: Ensure that ~/.MacOSX/environment.plist has /usr/local/bin in the PATH string before /usr/bin (the standard location for CTags). Here's a sample environment.plist that should work:
{{{
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PATH</key>
<string>/usr/local/bin:/usr/bin:/bin</string>
</dict>
</plist>
}}}
* If /usr/local/bin wasn't in your PATH already, you have to log out and log back in for the environment variables to be read in again.
*Make sure that Sublime Text is using the right version of CTags:*
* If 'which ctags' doesn't point at ctags in '/usr/local/bin', make sure you add '/usr/local/bin' to your PATH ahead of the folder that 'which ctags' reported.
** Add or modify the 'export PATH=...' (e.g. in ~/.profile) to make the change permanent
=== Linux ===

Expand Down Expand Up @@ -136,10 +126,10 @@ Thanks :)

=== Commands Listing ===

|=Command |=Key Binding |=Alt Binding |=Mouse Binding |
| rebuild_ctags | ctrl+t ctrl+r | | |
| navigate_to_definition | ctrl+t ctrl+t | ctrl+alt+] | ctrl+alt+left_click |
| jump_back | ctrl+t ctrl+b | ctrl+alt+[ | |
| jump_back to_last_modification | ctrl+t ctrl+m | | |
| show_symbols | alt+s | | |
| show_symbols multi | alt+shift+s | | |
|=Command |=Key Binding |=Alt Binding |=Mouse Binding |
| rebuild_ctags | ctrl+t ctrl+r | | |
| navigate_to_definition | ctrl+t ctrl+t | ctrl+> | ctrl+shift+left_click |
| jump_back | ctrl+t ctrl+b | ctrl+< | ctrl+shift+right_click |
| jump_back to_last_modification | ctrl+t ctrl+m | | |
| show_symbols | alt+s | | |
| show_symbols multi | alt+shift+s | | |

0 comments on commit c66c34c

Please sign in to comment.