Results 1 to 5 of 5

Thread: How-To: Search in files with GEdit

  1. #1
    Join Date
    Jul 2005
    Location
    Italy
    Beans
    40

    How-To: Search in files with GEdit

    One of the missing features of Gedit is the "search in files" functionality.
    I'm going to describe how this can be easily added without installing any additional plugin.
    This method uses the "External tools" plugin (which comes in bundle with gedit) and "Gnome Search Tool" (gnome's default search tool).
    Let's go!

    1) open Gedit and enable the "External tools" plugin in Edit >> Preferences >> Plugin
    2) don't close the dialog but select the plugin and click "Configure plugin" instead
    3) let's add a new tool with the following properties

    Name : Find in files (or whatever you want)
    Description : Find in files (or whatever you want)
    Accelerator (the keybord shortcut) : type <Control><Shift>f (or whatever you want - be sure it's not already used)
    Command :

    Code:
    	#!/bin/sh
    	xargs gnome-search-tool --contains
    Input : current selection
    Output: bottom panel
    Scope: all documents

    4) Close the dialog

    That's all.
    You can test the newly added tool via the shortcut you've inserted or Tools >> Find in files
    You can also select some text while editing a file and search for that in files

    If you have an easier way to achieve this or even add "Search and replace in files" functionality feel free to contribute and i'll update the post.

  2. #2
    Join Date
    Nov 2005
    Location
    Portugal
    Beans
    638
    Distro
    Lubuntu

    Re: How-To: Search in files with GEdit

    Thanks ralf57,

    it worked perfectly! Very useful, simple and nice. Well done.

  3. #3
    Join Date
    Jul 2005
    Location
    Italy
    Beans
    40

    Re: How-To: Search in files with GEdit

    Glad to know you find it useful

  4. #4
    Join Date
    Mar 2008
    Location
    Stockholm, Sweden
    Beans
    32
    Distro
    Ubuntu 7.10 Gutsy Gibbon

    Re: How-To: Search in files with GEdit

    I found a "Regex Search Files" plugin on the Gedit plugins site http://live.gnome.org/Gedit/Plugins which works better IMO.

  5. #5
    Join Date
    Jul 2005
    Location
    Italy
    Beans
    40

    Re: How-To: Search in files with GEdit

    Quote Originally Posted by zoopzoop View Post
    I found a "Regex Search Files" plugin on the Gedit plugins site http://live.gnome.org/Gedit/Plugins which works better IMO.
    I haven't tried this plugin, but at least it's less workaround-ish than the solution i posted above

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •