≡ Menu

gedit: Add Python / C++ Autocomplete Support

How do I add Autocomplete support to gedit text editor under Linux Gnome desktop operating systems?

gedit is a general purpose UTF-8 compatible text editor for the GNOME desktop systems. gedit is well known for its simplicity and ease of use. You can easily edit various scripting and programming languages source code with gedit.

It is the default text editor for GNOME. gedit comes with a flexible plugin system allowing to dynamically add new features. A number of plugins are included in gedit itself, with more plugins in the gedit-plugins package and online.

Install plugins

Under Debian / Ubuntu Linux you can type the following command to install commonly used plugins:
$ sudo apt-get update
$ sudo apt-get install gedit-plugins

To configure plugin open gedit and visit Edit > Preferences > Plugins Tab

Fig.01: Gedit - Enabling / Disabling a Plugin

Fig.01: Gedit - Enabling / Disabling a Plugin

How Do I Enable a Plugin?

To enable a gedit plugin, perform the following steps:

  • Choose Edit â–¸ Preferences.
  • Select the Plugins tab.
  • Select the check box next to the name of the plugin that you want to enable.
  • Click Close to close the Preferences dialog.

Step For Disabling a Plugin

A plugin remains enabled when you quit gedit. To disable a gedit plugin, perform the following steps:

  1. Choose Edit â–¸ Preferences.
  2. Select the Plugins tab.
  3. Deselect the check box next to the name of the plugin that you want to disable.
  4. Click Close to close the Preferences dialog.

Add Python / C++ Autocomplete Plugin

Grab the latest version of Autocomplete plugin here. Unzip / untar the ball:
$ unzip nagaozen-gedit-plugin-autocomplete-9e7664759c9486f6cd402f89bedd7a3488328580.zip
Sample Outputs:

Archive:  nagaozen-gedit-plugin-autocomplete-9e7664759c9486f6cd402f89bedd7a3488328580.zip
   creating: nagaozen-gedit-plugin-autocomplete-9e7664759c9486f6cd402f89bedd7a3488328580/
  inflating: nagaozen-gedit-plugin-autocomplete-9e7664759c9486f6cd402f89bedd7a3488328580/README.md  
  inflating: nagaozen-gedit-plugin-autocomplete-9e7664759c9486f6cd402f89bedd7a3488328580/autocomplete.gedit-plugin  
   creating: nagaozen-gedit-plugin-autocomplete-9e7664759c9486f6cd402f89bedd7a3488328580/autocomplete/
  inflating: nagaozen-gedit-plugin-autocomplete-9e7664759c9486f6cd402f89bedd7a3488328580/autocomplete/__init__.py

List files:
$ cd nagaozen-gedit-plugin-autocomplete-9e7664759c9486f6cd402f89bedd7a3488328580
$ ls -l

Sample Outputs:

total 12
drwxr-xr-x 2 vivek vivek 4096 2009-05-16 05:01 autocomplete
-rw-r--r-- 1 vivek vivek  594 2009-05-16 05:01 autocomplete.gedit-plugin
-rw-r--r-- 1 vivek vivek 2107 2009-05-16 05:01 README.md

Install Autocomplete Plugin

Type the following commands:
$ mkdir ~/.gnome2/gedit/plugins/
$ cp -avr * ~/.gnome2/gedit/plugins/

To enable a gedit autocomplete plugin, perform the following steps:

  • Choose Edit â–¸ Preferences.
  • Select the Plugins tab.
  • Select the check box next to the name of the Autocomplete plugin.
  • Click Close to close the Preferences dialog.

Now start writing code and you should see the popup autocomplete. Press [Enter] key to accept the completion.

Fig.02: Autocomplete in Action

Fig.02: Autocomplete in Action


Share this tutorial on:

Your support makes a big difference:
I have a small favor to ask. More people are reading the nixCraft. Many of you block advertising which is your right, and advertising revenues are not sufficient to cover my operating costs. So you can see why I need to ask for your help. The nixCraft, takes a lot of my time and hard work to produce. If you use nixCraft, who likes it, helps me with donations:
Become a Supporter →    Make a contribution via Paypal/Bitcoin →   

Don't Miss Any Linux and Unix Tips

Get nixCraft in your inbox. It's free:

{ 13 comments… add one }
  • Jaysunn September 12, 2009, 12:50 pm

    Great tip,

    I was unaware that gedit was capable of this. I will be sure to install and learn from it.

    Thanks Alot,


  • shashidhar September 12, 2009, 2:53 pm

    Good one,

    I too don’t know that gedit supports this kind of feature through plugins.

  • spaceyjase September 12, 2009, 6:32 pm

    Great article; wasn’t aware gedit could do this so a big thank you!

    “Select the check box next to the name of the Autocomplete plugin.”

    It was called ‘Python Code Completion’ in the plugin list :)

  • arunkumar September 13, 2009, 10:37 am

    Great to know about this feature in gedit

  • kalanjali October 3, 2009, 3:35 pm

    it’s not working
    i tried it on eswecha/debian version

  • S. Nilesh (www.itech7.com) October 9, 2009, 5:21 pm

    great feature. i wasn’t aware of this plugin.

  • nagaozen December 22, 2009, 3:08 am

    XD thanks for highlighting my autocomplete plugin. Just some notes:

    In “Grab the latest version of Autocomplete plugin here. Unzip / untar the ball:” – Autocomplete link goes to pycomplete (which is not the one picture is showing)

  • BuZain March 21, 2010, 7:51 pm

    Thanks for the autocomplete installation steps. I’ve just started coding python after a long hiatus and this feature is a great support. BTW, the latest version of the plugin has an install script that does all the magic.

  • patrick November 4, 2010, 2:54 pm

    Thank you for this plugin – it is great!

  • daniel November 6, 2010, 11:00 am

    Well, this autocompletion is useless if all it proposes are names of objects already used in the source code. I’m still struggling with finding an autocompletion plugin that would be aware of all installed python modules and be able to propose those. Or am I missing something?

  • Vinicius July 29, 2011, 5:16 pm

    I can’t use the autocompletion plugin because it doesn’t have a python.json into lib folder, only asp.json… what do I do to enable python autocompletion with this plugin?

  • Nicolas September 27, 2011, 6:23 pm

    Hi everyone, I have a problem with my Mac os x Snow Leopard: I follow every step, but the Plugin isn’t at the panel in Preferences…can somebody help me?



  • mathieu November 3, 2016, 10:54 am

    new link: ( gedit-plugin-codecompletion )


Security: Are you a robot or human?

Leave a Comment

You can use these HTML tags and attributes: <strong> <em> <pre> <code> <a href="" title="">

   Tagged with: , , , , , , , , ,