Home Download Buy Blog Forum Support

Fast way to select current function in python?

Fast way to select current function in python?

Postby demon386 on Fri Aug 10, 2012 4:25 am

Anyone knows a fast way to select current function in Python?

"command": "expand_selection", "args": {"to": "scope"} should have worked, but it doesn't, leading to select everything.
demon386
 
Posts: 13
Joined: Sun Jun 10, 2012 1:52 pm

Re: Fast way to select current function in python?

Postby demon386 on Fri Aug 10, 2012 4:31 am

"command": "expand_selection", "args": {"to": "indentation"} nearly works, but it won't select the function header. I hope the behavior of expand_selection to scope can be improved.
demon386
 
Posts: 13
Joined: Sun Jun 10, 2012 1:52 pm

Re: Fast way to select current function in python?

Postby sfranky on Thu Jun 06, 2013 3:33 pm

You can press ctrl+shift+j to select the contents of the function/class, but you still have to use the lmb to reverse where the mouse pointer is, so you can select the function/class header as well :(

has anyone found a better way? this is a bit frustrating :cry:
sfranky
 
Posts: 96
Joined: Mon Oct 19, 2009 10:06 pm

Re: Fast way to select current function in python?

Postby tito on Thu Jun 06, 2013 9:04 pm

AFAIK, you can know when a function starts but not when the function ends.
Give APIs, let the community build the rest!
https://github.com/titoBouzout
tito
 
Posts: 855
Joined: Thu Sep 29, 2011 2:27 pm
Location: Montevideo, Uruguay

Re: Fast way to select current function in python?

Postby wuub on Thu Jun 06, 2013 10:10 pm

Well, I'm getting ready to release something that should fit your requirements.

http://youtu.be/u3vXVrLVG5M

If everything goes according to plan, it should be available as an early beta sometime next week.
SublimeREPL via Package Control & SublimePTY dev/pre-alpha. Donations are appreciated, but not required :) Twitter: @wuub
wuub
 
Posts: 218
Joined: Wed Aug 10, 2011 8:16 am
Location: Poland

Re: Fast way to select current function in python?

Postby sfranky on Fri Jun 07, 2013 7:59 am

That looks excellent!! I can't wait !
sfranky
 
Posts: 96
Joined: Mon Oct 19, 2009 10:06 pm

Re: Fast way to select current function in python?

Postby sublimator on Fri Jun 07, 2013 11:53 am

Had a plugin like that for ST1. You can hook in the scope/block awareness into test runner too.

Image

Image
It is better to remain silent and be thought a fool, than to speak out and remove all doubt
sublimator
 
Posts: 649
Joined: Thu Mar 20, 2008 5:41 am

Re: Fast way to select current function in python?

Postby MystickPhoenix on Fri Jun 07, 2013 2:28 pm

wuub wrote:Well, I'm getting ready to release something that should fit your requirements.

http://youtu.be/u3vXVrLVG5M

If everything goes according to plan, it should be available as an early beta sometime next week.


That looks *sweet*!!! Can't wait! Where is the repo if you don't mind me asking?
MystickPhoenix
 
Posts: 26
Joined: Tue Jan 24, 2012 4:36 pm

Re: Fast way to select current function in python?

Postby wuub on Fri Jun 07, 2013 3:07 pm

MystickPhoenix wrote:That looks *sweet*!!! Can't wait! Where is the repo if you don't mind me asking?


It's not ready for general consumption yet. But if you're still interested.

You need this:
Code: Select all
git clone https://github.com/wuub/eyeball.git
cd eyeball
pip install --user .


and this:
https://github.com/wuub/dotfiles/blob/m ... _plugin.py

and this:
https://github.com/wuub/dotfiles/blob/m ... ime-keymap

Ctrl+Shit+C will change selection.
Tested in Stublime Text 3dev & linux only!!!
SublimeREPL via Package Control & SublimePTY dev/pre-alpha. Donations are appreciated, but not required :) Twitter: @wuub
wuub
 
Posts: 218
Joined: Wed Aug 10, 2011 8:16 am
Location: Poland

Re: Fast way to select current function in python?

Postby sfranky on Fri Jun 07, 2013 10:17 pm

I only get a python window for a split-second and then nothing. Nothing in the console, as well. :cry:
(btw, on windows 7)
sfranky
 
Posts: 96
Joined: Mon Oct 19, 2009 10:06 pm

Next

Return to General Discussion

Who is online

Users browsing this forum: mstolte, Yahoo [Bot] and 25 guests