Regex searches in gedit!
One thing that bothered me about gedit was the lack of support for regular expressions when searching text. But now that gedit have Python plugins I thought that it would be really easy to add such thing using Python's "re" module.
And indeed it was. Now I have this neat Python plugin called "Regex Search". You can download it from here.
Here is a screenshot of the plugin in action:
Just put the files in /usr/[local/]lib/gedit-2/plugins, as it's not a package yet. You can then access it from the "Tools" menu, in gedit.
I hope gedit guys will realize the imense usefulness of this plugin an decide to ship it along with the standard plugins. :-D
Update: Forgot to say that you need at least a gedit 2.14 to run this, since Python plugins are a relatively new addition.
And indeed it was. Now I have this neat Python plugin called "Regex Search". You can download it from here.
Here is a screenshot of the plugin in action:
Just put the files in /usr/[local/]lib/gedit-2/plugins, as it's not a package yet. You can then access it from the "Tools" menu, in gedit.
I hope gedit guys will realize the imense usefulness of this plugin an decide to ship it along with the standard plugins. :-D
Update: Forgot to say that you need at least a gedit 2.14 to run this, since Python plugins are a relatively new addition.
14 Comments:
This is a great extension, but I echo the sentiments of "groening": replace is a core requirement for developers using gedit. Obviously, that's quite a bigger task than the standard search, but I see no reason for the community not to be working on this.
Is there somewhere more permanent than a blog that development on this plugin can be tracked?
It would also be nice for regexp search to be line-based - i.e. ^ and $ should refer to the beginning/end of each line, not the entire document.
I'm considering doing some work on this - do you intend to accept patches and/or maintain this plugin for future development?
Man your a life saver thanks a million.
Hey man! Here is your plugin with replace stuff
http://rafaelsilva.net/node/103
Thankyou!
@rafael
That's nice Rafael. It's good to see the code being extended and improved.
It seens Ben Fisher also took it one step further.
Hey, very good to know :-)
COULD IT BE MORE STABLE... Was workin very well and then not able to replace anything anymore. At least it was still finding the stuff...
Like plugin that work each time you need it not only when the want
@cesium5500, Groening, bobby
Hi there. I'm glad to know that it was useful to you somehow.
I made this plugin a long time ago, delivered it to gedit guys but it was not integrated into their main tree, thus it has not been maintained since.
It's also a basic regex thing and definitely lacking features. Some people extended it further, as you can see in previous comments, but it seems it still didn't make it into the main tree.
Anyway, I'm a bit surprised that it's still compatible with the current gedit API.
Hi, Daniel!
I found your plugin and the link to the Rafael Silva's version in this blog. It helped me a lot!
OTOH, I missed some functionalities in it, so I added it. For easing access and contribution, I created a project at bitbucket to share this version: http://bitbucket.org/brandizzi/gedit-re-search/
I think you would like to know it.
Thank you, again!
@brandizzi
Good to know indeed.
THANK YOU!!!!!
The best regular expression plugin is "advanced-find" available from http://code.google.com/p/advanced-find/ check it out and I am sure you'll be satisfied. Yasir
I use gedit regex window everyday. I am able to use backreferencing with \1, \2 etc. for replace. I am unable to trace out a replacement backreference for lower case conversion. In Vim it works wtth 0_lowerCase(). I tried things like \1,l, \1L, \1:l. Literal replacements occur. Could you pl. email your advice to ybhask@gmail.com? Thanks in advance.
Do you have any good resources for dealing with the doc object in a gedit python plugin?
I want to perform some document validation logic to it and display an error dialog if its misformed.
thx.
W. MacKenzie
@Wendell
No, I don't. It's been a long time since I last played with gedit code.
Post a Comment
<< Home