Home Download Buy Blog Forum Support

goto word under cursor?

goto word under cursor?

Postby ken on Fri Apr 19, 2013 5:48 am

Hi,

First post, and having trouble making a macro, maybe I need to work on a plugin. I've searched for a plugin or macro to do this but haven't yet found it.

I'm doing groovy/grails development on a Mac.

One feature I'm sorely missing is Eclipse/STS "F3" goto definition. But that's not exactly what I'm trying here.

First, I found "Find function definition" and it's completely useless on groovy/grails. It doesn't go to the definition even if it's one line down in the same file. Besides, I'm after something more than what this plugin claims to do.

What I want to accomplish is this:
  1. Select word (super-d)
  2. Copy
  3. Goto Anything
  4. Type @#
  5. <paste>
  6. Move the cursor to between the @ and the #
  7. Stop with the goto anything overlay still visible.

I tried to make a macro, here it is:

[
{
"args": null,
"command": "find_under_expand"
},
{
"args": null,
"command": "copy"
},
{
"args": { "overlay": goto", "show_files": "true", "text": "@#"] },
"command": "show_overlay"
},
{
"args": null,
"command": "paste"
},
{
"args": { "to": "bol", "extend": "false" },
"command": "move_to"
},
{
"args": { "by": "characters", "forward": "true" },
"command": "move"
}
]


Could somebody give me a hand here? First, I guess I should ask if the plugin already exists, but also maybe somebody could help me figure out what's wrong with my macro. It doesn't error or anything, nothing happens.

Thanks.
ken
 
Posts: 20
Joined: Fri Apr 19, 2013 3:36 am

Re: goto word under cursor?

Postby ken on Fri Apr 19, 2013 3:22 pm

OK I found something that's almost exactly what I'm after.

https://github.com/FordAldrich/GotoSelection

The only thing I would change is to prepend the word with @# and place the cursor between the @ and the #.
ken
 
Posts: 20
Joined: Fri Apr 19, 2013 3:36 am


Return to Plugin Development

Who is online

Users browsing this forum: Google [Bot] and 3 guests